31#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32672_MSR_H_
32#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32672_MSR_H_
42#define MSR_NUM_TRACKS 3
45#define MSR_MAX_SAMPLES 1536
48#define MSR_MAX_RAW_LEN_BITS (709)
49#define MSR_MAX_RAW_LEN_BYTES ((MSR_MAX_RAW_LEN_BITS + 7) / 8)
50#define MSR_MAX_RAW_LEN_HALFWORDS ((MSR_MAX_RAW_LEN_BITS + 15) / 16)
53#define MSR_MAX_DEC_LEN (MSR_MAX_RAW_LEN_BITS / 5)
61#define MSR_ERR_OK 0x00
62#define MSR_ERR_BAD_LEN 0x01
63#define MSR_ERR_START_SEN 0x02
64#define MSR_ERR_END_SEN 0x04
65#define MSR_ERR_OUTLIER 0x08
66#define MSR_ERR_PARAM 0x10
67#define MSR_ERR_LRC 0x40
68#define MSR_ERR_PARITY 0x80
81 uint8_t data[MSR_MAX_DEC_LEN];
111void msr_init_track(
unsigned int track);
118void msr_enable(
void);
123void msr_disable(
void);
151void msr_set_complete_callback(
void (*func)(
void));
160unsigned int mcr_get_track_samples(
unsigned int track,
msr_samples_t *samples);
Structure to contain result of a track decode.
Definition: msr.h:71
uint8_t lrc
Definition: msr.h:74
uint16_t speed
the sentinels or the LRC.
Definition: msr.h:80
uint8_t error_code
Error code value.
Definition: msr.h:72
uint8_t len
Definition: msr.h:78
uint8_t parity_errs
Number of characters with parity errors.
Definition: msr.h:73
uint8_t direction
Swipe direction determined from decode.
Definition: msr.h:77
Structure to contain raw MSR samples.
Definition: msr.h:94
MSR sample fields.
Definition: msr.h:85