]> rtime.felk.cvut.cz Git - fpga/rpi-motor-control-pxmc.git/blobdiff - src/app/rpi-pmsm-test1/pxmc_spimc.h
RPi PXMC Test: switch current calibration to work for cumulative ADC FPGA design.
[fpga/rpi-motor-control-pxmc.git] / src / app / rpi-pmsm-test1 / pxmc_spimc.h
index 1bc4e40524c4ce464d06f4de4d11ba8c09afca93..f9768cf9b40cb7a9296e5a05dfccc657051547b8 100644 (file)
@@ -16,6 +16,7 @@ typedef struct spimc_state_t {
   uint32_t pwm[SPIMC_CHAN_COUNT];
   uint32_t act_pos;
   uint32_t index_pos;
+  uint32_t index_occur;
   uint32_t pos_offset;
   int32_t  curadc_val[SPIMC_CHAN_COUNT];
   int32_t  curadc_offs[SPIMC_CHAN_COUNT];
@@ -24,8 +25,9 @@ typedef struct spimc_state_t {
   uint16_t curadc_sqn_last;
   uint32_t curadc_cumsum[SPIMC_CHAN_COUNT];
   uint32_t curadc_cumsum_last[SPIMC_CHAN_COUNT];
-  uint8_t tx_buf[SPIMC_TRANSFER_SIZE];
-  uint8_t rx_buf[SPIMC_TRANSFER_SIZE];
+  uint8_t  tx_buf[SPIMC_TRANSFER_SIZE];
+  uint8_t  rx_buf[SPIMC_TRANSFER_SIZE];
+  int      curadc_use_diff_to_last_fl;
 } spimc_state_t;
 
 int spimc_init(spimc_state_t *spimcst);