24#define LTC_AFE_MAX_DEVICES 3
26#define LTC_AFE_MAX_CELLS_PER_DEVICE 12
27#define LTC_AFE_MAX_THERMISTORS_PER_DEVICE 8
28#define LTC_AFE_MAX_CELLS (LTC_AFE_MAX_DEVICES * LTC_AFE_MAX_CELLS_PER_DEVICE)
29#define LTC_AFE_MAX_THERMISTORS (LTC_AFE_MAX_DEVICES * LTC_AFE_MAX_THERMISTORS_PER_DEVICE)
32#define _PACKED __attribute__((packed))
39typedef enum { LTC_AFE_ADC_MODE_27KHZ = 0, LTC_AFE_ADC_MODE_7KHZ, LTC_AFE_ADC_MODE_26HZ, LTC_AFE_ADC_MODE_14KHZ, LTC_AFE_ADC_MODE_3KHZ, LTC_AFE_ADC_MODE_2KHZ, NUM_LTC_AFE_ADC_MODES } LtcAfeAdcMode;
53 uint32_t spi_baudrate;
55 LtcAfeAdcMode adc_mode;
57 uint16_t cell_bitset[LTC_AFE_MAX_DEVICES];
58 uint16_t aux_bitset[LTC_AFE_MAX_DEVICES];
62 size_t num_thermistors;
73 uint16_t cell_voltages[LTC_AFE_MAX_CELLS];
74 uint16_t aux_voltages[LTC_AFE_MAX_THERMISTORS];
76 uint16_t discharge_bitset[LTC_AFE_MAX_DEVICES];
78 uint16_t cell_result_lookup[LTC_AFE_MAX_CELLS];
79 uint16_t aux_result_lookup[LTC_AFE_MAX_THERMISTORS];
80 uint16_t discharge_cell_lookup[LTC_AFE_MAX_CELLS];
SpiPort
SPI Port selection.
Definition: spi.h:34
StatusCode
StatusCodes for various errors.
Definition: status.h:27
Port and pin data.
Definition: gpio.h:112