6 #define SPIMC_TRANSFER_SIZE 16
7 #define SPIMC_CHAN_COUNT 3
9 #define SPIMC_PWM_VALUE_m 0x0ffff
10 #define SPIMC_PWM_ENABLE 0x10000
11 #define SPIMC_PWM_SHUTDOWN 0x20000
13 typedef struct spimc_state_t {
16 uint32_t pwm[SPIMC_CHAN_COUNT];
21 int32_t curadc_val[SPIMC_CHAN_COUNT];
22 int32_t curadc_offs[SPIMC_CHAN_COUNT];
25 uint16_t curadc_sqn_last;
26 uint32_t curadc_cumsum[SPIMC_CHAN_COUNT];
27 uint32_t curadc_cumsum_last[SPIMC_CHAN_COUNT];
28 uint8_t tx_buf[SPIMC_TRANSFER_SIZE];
29 uint8_t rx_buf[SPIMC_TRANSFER_SIZE];
30 int curadc_use_diff_to_last_fl;
33 int spimc_init(spimc_state_t *spimcst);
35 int spimc_transfer(spimc_state_t *spimcst);
37 #endif /*_PXMC_SPIMC_H*/