no-OS
|
Go to the source code of this file.
Classes | |
struct | ad7280a_dev |
struct | ad7280a_init_param |
Macros | |
#define | AD7280A_PD_OUT |
#define | AD7280A_PD_HIGH |
#define | AD7280A_PD_LOW |
#define | AD7280A_CNVST_OUT |
#define | AD7280A_CNVST_HIGH |
#define | AD7280A_CNVST_LOW |
#define | AD7280A_ALERT_IN no_os_gpio_direction_input(dev->gpio_alert) |
#define | AD7280_ALERT (1 << 6) |
#define | AD7280A_ACQ_TIME_400ns 0 |
#define | AD7280A_ACQ_TIME_800ns 1 |
#define | AD7280A_ACQ_TIME_1200ns 2 |
#define | AD7280A_ACQ_TIME_1600ns 3 |
#define | AD7280A_CONV_AVG_DIS 0 |
#define | AD7280A_CONV_AVG_2 1 |
#define | AD7280A_CONV_AVG_4 2 |
#define | AD7280A_CONV_AVG_8 3 |
#define | AD7280A_ALERT_REMOVE_VIN5 (1 << 2) |
#define | AD7280A_ALERT_REMOVE_VIN4_VIN5 (2 << 2) |
#define | AD7280A_ALERT_REMOVE_AUX5 (1 << 0) |
#define | AD7280A_ALERT_REMOVE_AUX4_AUX5 (2 << 0) |
#define | AD7280A_CELL_VOLTAGE_1 0x0 /* D11 to D0, Read only */ |
#define | AD7280A_CELL_VOLTAGE_2 0x1 /* D11 to D0, Read only */ |
#define | AD7280A_CELL_VOLTAGE_3 0x2 /* D11 to D0, Read only */ |
#define | AD7280A_CELL_VOLTAGE_4 0x3 /* D11 to D0, Read only */ |
#define | AD7280A_CELL_VOLTAGE_5 0x4 /* D11 to D0, Read only */ |
#define | AD7280A_CELL_VOLTAGE_6 0x5 /* D11 to D0, Read only */ |
#define | AD7280A_AUX_ADC_1 0x6 /* D11 to D0, Read only */ |
#define | AD7280A_AUX_ADC_2 0x7 /* D11 to D0, Read only */ |
#define | AD7280A_AUX_ADC_3 0x8 /* D11 to D0, Read only */ |
#define | AD7280A_AUX_ADC_4 0x9 /* D11 to D0, Read only */ |
#define | AD7280A_AUX_ADC_5 0xA /* D11 to D0, Read only */ |
#define | AD7280A_AUX_ADC_6 0xB /* D11 to D0, Read only */ |
#define | AD7280A_SELF_TEST 0xC /* D11 to D0, Read only */ |
#define | AD7280A_CONTROL_HB 0xD /* D15 to D8, Read/write */ |
#define | AD7280A_CONTROL_LB 0xE /* D7 to D0, Read/write */ |
#define | AD7280A_CELL_OVERVOLTAGE 0xF /* D7 to D0, Read/write */ |
#define | AD7280A_CELL_UNDERVOLTAGE 0x10 /* D7 to D0, Read/write */ |
#define | AD7280A_AUX_ADC_OVERVOLTAGE 0x11 /* D7 to D0, Read/write */ |
#define | AD7280A_AUX_ADC_UNDERVOLTAGE 0x12 /* D7 to D0, Read/write */ |
#define | AD7280A_ALERT 0x13 /* D7 to D0, Read/write */ |
#define | AD7280A_CELL_BALANCE 0x14 /* D7 to D0, Read/write */ |
#define | AD7280A_CB1_TIMER 0x15 /* D7 to D0, Read/write */ |
#define | AD7280A_CB2_TIMER 0x16 /* D7 to D0, Read/write */ |
#define | AD7280A_CB3_TIMER 0x17 /* D7 to D0, Read/write */ |
#define | AD7280A_CB4_TIMER 0x18 /* D7 to D0, Read/write */ |
#define | AD7280A_CB5_TIMER 0x19 /* D7 to D0, Read/write */ |
#define | AD7280A_CB6_TIMER 0x1A /* D7 to D0, Read/write */ |
#define | AD7280A_PD_TIMER 0x1B /* D7 to D0, Read/write */ |
#define | AD7280A_READ 0x1C /* D7 to D0, Read/write */ |
#define | AD7280A_CNVST_N_CONTROL 0x1D /* D7 to D0, Read/write */ |
#define | AD7280A_CTRL_HB_CONV_INPUT_ALL (0 << 6) |
#define | AD7280A_CTRL_HB_CONV_INPUT_6CELL_AUX1_3_4 (1 << 6) |
#define | AD7280A_CTRL_HB_CONV_INPUT_6CELL (2 << 6) |
#define | AD7280A_CTRL_HB_CONV_INPUT_SELF_TEST (3 << 6) |
#define | AD7280A_CTRL_HB_CONV_RES_READ_ALL (0 << 4) |
#define | AD7280A_CTRL_HB_CONV_RES_READ_6CELL_AUX1_3_4 (1 << 4) |
#define | AD7280A_CTRL_HB_CONV_RES_READ_6CELL (2 << 4) |
#define | AD7280A_CTRL_HB_CONV_RES_READ_NO (3 << 4) |
#define | AD7280A_CTRL_HB_CONV_START_CNVST (0 << 3) |
#define | AD7280A_CTRL_HB_CONV_START_CS (1 << 3) |
#define | AD7280A_CTRL_HB_CONV_AVG_DIS (0 << 1) |
#define | AD7280A_CTRL_HB_CONV_AVG_2 (1 << 1) |
#define | AD7280A_CTRL_HB_CONV_AVG_4 (2 << 1) |
#define | AD7280A_CTRL_HB_CONV_AVG_8 (3 << 1) |
#define | AD7280A_CTRL_HB_CONV_AVG(x) ((x) << 1) |
#define | AD7280A_CTRL_HB_PWRDN_SW (1 << 0) |
#define | AD7280A_CTRL_LB_SWRST (1 << 7) |
#define | AD7280A_CTRL_LB_ACQ_TIME_400ns (0 << 5) |
#define | AD7280A_CTRL_LB_ACQ_TIME_800ns (1 << 5) |
#define | AD7280A_CTRL_LB_ACQ_TIME_1200ns (2 << 5) |
#define | AD7280A_CTRL_LB_ACQ_TIME_1600ns (3 << 5) |
#define | AD7280A_CTRL_LB_ACQ_TIME(x) ((x) << 5) |
#define | AD7280A_CTRL_LB_MUST_SET (1 << 4) |
#define | AD7280A_CTRL_LB_THERMISTOR_EN (1 << 3) |
#define | AD7280A_CTRL_LB_LOCK_DEV_ADDR (1 << 2) |
#define | AD7280A_CTRL_LB_INC_DEV_ADDR (1 << 1) |
#define | AD7280A_CTRL_LB_DAISY_CHAIN_RB_EN (1 << 0) |
#define | AD7280A_ALERT_GEN_STATIC_HIGH (1 << 6) |
#define | AD7280A_ALERT_RELAY_SIG_CHAIN_DOWN (3 << 6) |
#define | AD7280A_ALL_CELLS (0xAD << 16) |
#define | AD7280A_DEVADDR_MASTER 0 |
#define | AD7280A_DEVADDR_ALL 0x1F |
#define | AD7280A_READ_TXVAL 0xF800030A |
#define | NUMBITS_READ 22 |
#define | NUMBITS_WRITE 21 |
Functions | |
int8_t | ad7280a_init (struct ad7280a_dev **device, struct ad7280a_init_param init_param) |
int32_t | ad7280a_remove (struct ad7280a_dev *dev) |
Free the resources allocated by AD7280A_Init(). More... | |
uint32_t | ad7280a_transfer_32bits (struct ad7280a_dev *dev, uint32_t data) |
uint32_t | ad7280a_crc_write (uint32_t message) |
int32_t | ad7280a_crc_read (uint32_t message) |
int8_t | ad7280a_convert_read_all (struct ad7280a_dev *dev) |
int8_t | ad7280a_convert_data_all (struct ad7280a_dev *dev) |
int16_t | ad7280a_read_register (struct ad7280a_dev *dev, uint8_t dev_addr, uint8_t read_reg) |
int16_t | ad7280a_read_conversion (struct ad7280a_dev *dev, uint8_t dev_addr, uint8_t read_reg) |
float | ad7280a_convert_data (uint8_t type, uint16_t data) |
void | ad7280a_write_register (struct ad7280a_dev *dev, uint8_t dev_addr, uint8_t read_reg, uint8_t reg_val) |
void | ad7280a_selftest_all (struct ad7280a_dev *dev, float *self_test_reg_a, float *self_test_reg_b) |
uint8_t | ad7280a_alert_pin (struct ad7280a_dev *dev) |
#define AD7280_ALERT (1 << 6) |
#define AD7280A_ACQ_TIME_1200ns 2 |
#define AD7280A_ACQ_TIME_1600ns 3 |
#define AD7280A_ACQ_TIME_400ns 0 |
#define AD7280A_ACQ_TIME_800ns 1 |
#define AD7280A_ALERT 0x13 /* D7 to D0, Read/write */ |
#define AD7280A_ALERT_GEN_STATIC_HIGH (1 << 6) |
#define AD7280A_ALERT_IN no_os_gpio_direction_input(dev->gpio_alert) |
#define AD7280A_ALERT_RELAY_SIG_CHAIN_DOWN (3 << 6) |
#define AD7280A_ALERT_REMOVE_AUX4_AUX5 (2 << 0) |
#define AD7280A_ALERT_REMOVE_AUX5 (1 << 0) |
#define AD7280A_ALERT_REMOVE_VIN4_VIN5 (2 << 2) |
#define AD7280A_ALERT_REMOVE_VIN5 (1 << 2) |
#define AD7280A_ALL_CELLS (0xAD << 16) |
#define AD7280A_AUX_ADC_1 0x6 /* D11 to D0, Read only */ |
#define AD7280A_AUX_ADC_2 0x7 /* D11 to D0, Read only */ |
#define AD7280A_AUX_ADC_3 0x8 /* D11 to D0, Read only */ |
#define AD7280A_AUX_ADC_4 0x9 /* D11 to D0, Read only */ |
#define AD7280A_AUX_ADC_5 0xA /* D11 to D0, Read only */ |
#define AD7280A_AUX_ADC_6 0xB /* D11 to D0, Read only */ |
#define AD7280A_AUX_ADC_OVERVOLTAGE 0x11 /* D7 to D0, Read/write */ |
#define AD7280A_AUX_ADC_UNDERVOLTAGE 0x12 /* D7 to D0, Read/write */ |
#define AD7280A_CB1_TIMER 0x15 /* D7 to D0, Read/write */ |
#define AD7280A_CB2_TIMER 0x16 /* D7 to D0, Read/write */ |
#define AD7280A_CB3_TIMER 0x17 /* D7 to D0, Read/write */ |
#define AD7280A_CB4_TIMER 0x18 /* D7 to D0, Read/write */ |
#define AD7280A_CB5_TIMER 0x19 /* D7 to D0, Read/write */ |
#define AD7280A_CB6_TIMER 0x1A /* D7 to D0, Read/write */ |
#define AD7280A_CELL_BALANCE 0x14 /* D7 to D0, Read/write */ |
#define AD7280A_CELL_OVERVOLTAGE 0xF /* D7 to D0, Read/write */ |
#define AD7280A_CELL_UNDERVOLTAGE 0x10 /* D7 to D0, Read/write */ |
#define AD7280A_CELL_VOLTAGE_1 0x0 /* D11 to D0, Read only */ |
#define AD7280A_CELL_VOLTAGE_2 0x1 /* D11 to D0, Read only */ |
#define AD7280A_CELL_VOLTAGE_3 0x2 /* D11 to D0, Read only */ |
#define AD7280A_CELL_VOLTAGE_4 0x3 /* D11 to D0, Read only */ |
#define AD7280A_CELL_VOLTAGE_5 0x4 /* D11 to D0, Read only */ |
#define AD7280A_CELL_VOLTAGE_6 0x5 /* D11 to D0, Read only */ |
#define AD7280A_CNVST_HIGH |
#define AD7280A_CNVST_LOW |
#define AD7280A_CNVST_N_CONTROL 0x1D /* D7 to D0, Read/write */ |
#define AD7280A_CNVST_OUT |
#define AD7280A_CONTROL_HB 0xD /* D15 to D8, Read/write */ |
#define AD7280A_CONTROL_LB 0xE /* D7 to D0, Read/write */ |
#define AD7280A_CONV_AVG_2 1 |
#define AD7280A_CONV_AVG_4 2 |
#define AD7280A_CONV_AVG_8 3 |
#define AD7280A_CONV_AVG_DIS 0 |
#define AD7280A_CTRL_HB_CONV_AVG | ( | x | ) | ((x) << 1) |
#define AD7280A_CTRL_HB_CONV_AVG_2 (1 << 1) |
#define AD7280A_CTRL_HB_CONV_AVG_4 (2 << 1) |
#define AD7280A_CTRL_HB_CONV_AVG_8 (3 << 1) |
#define AD7280A_CTRL_HB_CONV_AVG_DIS (0 << 1) |
#define AD7280A_CTRL_HB_CONV_INPUT_6CELL (2 << 6) |
#define AD7280A_CTRL_HB_CONV_INPUT_6CELL_AUX1_3_4 (1 << 6) |
#define AD7280A_CTRL_HB_CONV_INPUT_ALL (0 << 6) |
#define AD7280A_CTRL_HB_CONV_INPUT_SELF_TEST (3 << 6) |
#define AD7280A_CTRL_HB_CONV_RES_READ_6CELL (2 << 4) |
#define AD7280A_CTRL_HB_CONV_RES_READ_6CELL_AUX1_3_4 (1 << 4) |
#define AD7280A_CTRL_HB_CONV_RES_READ_ALL (0 << 4) |
#define AD7280A_CTRL_HB_CONV_RES_READ_NO (3 << 4) |
#define AD7280A_CTRL_HB_CONV_START_CNVST (0 << 3) |
#define AD7280A_CTRL_HB_CONV_START_CS (1 << 3) |
#define AD7280A_CTRL_HB_PWRDN_SW (1 << 0) |
#define AD7280A_CTRL_LB_ACQ_TIME | ( | x | ) | ((x) << 5) |
#define AD7280A_CTRL_LB_ACQ_TIME_1200ns (2 << 5) |
#define AD7280A_CTRL_LB_ACQ_TIME_1600ns (3 << 5) |
#define AD7280A_CTRL_LB_ACQ_TIME_400ns (0 << 5) |
#define AD7280A_CTRL_LB_ACQ_TIME_800ns (1 << 5) |
#define AD7280A_CTRL_LB_DAISY_CHAIN_RB_EN (1 << 0) |
#define AD7280A_CTRL_LB_INC_DEV_ADDR (1 << 1) |
#define AD7280A_CTRL_LB_LOCK_DEV_ADDR (1 << 2) |
#define AD7280A_CTRL_LB_MUST_SET (1 << 4) |
#define AD7280A_CTRL_LB_SWRST (1 << 7) |
#define AD7280A_CTRL_LB_THERMISTOR_EN (1 << 3) |
#define AD7280A_DEVADDR_ALL 0x1F |
#define AD7280A_DEVADDR_MASTER 0 |
#define AD7280A_PD_HIGH |
#define AD7280A_PD_LOW |
#define AD7280A_PD_OUT |
#define AD7280A_PD_TIMER 0x1B /* D7 to D0, Read/write */ |
#define AD7280A_READ 0x1C /* D7 to D0, Read/write */ |
#define AD7280A_READ_TXVAL 0xF800030A |
#define AD7280A_SELF_TEST 0xC /* D11 to D0, Read only */ |
#define NUMBITS_READ 22 |
#define NUMBITS_WRITE 21 |
uint8_t ad7280a_alert_pin | ( | struct ad7280a_dev * | dev | ) |
float ad7280a_convert_data | ( | uint8_t | type, |
uint16_t | data | ||
) |
int8_t ad7280a_convert_data_all | ( | struct ad7280a_dev * | dev | ) |
int8_t ad7280a_convert_read_all | ( | struct ad7280a_dev * | dev | ) |
int32_t ad7280a_crc_read | ( | uint32_t | message | ) |
uint32_t ad7280a_crc_write | ( | uint32_t | message | ) |
int8_t ad7280a_init | ( | struct ad7280a_dev ** | device, |
struct ad7280a_init_param | init_param | ||
) |
int16_t ad7280a_read_conversion | ( | struct ad7280a_dev * | dev, |
uint8_t | dev_addr, | ||
uint8_t | read_reg | ||
) |
int16_t ad7280a_read_register | ( | struct ad7280a_dev * | dev, |
uint8_t | dev_addr, | ||
uint8_t | read_reg | ||
) |
int32_t ad7280a_remove | ( | struct ad7280a_dev * | dev | ) |
Free the resources allocated by AD7280A_Init().
dev | - The device structure. |
void ad7280a_selftest_all | ( | struct ad7280a_dev * | dev, |
float * | self_test_reg_a, | ||
float * | self_test_reg_b | ||
) |
uint32_t ad7280a_transfer_32bits | ( | struct ad7280a_dev * | dev, |
uint32_t | data | ||
) |
void ad7280a_write_register | ( | struct ad7280a_dev * | dev, |
uint8_t | dev_addr, | ||
uint8_t | read_reg, | ||
uint8_t | reg_val | ||
) |