no-OS
Loading...
Searching...
No Matches
ades1754.h File Reference

Header file for the ADES1754 Driver. More...

#include "no_os_spi.h"
#include "no_os_uart.h"
#include "no_os_util.h"
#include "no_os_units.h"
Include dependency graph for ades1754.h:

Classes

struct  ades1754_init_param
 
struct  ades1754_desc
 

Macros

#define ADES1754_VERSION_REG   0x00
 
#define ADES1754_ADDRESS_REG   0x01
 
#define ADES1754_STATUS1_REG   0x02
 
#define ADES1754_STATUS2_REG   0x03
 
#define ADES1754_STATUS3_REG   0x04
 
#define ADES1754_FMEA1_REG   0x05
 
#define ADES1754_FMEA2_REG   0x06
 
#define ADES1754_ALRTSUM_REG   0x07
 
#define ADES1754_ALRTOVCELL_REG   0x08
 
#define ADES1754_ALRTUVCELL_REG   0x09
 
#define ADES1754_MINMAXCELL_REG   0x0A
 
#define ADES1754_ALRTAUXPRTCT_REG   0x0B
 
#define ADES1754_ALRTUAUXOV_REG   0x0C
 
#define ADES1754_ALRTAUXUV_REG   0x0D
 
#define ADES1754_ALRTCOMPOVR_REG   0x0E
 
#define ADES1754_ALRTCOMPUVR_REG   0x0F
 
#define ADES1754_ALRTCOMPAUXOVR_REG   0x10
 
#define ADES1754_ALRTCOMPAUXUV_REG   0x11
 
#define ADES1754_ALRTBALSWRE_REG   0x12
 
#define ADES1754_SWACTION_REG   0x13
 
#define ADES1754_DEVCFG_REG   0x14
 
#define ADES1754_DEVCFG2_REG   0x15
 
#define ADES1754_AUXGPIOCFG_REG   0x16
 
#define ADES1754_GPIOCFG_REG   0x17
 
#define ADES1754_PACKCFG_REG   0x18
 
#define ADES1754_ALRTIRQEN_REG   0x19
 
#define ADES1754_ALRTOVEN_REG   0x1A
 
#define ADES1754_ALRTUVEN_REG   0x1B
 
#define ADES1754_ALRTAUXOVEN_REG   0x1C
 
#define ADES1754_ALRTAUXUVEN_REG   0x1D
 
#define ADES1754_ALRTCALTST_REG   0x1E
 
#define ADES1754_OVTHCLR_REG   0x1F
 
#define ADES1754_OVTHSET_REG   0x20
 
#define ADES1754_UVTHCLR_REG   0x21
 
#define ADES1754_UVTHSET_REG   0x22
 
#define ADES1754_MSMTCH_REG   0x23
 
#define ADES1754_BIPOVTHCLR_REG   0x24
 
#define ADES1754_BIPOVTHSET_REG   0x25
 
#define ADES1754_BIPUVTHCLR_REG   0x26
 
#define ADES1754_BIPUVTHSET_REG   0x27
 
#define ADES1754_BLKOVTHCLR_REG   0x28
 
#define ADES1754_BLKOVTHSET_REG   0x29
 
#define ADES1754_BLKUVTHCLR_REG   0x2A
 
#define ADES1754_BLKUVTHSET_REG   0x2B
 
#define ADES1754_AUXROVTHCLR_REG   0x30
 
#define ADES1754_AUXROVTHSET_REG   0x31
 
#define ADES1754_AUXRUVTHCLR_REG   0x32
 
#define ADES1754_AUXRUVTHSET_REG   0x33
 
#define ADES1754_AUXAOVTHCLR_REG   0x34
 
#define ADES1754_AUXAOVTHSET_REG   0x35
 
#define ADES1754_AUXAUVTHCLR_REG   0x36
 
#define ADES1754_AUXAUVTHSET_REG   0x37
 
#define ADES1754_COMPOVTH_REG   0x38
 
#define ADES1754_COMPUVTH_REG   0x39
 
#define ADES1754_COMPAUXROVTH_REG   0x3A
 
#define ADES1754_COMPAUXRUVTH_REG   0x3B
 
#define ADES1754_COMPAUXAOVTH_REG   0x3C
 
#define ADES1754_COMPAUXAUVTH_REG   0x3D
 
#define ADES1754_COMPOPNTH_REG   0x3E
 
#define ADES1754_COMPAUXROPNTH_REG   0x3F
 
#define ADES1754_COMPAUXOPNTH_REG   0x40
 
#define ADES1754_COMPACCOVTH_REG   0x41
 
#define ADES1754_COMPACCUVTH_REG   0x42
 
#define ADES1754_BALSHRTTHR_REG   0x43
 
#define ADES1754_BALLOWTHR_REG   0x44
 
#define ADES1754_BALHIGHTHR_REG   0x45
 
#define ADES1754_CELLN_REG(n)
 
#define ADES1754_BLOCK_REG   0x55
 
#define ADES1754_TOTAL_REG   0x56
 
#define ADES1754_DIAG1_REG   0x57
 
#define ADES1754_DIAG2_REG   0x58
 
#define ADES1754_AUX0_REG   0x59
 
#define ADES1754_AUX1_REG   0x5A
 
#define ADES1754_AUX2_REG   0x5B
 
#define ADES1754_AUX3_REG   0x5C
 
#define ADES1754_AUX4_REG   0x5D
 
#define ADES1754_AUX5_REG   0x5E
 
#define ADES1754_POLARITYCTRL_REG   0x5F
 
#define ADES1754_AUXREFCTRL_REG   0x60
 
#define ADES1754_AUXTIME_REG   0x61
 
#define ADES1754_ACQCFG_REG   0x62
 
#define ADES1754_BALSWDLY_REG   0x63
 
#define ADES1754_MEASUREEN1_REG   0x64
 
#define ADES1754_MEASUREEN2_REG   0x65
 
#define ADES1754_SCANCTRL_REG   0x66
 
#define ADES1754_ADCTEST1A_REG   0x67
 
#define ADES1754_ADCTEST1B_REG   0x68
 
#define ADES1754_ADCTEST2A_REG   0x69
 
#define ADES1754_ADCTEST2B_REG   0x6A
 
#define ADES1754_DIAGCFG_REG   0x6B
 
#define ADES1754_CTSTCFG_REG   0x6C
 
#define ADES1754_AUXTSTCFG_REG   0x6D
 
#define ADES1754_DIAGGENCFG_REG   0x6E
 
#define ADES1754_BALSWCTRL_REG   0x6F
 
#define ADES1754_BALEXP1_REG   0x70
 
#define ADES1754_BALEXP2_REG   0x71
 
#define ADES1754_BALEXP3_REG   0x72
 
#define ADES1754_BALEXP4_REG   0x73
 
#define ADES1754_BALEXP5_REG   0x74
 
#define ADES1754_BALEXP6_REG   0x75
 
#define ADES1754_BALEXP7_REG   0x76
 
#define ADES1754_BALEXP8_REG   0x77
 
#define ADES1754_BALEXP9_REG   0x78
 
#define ADES1754_BALEXP10_REG   0x79
 
#define ADES1754_BALEXP11_REG   0x7A
 
#define ADES1754_BALEXP12_REG   0x7B
 
#define ADES1754_BALEXP13_REG   0x7C
 
#define ADES1754_BALEXP14_REG   0x7D
 
#define ADES1754_BALAUTOUVTH_REG   0x7E
 
#define ADES1754_BALDLYCTRL_REG   0x7F
 
#define ADES1754_BALCTRL_REG   0x80
 
#define ADES1754_BALSTAT_REG   0x81
 
#define ADES1754_BALUVSTAT_REG   0x82
 
#define ADES1754_BALDATA_REG   0x83
 
#define ADES1754_I2CPNTR_REG   0x84
 
#define ADES1754_I2CWDATA1_REG   0x85
 
#define ADES1754_I2CWDATA2_REG   0x86
 
#define ADES1754_I2CRDATA1_REG   0x87
 
#define ADES1754_I2CRDATA2_REG   0x88
 
#define ADES1754_I2CCFG_REG   0x89
 
#define ADES1754_I2CSTAT_REG   0x8A
 
#define ADES1754_I2CSEND_REG   0x8B
 
#define ADES1754_ID1_REG   0x8C
 
#define ADES1754_ID2_REG   0x8D
 
#define ADES1754_ID3_REG   0x8E
 
#define ADES1754_OTP3_REG   0x8F
 
#define ADES1754_OTP4_REG   0x90
 
#define ADES1754_OTP5_REG   0x91
 
#define ADES1754_OTP6_REG   0x92
 
#define ADES1754_OTP7_REG   0x93
 
#define ADES1754_OTP8_REG   0x94
 
#define ADES1754_OTP9_REG   0x95
 
#define ADES1754_OTP10_REG   0x96
 
#define ADES1754_OTP11_REG   0x97
 
#define ADES1754_OTP12_REG   0x98
 
#define ADES1754_PREAMBLE_BYTE   0x15
 
#define ADES1754_STOP_BYTE   0x54
 
#define ADES1754_HELLO_ALL_BYTE   0x57
 
#define ADES1754_DEV_ADDR_MAX   0x1F
 
#define ADES1754_WR_ALL   0x02
 
#define ADES1754_RD_ALL   0x03
 
#define ADES1754_DEFAULT_DC_BYTE_SEED   0x00
 
#define ADES1754_FILL_BYTE_C2   0xC2
 
#define ADES1754_FILL_BYTE_D3   0xD3
 
#define ADES1754_WR_MASK   NO_OS_BIT(2)
 
#define ADES1754_RD_MASK   ADES1754_WR_MASK | NO_OS_BIT(0)
 
#define ADES1754_BL_MASK   NO_OS_GENMASK(2, 1)
 
#define ADES1754_RW_ADDR_MASK   NO_OS_GENMASK(7, 3)
 
#define ADES1754_LSB_MASK   NO_OS_GENMASK(7, 0)
 
#define ADES1754_MSB_MASK   NO_OS_GENMASK(15, 8)
 
#define ADES1754_LOWER_NIBBLE_MASK   NO_OS_GENMASK(3, 0)
 
#define ADES1754_UPPER_NIBBLE_MASK   NO_OS_GENMASK(7, 4)
 
#define ADES1754_ADC_METHOD_MASK   NO_OS_BIT(1)
 
#define ADES1754_SCAN_MODE_MASK   NO_OS_GENMASK(8, 6)
 
#define ADES1754_SCAN_REQUEST_MASK   NO_OS_BIT(0)
 
#define ADES1754_IIR_MASK   NO_OS_GENMASK(15, 13)
 
#define ADES1754_ALRTFILT_MASK   NO_OS_BIT(2)
 
#define ADES1754_AMENDFILT_MASK   NO_OS_BIT(1)
 
#define ADES1754_RDFILT_MASK   NO_OS_BIT(0)
 
#define ADES1754_IIR_SCAN_MASK   NO_OS_GENMASK(11, 9)
 
#define ADES1754_DBLBUFEN_MASK   NO_OS_BIT(0)
 
#define ADES1754_CBMODE_MASK   NO_OS_GENMASK(13, 11)
 
#define ADES1754_CBMEASEN_MASK   NO_OS_GENMASK(1, 0)
 
#define ADES1754_CBCALDLY_MASK   NO_OS_GENMASK(2, 0)
 
#define ADES1754_UARTCFG_MASK   NO_OS_GENMASK(15, 14)
 
#define ADES1754_CELL_POLARITY_MASK   NO_OS_BIT(15)
 

Enumerations

enum  ades1754_id {
  ID_ADES1754 ,
  ID_ADES1755 ,
  ID_ADES1756 ,
  ID_ADES1751 ,
  ID_ADES1752
}
 
enum  ades1754_scan_method {
  ADES1754_PYRAMID_METHOD ,
  ADES1754_RAMP_METHOD
}
 
enum  ades1754_scan_mode {
  ADES1754_SCAN_ADC ,
  ADES1754_SCAN_COMP ,
  ADES1754_SCAN_ADC_COMP ,
  ADES1754_ON_DEMAND_CALIB ,
  ADES1754_BALANCING_SW_SHRT ,
  ADES1754_BALANCING_SW_OPEN ,
  ADES1754_CELL_SENSE_OPEN_ODDS ,
  ADES1754_CELL_SENSE_OPEN_EVENS
}
 
enum  ades1754_cell_polarity {
  ADES1754_UNIPOLAR ,
  ADES1754_BIPOLAR
}
 
enum  ades1754_iir_filter_coef {
  ADES1754_IIR_0_125 ,
  ADES1754_IIR_0_250 ,
  ADES1754_IIR_0_375 ,
  ADES1754_IIR_0_500 ,
  ADES1754_IIR_0_625 ,
  ADES1754_IIR_0_750 ,
  ADES1754_IIR_0_875 ,
  ADES1754_IIR_1_000_OFF
}
 
enum  ades1754_buffer_mode {
  ADES1754_SINGLE_BUFF ,
  ADES1754_DOUBLE_BUFF
}
 
enum  ades1754_alert {
  ADES1754_CELL_OV ,
  ADES1754_CELL_UV ,
  ADES1754_BIPOLAR_OV ,
  ADES1754_BIPOLAR_UV ,
  ADES1754_BLOCK_OV ,
  ADES1754_BLOCK_UV ,
  ADES1754_CELL_MISMATCH ,
  ADES1754_AUXIN_OV ,
  ADES1754_AUXIN_UV
}
 
enum  ades1754_bal_mode {
  ADES1754_BAL_DISABLED ,
  ADES1754_BAL_EMERGENCY ,
  ADES1754_BAL_MANUAL_SEC ,
  ADES1754_BAL_MANUAL_MIN ,
  ADES1754_BAL_AUTO_SEC ,
  ADES1754_BAL_AUTO_MIN ,
  ADES1754_BAL_AUTO_GROUP_SEC ,
  ADES1754_BAL_AUTO_GROUP_MIN
}
 
enum  ades1754_bal_meas {
  ADES1754_ALL_MEAS_DISABLED = 1 ,
  ADES1754_ADC_CAL_ON_CBUVTHR_OFF ,
  ADES1754_ALL_MEAS_ENABLED
}
 
enum  ades1754_bal_calib {
  ADES1754_BAL_CALIB_DISABLED ,
  ADES1754_BAL_2_CYCLE ,
  ADES1754_BAL_4_CYCLE ,
  ADES1754_BAL_8_CYCLE ,
  ADES1754_BAL_12_CYCLE ,
  ADES1754_BAL_16_CYCLE ,
  ADES1754_BAL_24_CYCLE
}
 

Functions

int ades1754_hello_all (struct ades1754_desc *desc)
 ADES1754 HELLO ALL specific command message to wake-up devices alongside daisy-chain.
 
int ades1754_write_dev (struct ades1754_desc *desc, uint8_t reg, uint16_t data)
 ADES1754 write device command message.
 
int ades1754_write_all (struct ades1754_desc *desc, uint8_t reg, uint16_t data)
 ADES1754 write all command message.
 
int ades1754_read_dev (struct ades1754_desc *desc, uint8_t reg, uint16_t *data)
 ADES1754 read device command message.
 
int ades1754_read_all (struct ades1754_desc *desc, uint8_t reg, uint16_t *data)
 ADES1754 read all command message.
 
int ades1754_read_block (struct ades1754_desc *desc, uint8_t block, uint8_t reg, uint16_t *data, bool double_size)
 ADES1754 read block command message.
 
int ades1754_update_dev (struct ades1754_desc *desc, uint8_t reg, uint16_t mask, uint16_t val)
 ADES1754 update device command message.
 
int ades1754_set_adc_method (struct ades1754_desc *desc, enum ades1754_scan_method scan_method)
 Set ADC scan method.
 
int ades1754_switch_scan_mode (struct ades1754_desc *desc, enum ades1754_scan_mode mode)
 Select Scan Mode of the cells.
 
int ades1754_set_cell_pol (struct ades1754_desc *desc, enum ades1754_cell_polarity cell_polarity)
 Set Cell Polarity.
 
int ades1754_start_scan (struct ades1754_desc *desc, bool meas, uint16_t cell_mask)
 ADES1754 Start/Stop Scanning function.
 
int ades1754_get_cell_data (struct ades1754_desc *desc, uint8_t cell_nb, int32_t *cell_voltage)
 ADES1754 read cell data.
 
int ades1754_set_iir (struct ades1754_desc *desc, enum ades1754_iir_filter_coef coef)
 Set IIR filter coefficient.
 
int ades1754_set_iir_ctrl (struct ades1754_desc *desc, bool alrtfilt, bool acc, bool output)
 Set speciic IIR filter settings.
 
int ades1754_set_buffer_mode (struct ades1754_desc *desc, enum ades1754_buffer_mode mode)
 Set Buffer mode for data acquisition.
 
int ades1754_set_alert_thr (struct ades1754_desc *desc, enum ades1754_alert alert, uint16_t thr)
 Set specific alert thershold value.
 
int ades1754_get_alert (struct ades1754_desc *desc, enum ades1754_alert alert, bool *enable)
 Read specific alert state.
 
int ades1754_set_balancing_mode (struct ades1754_desc *desc, enum ades1754_bal_mode mode)
 Set Cell Balancing mode.
 
int ades1754_set_balancing_meas (struct ades1754_desc *desc, enum ades1754_bal_meas meas)
 Cell-Ballancing Measurement Enable/Disable.
 
int ades1754_set_balancing_calib (struct ades1754_desc *desc, enum ades1754_bal_calib calib)
 Cell-Balancing Calibration Period Selection.
 
int ades1754_init (struct ades1754_desc **desc, struct ades1754_init_param *init_param)
 ADES1754 device intialization function.
 
int ades1754_remove (struct ades1754_desc *desc)
 Deallocate any resources used by the initialization function..
 

Detailed Description

Header file for the ADES1754 Driver.

Author
Radu Sabau (radu..nosp@m.saba.nosp@m.u@ana.nosp@m.log..nosp@m.com)

Copyright 2025(c) Analog Devices, Inc.

SPDX-License-Identifier: BSD-3-Clause

Macro Definition Documentation

◆ ADES1754_ACQCFG_REG

#define ADES1754_ACQCFG_REG   0x62

◆ ADES1754_ADC_METHOD_MASK

#define ADES1754_ADC_METHOD_MASK   NO_OS_BIT(1)

◆ ADES1754_ADCTEST1A_REG

#define ADES1754_ADCTEST1A_REG   0x67

◆ ADES1754_ADCTEST1B_REG

#define ADES1754_ADCTEST1B_REG   0x68

◆ ADES1754_ADCTEST2A_REG

#define ADES1754_ADCTEST2A_REG   0x69

◆ ADES1754_ADCTEST2B_REG

#define ADES1754_ADCTEST2B_REG   0x6A

◆ ADES1754_ADDRESS_REG

#define ADES1754_ADDRESS_REG   0x01

◆ ADES1754_ALRTAUXOVEN_REG

#define ADES1754_ALRTAUXOVEN_REG   0x1C

◆ ADES1754_ALRTAUXPRTCT_REG

#define ADES1754_ALRTAUXPRTCT_REG   0x0B

◆ ADES1754_ALRTAUXUV_REG

#define ADES1754_ALRTAUXUV_REG   0x0D

◆ ADES1754_ALRTAUXUVEN_REG

#define ADES1754_ALRTAUXUVEN_REG   0x1D

◆ ADES1754_ALRTBALSWRE_REG

#define ADES1754_ALRTBALSWRE_REG   0x12

◆ ADES1754_ALRTCALTST_REG

#define ADES1754_ALRTCALTST_REG   0x1E

◆ ADES1754_ALRTCOMPAUXOVR_REG

#define ADES1754_ALRTCOMPAUXOVR_REG   0x10

◆ ADES1754_ALRTCOMPAUXUV_REG

#define ADES1754_ALRTCOMPAUXUV_REG   0x11

◆ ADES1754_ALRTCOMPOVR_REG

#define ADES1754_ALRTCOMPOVR_REG   0x0E

◆ ADES1754_ALRTCOMPUVR_REG

#define ADES1754_ALRTCOMPUVR_REG   0x0F

◆ ADES1754_ALRTFILT_MASK

#define ADES1754_ALRTFILT_MASK   NO_OS_BIT(2)

◆ ADES1754_ALRTIRQEN_REG

#define ADES1754_ALRTIRQEN_REG   0x19

◆ ADES1754_ALRTOVCELL_REG

#define ADES1754_ALRTOVCELL_REG   0x08

◆ ADES1754_ALRTOVEN_REG

#define ADES1754_ALRTOVEN_REG   0x1A

◆ ADES1754_ALRTSUM_REG

#define ADES1754_ALRTSUM_REG   0x07

◆ ADES1754_ALRTUAUXOV_REG

#define ADES1754_ALRTUAUXOV_REG   0x0C

◆ ADES1754_ALRTUVCELL_REG

#define ADES1754_ALRTUVCELL_REG   0x09

◆ ADES1754_ALRTUVEN_REG

#define ADES1754_ALRTUVEN_REG   0x1B

◆ ADES1754_AMENDFILT_MASK

#define ADES1754_AMENDFILT_MASK   NO_OS_BIT(1)

◆ ADES1754_AUX0_REG

#define ADES1754_AUX0_REG   0x59

◆ ADES1754_AUX1_REG

#define ADES1754_AUX1_REG   0x5A

◆ ADES1754_AUX2_REG

#define ADES1754_AUX2_REG   0x5B

◆ ADES1754_AUX3_REG

#define ADES1754_AUX3_REG   0x5C

◆ ADES1754_AUX4_REG

#define ADES1754_AUX4_REG   0x5D

◆ ADES1754_AUX5_REG

#define ADES1754_AUX5_REG   0x5E

◆ ADES1754_AUXAOVTHCLR_REG

#define ADES1754_AUXAOVTHCLR_REG   0x34

◆ ADES1754_AUXAOVTHSET_REG

#define ADES1754_AUXAOVTHSET_REG   0x35

◆ ADES1754_AUXAUVTHCLR_REG

#define ADES1754_AUXAUVTHCLR_REG   0x36

◆ ADES1754_AUXAUVTHSET_REG

#define ADES1754_AUXAUVTHSET_REG   0x37

◆ ADES1754_AUXGPIOCFG_REG

#define ADES1754_AUXGPIOCFG_REG   0x16

◆ ADES1754_AUXREFCTRL_REG

#define ADES1754_AUXREFCTRL_REG   0x60

◆ ADES1754_AUXROVTHCLR_REG

#define ADES1754_AUXROVTHCLR_REG   0x30

◆ ADES1754_AUXROVTHSET_REG

#define ADES1754_AUXROVTHSET_REG   0x31

◆ ADES1754_AUXRUVTHCLR_REG

#define ADES1754_AUXRUVTHCLR_REG   0x32

◆ ADES1754_AUXRUVTHSET_REG

#define ADES1754_AUXRUVTHSET_REG   0x33

◆ ADES1754_AUXTIME_REG

#define ADES1754_AUXTIME_REG   0x61

◆ ADES1754_AUXTSTCFG_REG

#define ADES1754_AUXTSTCFG_REG   0x6D

◆ ADES1754_BALAUTOUVTH_REG

#define ADES1754_BALAUTOUVTH_REG   0x7E

◆ ADES1754_BALCTRL_REG

#define ADES1754_BALCTRL_REG   0x80

◆ ADES1754_BALDATA_REG

#define ADES1754_BALDATA_REG   0x83

◆ ADES1754_BALDLYCTRL_REG

#define ADES1754_BALDLYCTRL_REG   0x7F

◆ ADES1754_BALEXP10_REG

#define ADES1754_BALEXP10_REG   0x79

◆ ADES1754_BALEXP11_REG

#define ADES1754_BALEXP11_REG   0x7A

◆ ADES1754_BALEXP12_REG

#define ADES1754_BALEXP12_REG   0x7B

◆ ADES1754_BALEXP13_REG

#define ADES1754_BALEXP13_REG   0x7C

◆ ADES1754_BALEXP14_REG

#define ADES1754_BALEXP14_REG   0x7D

◆ ADES1754_BALEXP1_REG

#define ADES1754_BALEXP1_REG   0x70

◆ ADES1754_BALEXP2_REG

#define ADES1754_BALEXP2_REG   0x71

◆ ADES1754_BALEXP3_REG

#define ADES1754_BALEXP3_REG   0x72

◆ ADES1754_BALEXP4_REG

#define ADES1754_BALEXP4_REG   0x73

◆ ADES1754_BALEXP5_REG

#define ADES1754_BALEXP5_REG   0x74

◆ ADES1754_BALEXP6_REG

#define ADES1754_BALEXP6_REG   0x75

◆ ADES1754_BALEXP7_REG

#define ADES1754_BALEXP7_REG   0x76

◆ ADES1754_BALEXP8_REG

#define ADES1754_BALEXP8_REG   0x77

◆ ADES1754_BALEXP9_REG

#define ADES1754_BALEXP9_REG   0x78

◆ ADES1754_BALHIGHTHR_REG

#define ADES1754_BALHIGHTHR_REG   0x45

◆ ADES1754_BALLOWTHR_REG

#define ADES1754_BALLOWTHR_REG   0x44

◆ ADES1754_BALSHRTTHR_REG

#define ADES1754_BALSHRTTHR_REG   0x43

◆ ADES1754_BALSTAT_REG

#define ADES1754_BALSTAT_REG   0x81

◆ ADES1754_BALSWCTRL_REG

#define ADES1754_BALSWCTRL_REG   0x6F

◆ ADES1754_BALSWDLY_REG

#define ADES1754_BALSWDLY_REG   0x63

◆ ADES1754_BALUVSTAT_REG

#define ADES1754_BALUVSTAT_REG   0x82

◆ ADES1754_BIPOVTHCLR_REG

#define ADES1754_BIPOVTHCLR_REG   0x24

◆ ADES1754_BIPOVTHSET_REG

#define ADES1754_BIPOVTHSET_REG   0x25

◆ ADES1754_BIPUVTHCLR_REG

#define ADES1754_BIPUVTHCLR_REG   0x26

◆ ADES1754_BIPUVTHSET_REG

#define ADES1754_BIPUVTHSET_REG   0x27

◆ ADES1754_BL_MASK

#define ADES1754_BL_MASK   NO_OS_GENMASK(2, 1)

◆ ADES1754_BLKOVTHCLR_REG

#define ADES1754_BLKOVTHCLR_REG   0x28

◆ ADES1754_BLKOVTHSET_REG

#define ADES1754_BLKOVTHSET_REG   0x29

◆ ADES1754_BLKUVTHCLR_REG

#define ADES1754_BLKUVTHCLR_REG   0x2A

◆ ADES1754_BLKUVTHSET_REG

#define ADES1754_BLKUVTHSET_REG   0x2B

◆ ADES1754_BLOCK_REG

#define ADES1754_BLOCK_REG   0x55

◆ ADES1754_CBCALDLY_MASK

#define ADES1754_CBCALDLY_MASK   NO_OS_GENMASK(2, 0)

◆ ADES1754_CBMEASEN_MASK

#define ADES1754_CBMEASEN_MASK   NO_OS_GENMASK(1, 0)

◆ ADES1754_CBMODE_MASK

#define ADES1754_CBMODE_MASK   NO_OS_GENMASK(13, 11)

◆ ADES1754_CELL_POLARITY_MASK

#define ADES1754_CELL_POLARITY_MASK   NO_OS_BIT(15)

◆ ADES1754_CELLN_REG

#define ADES1754_CELLN_REG ( n)
Value:
(0x47 + (n))

◆ ADES1754_COMPACCOVTH_REG

#define ADES1754_COMPACCOVTH_REG   0x41

◆ ADES1754_COMPACCUVTH_REG

#define ADES1754_COMPACCUVTH_REG   0x42

◆ ADES1754_COMPAUXAOVTH_REG

#define ADES1754_COMPAUXAOVTH_REG   0x3C

◆ ADES1754_COMPAUXAUVTH_REG

#define ADES1754_COMPAUXAUVTH_REG   0x3D

◆ ADES1754_COMPAUXOPNTH_REG

#define ADES1754_COMPAUXOPNTH_REG   0x40

◆ ADES1754_COMPAUXROPNTH_REG

#define ADES1754_COMPAUXROPNTH_REG   0x3F

◆ ADES1754_COMPAUXROVTH_REG

#define ADES1754_COMPAUXROVTH_REG   0x3A

◆ ADES1754_COMPAUXRUVTH_REG

#define ADES1754_COMPAUXRUVTH_REG   0x3B

◆ ADES1754_COMPOPNTH_REG

#define ADES1754_COMPOPNTH_REG   0x3E

◆ ADES1754_COMPOVTH_REG

#define ADES1754_COMPOVTH_REG   0x38

◆ ADES1754_COMPUVTH_REG

#define ADES1754_COMPUVTH_REG   0x39

◆ ADES1754_CTSTCFG_REG

#define ADES1754_CTSTCFG_REG   0x6C

◆ ADES1754_DBLBUFEN_MASK

#define ADES1754_DBLBUFEN_MASK   NO_OS_BIT(0)

◆ ADES1754_DEFAULT_DC_BYTE_SEED

#define ADES1754_DEFAULT_DC_BYTE_SEED   0x00

◆ ADES1754_DEV_ADDR_MAX

#define ADES1754_DEV_ADDR_MAX   0x1F

◆ ADES1754_DEVCFG2_REG

#define ADES1754_DEVCFG2_REG   0x15

◆ ADES1754_DEVCFG_REG

#define ADES1754_DEVCFG_REG   0x14

◆ ADES1754_DIAG1_REG

#define ADES1754_DIAG1_REG   0x57

◆ ADES1754_DIAG2_REG

#define ADES1754_DIAG2_REG   0x58

◆ ADES1754_DIAGCFG_REG

#define ADES1754_DIAGCFG_REG   0x6B

◆ ADES1754_DIAGGENCFG_REG

#define ADES1754_DIAGGENCFG_REG   0x6E

◆ ADES1754_FILL_BYTE_C2

#define ADES1754_FILL_BYTE_C2   0xC2

◆ ADES1754_FILL_BYTE_D3

#define ADES1754_FILL_BYTE_D3   0xD3

◆ ADES1754_FMEA1_REG

#define ADES1754_FMEA1_REG   0x05

◆ ADES1754_FMEA2_REG

#define ADES1754_FMEA2_REG   0x06

◆ ADES1754_GPIOCFG_REG

#define ADES1754_GPIOCFG_REG   0x17

◆ ADES1754_HELLO_ALL_BYTE

#define ADES1754_HELLO_ALL_BYTE   0x57

◆ ADES1754_I2CCFG_REG

#define ADES1754_I2CCFG_REG   0x89

◆ ADES1754_I2CPNTR_REG

#define ADES1754_I2CPNTR_REG   0x84

◆ ADES1754_I2CRDATA1_REG

#define ADES1754_I2CRDATA1_REG   0x87

◆ ADES1754_I2CRDATA2_REG

#define ADES1754_I2CRDATA2_REG   0x88

◆ ADES1754_I2CSEND_REG

#define ADES1754_I2CSEND_REG   0x8B

◆ ADES1754_I2CSTAT_REG

#define ADES1754_I2CSTAT_REG   0x8A

◆ ADES1754_I2CWDATA1_REG

#define ADES1754_I2CWDATA1_REG   0x85

◆ ADES1754_I2CWDATA2_REG

#define ADES1754_I2CWDATA2_REG   0x86

◆ ADES1754_ID1_REG

#define ADES1754_ID1_REG   0x8C

◆ ADES1754_ID2_REG

#define ADES1754_ID2_REG   0x8D

◆ ADES1754_ID3_REG

#define ADES1754_ID3_REG   0x8E

◆ ADES1754_IIR_MASK

#define ADES1754_IIR_MASK   NO_OS_GENMASK(15, 13)

◆ ADES1754_IIR_SCAN_MASK

#define ADES1754_IIR_SCAN_MASK   NO_OS_GENMASK(11, 9)

◆ ADES1754_LOWER_NIBBLE_MASK

#define ADES1754_LOWER_NIBBLE_MASK   NO_OS_GENMASK(3, 0)

◆ ADES1754_LSB_MASK

#define ADES1754_LSB_MASK   NO_OS_GENMASK(7, 0)

◆ ADES1754_MEASUREEN1_REG

#define ADES1754_MEASUREEN1_REG   0x64

◆ ADES1754_MEASUREEN2_REG

#define ADES1754_MEASUREEN2_REG   0x65

◆ ADES1754_MINMAXCELL_REG

#define ADES1754_MINMAXCELL_REG   0x0A

◆ ADES1754_MSB_MASK

#define ADES1754_MSB_MASK   NO_OS_GENMASK(15, 8)

◆ ADES1754_MSMTCH_REG

#define ADES1754_MSMTCH_REG   0x23

◆ ADES1754_OTP10_REG

#define ADES1754_OTP10_REG   0x96

◆ ADES1754_OTP11_REG

#define ADES1754_OTP11_REG   0x97

◆ ADES1754_OTP12_REG

#define ADES1754_OTP12_REG   0x98

◆ ADES1754_OTP3_REG

#define ADES1754_OTP3_REG   0x8F

◆ ADES1754_OTP4_REG

#define ADES1754_OTP4_REG   0x90

◆ ADES1754_OTP5_REG

#define ADES1754_OTP5_REG   0x91

◆ ADES1754_OTP6_REG

#define ADES1754_OTP6_REG   0x92

◆ ADES1754_OTP7_REG

#define ADES1754_OTP7_REG   0x93

◆ ADES1754_OTP8_REG

#define ADES1754_OTP8_REG   0x94

◆ ADES1754_OTP9_REG

#define ADES1754_OTP9_REG   0x95

◆ ADES1754_OVTHCLR_REG

#define ADES1754_OVTHCLR_REG   0x1F

◆ ADES1754_OVTHSET_REG

#define ADES1754_OVTHSET_REG   0x20

◆ ADES1754_PACKCFG_REG

#define ADES1754_PACKCFG_REG   0x18

◆ ADES1754_POLARITYCTRL_REG

#define ADES1754_POLARITYCTRL_REG   0x5F

◆ ADES1754_PREAMBLE_BYTE

#define ADES1754_PREAMBLE_BYTE   0x15

◆ ADES1754_RD_ALL

#define ADES1754_RD_ALL   0x03

◆ ADES1754_RD_MASK

#define ADES1754_RD_MASK   ADES1754_WR_MASK | NO_OS_BIT(0)

◆ ADES1754_RDFILT_MASK

#define ADES1754_RDFILT_MASK   NO_OS_BIT(0)

◆ ADES1754_RW_ADDR_MASK

#define ADES1754_RW_ADDR_MASK   NO_OS_GENMASK(7, 3)

◆ ADES1754_SCAN_MODE_MASK

#define ADES1754_SCAN_MODE_MASK   NO_OS_GENMASK(8, 6)

◆ ADES1754_SCAN_REQUEST_MASK

#define ADES1754_SCAN_REQUEST_MASK   NO_OS_BIT(0)

◆ ADES1754_SCANCTRL_REG

#define ADES1754_SCANCTRL_REG   0x66

◆ ADES1754_STATUS1_REG

#define ADES1754_STATUS1_REG   0x02

◆ ADES1754_STATUS2_REG

#define ADES1754_STATUS2_REG   0x03

◆ ADES1754_STATUS3_REG

#define ADES1754_STATUS3_REG   0x04

◆ ADES1754_STOP_BYTE

#define ADES1754_STOP_BYTE   0x54

◆ ADES1754_SWACTION_REG

#define ADES1754_SWACTION_REG   0x13

◆ ADES1754_TOTAL_REG

#define ADES1754_TOTAL_REG   0x56

◆ ADES1754_UARTCFG_MASK

#define ADES1754_UARTCFG_MASK   NO_OS_GENMASK(15, 14)

◆ ADES1754_UPPER_NIBBLE_MASK

#define ADES1754_UPPER_NIBBLE_MASK   NO_OS_GENMASK(7, 4)

◆ ADES1754_UVTHCLR_REG

#define ADES1754_UVTHCLR_REG   0x21

◆ ADES1754_UVTHSET_REG

#define ADES1754_UVTHSET_REG   0x22

◆ ADES1754_VERSION_REG

#define ADES1754_VERSION_REG   0x00

◆ ADES1754_WR_ALL

#define ADES1754_WR_ALL   0x02

◆ ADES1754_WR_MASK

#define ADES1754_WR_MASK   NO_OS_BIT(2)

Enumeration Type Documentation

◆ ades1754_alert

Enumerator
ADES1754_CELL_OV 
ADES1754_CELL_UV 
ADES1754_BIPOLAR_OV 
ADES1754_BIPOLAR_UV 
ADES1754_BLOCK_OV 
ADES1754_BLOCK_UV 
ADES1754_CELL_MISMATCH 
ADES1754_AUXIN_OV 
ADES1754_AUXIN_UV 

◆ ades1754_bal_calib

Enumerator
ADES1754_BAL_CALIB_DISABLED 
ADES1754_BAL_2_CYCLE 
ADES1754_BAL_4_CYCLE 
ADES1754_BAL_8_CYCLE 
ADES1754_BAL_12_CYCLE 
ADES1754_BAL_16_CYCLE 
ADES1754_BAL_24_CYCLE 

◆ ades1754_bal_meas

Enumerator
ADES1754_ALL_MEAS_DISABLED 
ADES1754_ADC_CAL_ON_CBUVTHR_OFF 
ADES1754_ALL_MEAS_ENABLED 

◆ ades1754_bal_mode

Enumerator
ADES1754_BAL_DISABLED 
ADES1754_BAL_EMERGENCY 
ADES1754_BAL_MANUAL_SEC 
ADES1754_BAL_MANUAL_MIN 
ADES1754_BAL_AUTO_SEC 
ADES1754_BAL_AUTO_MIN 
ADES1754_BAL_AUTO_GROUP_SEC 
ADES1754_BAL_AUTO_GROUP_MIN 

◆ ades1754_buffer_mode

Enumerator
ADES1754_SINGLE_BUFF 
ADES1754_DOUBLE_BUFF 

◆ ades1754_cell_polarity

Enumerator
ADES1754_UNIPOLAR 
ADES1754_BIPOLAR 

◆ ades1754_id

Enumerator
ID_ADES1754 
ID_ADES1755 
ID_ADES1756 
ID_ADES1751 
ID_ADES1752 

◆ ades1754_iir_filter_coef

Enumerator
ADES1754_IIR_0_125 
ADES1754_IIR_0_250 
ADES1754_IIR_0_375 
ADES1754_IIR_0_500 
ADES1754_IIR_0_625 
ADES1754_IIR_0_750 
ADES1754_IIR_0_875 
ADES1754_IIR_1_000_OFF 

◆ ades1754_scan_method

Enumerator
ADES1754_PYRAMID_METHOD 
ADES1754_RAMP_METHOD 

◆ ades1754_scan_mode

Enumerator
ADES1754_SCAN_ADC 
ADES1754_SCAN_COMP 
ADES1754_SCAN_ADC_COMP 
ADES1754_ON_DEMAND_CALIB 
ADES1754_BALANCING_SW_SHRT 
ADES1754_BALANCING_SW_OPEN 
ADES1754_CELL_SENSE_OPEN_ODDS 
ADES1754_CELL_SENSE_OPEN_EVENS 

Function Documentation

◆ ades1754_get_alert()

int ades1754_get_alert ( struct ades1754_desc * desc,
enum ades1754_alert alert,
bool * enable )

Read specific alert state.

Parameters
desc- ADES1754 device descriptor.
alert- Specific pre-defined Alert selection.
enable- true - Specific alert has triggered. false - Specific alert didn't trigger.
Returns
0 in case of success, negative error code otherwise.

◆ ades1754_get_cell_data()

int ades1754_get_cell_data ( struct ades1754_desc * desc,
uint8_t cell_nb,
int32_t * cell_voltage )

ADES1754 read cell data.

Parameters
desc- ADES1754 device descriptor.
cell_nb- Selected Cell Number (0 to 15).
cell_voltage- Raw Cell Voltage data.
Returns
0 in case of success, negative error code otherwise.

◆ ades1754_hello_all()

int ades1754_hello_all ( struct ades1754_desc * desc)

ADES1754 HELLO ALL specific command message to wake-up devices alongside daisy-chain.

Parameters
desc- ADES1754 device descriptor.
Returns
0 in case of success, negative error code otherwise.

◆ ades1754_init()

int ades1754_init ( struct ades1754_desc ** desc,
struct ades1754_init_param * init_param )

ADES1754 device intialization function.

Parameters
desc- ADES1754 device descriptor.
init_param- ADES1754 initialization parameter.
Returns
0 in case of success, negative error code otherwise.

◆ ades1754_read_all()

int ades1754_read_all ( struct ades1754_desc * desc,
uint8_t reg,
uint16_t * data )

ADES1754 read all command message.

Parameters
desc- ADES1754 device descriptor.
reg- Register Address.
data- Data to be read.
Returns
0 in case of success, negative error code otherwise.

◆ ades1754_read_block()

int ades1754_read_block ( struct ades1754_desc * desc,
uint8_t block,
uint8_t reg,
uint16_t * data,
bool double_size )

ADES1754 read block command message.

Parameters
desc- ADES1754 device descriptor.
block- Block number.
reg- Register Address.
data- Data to be read.
double_size- true - Block is double sized (16 bits). false - Block is single sized (8 bits).
Returns
0 in case of success, negative error code otherwise.

◆ ades1754_read_dev()

int ades1754_read_dev ( struct ades1754_desc * desc,
uint8_t reg,
uint16_t * data )

ADES1754 read device command message.

Parameters
desc- ADES1754 device descriptor.
reg- Register Address.
data- Data to be read.
Returns
0 in case of success, negative error code otherwise.

◆ ades1754_remove()

int ades1754_remove ( struct ades1754_desc * desc)

Deallocate any resources used by the initialization function..

Parameters
desc- ADES1754 device descriptor.
Returns
0 in case of success, negative error code otherwise.

◆ ades1754_set_adc_method()

int ades1754_set_adc_method ( struct ades1754_desc * desc,
enum ades1754_scan_method scan_method )

Set ADC scan method.

Parameters
desc- ADES1754 device descriptor.
scan_method- Specific pre-defined value for the Scan Method.
Returns
0 in case of success, negative error code otherwise.

◆ ades1754_set_alert_thr()

int ades1754_set_alert_thr ( struct ades1754_desc * desc,
enum ades1754_alert alert,
uint16_t thr )

Set specific alert thershold value.

Parameters
desc- ADES1754 device descriptor.
alert- Specific pre-defined Alert selection.
thr- Threshold value.
Returns
0 in case of success, negative error code otherwise.

◆ ades1754_set_balancing_calib()

int ades1754_set_balancing_calib ( struct ades1754_desc * desc,
enum ades1754_bal_calib calib )

Cell-Balancing Calibration Period Selection.

Parameters
desc- ADES1754 device descriptor.
calib- Specific pre-defined value for Cell-Balancing Calibration Period number.
Returns
0 in case of success, negative error code otherwise.

◆ ades1754_set_balancing_meas()

int ades1754_set_balancing_meas ( struct ades1754_desc * desc,
enum ades1754_bal_meas meas )

Cell-Ballancing Measurement Enable/Disable.

Parameters
desc- ADES1754 device descriptor.
meas- Specific pre-defined value for Cell-Balancing Measurement state.
Returns
0 in case of success, negative error code otherwise.

◆ ades1754_set_balancing_mode()

int ades1754_set_balancing_mode ( struct ades1754_desc * desc,
enum ades1754_bal_mode mode )

Set Cell Balancing mode.

Parameters
desc- ADES1754 device descriptor.
mode- Specfic pre-defined value for Cell Balancing mode.
Returns
0 in case of success, negative error code otherwise.

◆ ades1754_set_buffer_mode()

int ades1754_set_buffer_mode ( struct ades1754_desc * desc,
enum ades1754_buffer_mode mode )

Set Buffer mode for data acquisition.

Parameters
desc- ADES1754 device descriptor.
mode- Specific pre-defined value for Buffer mode.
Returns
0 in case of success, negative error code otherwise.

◆ ades1754_set_cell_pol()

int ades1754_set_cell_pol ( struct ades1754_desc * desc,
enum ades1754_cell_polarity cell_polarity )

Set Cell Polarity.

Parameters
desc- ADES1754 device descriptor.
cell_polarity- Specific pre-defined value for cell polarity.
Returns
0 in case of success, negative error code otherwise.

◆ ades1754_set_iir()

int ades1754_set_iir ( struct ades1754_desc * desc,
enum ades1754_iir_filter_coef coef )

Set IIR filter coefficient.

Parameters
desc- ADES1754 device descriptor.
coef- Specific pre-defined IIR coefficient value.
Returns
0 in case of success, negative error code otherwise.

◆ ades1754_set_iir_ctrl()

int ades1754_set_iir_ctrl ( struct ades1754_desc * desc,
bool alrtfilt,
bool acc,
bool output )

Set speciic IIR filter settings.

Parameters
desc- ADES1754 device descriptor.
alrtfilt- true - Alert Issuance Based on IIR Filter Results. false - Alert Issuance Based on Raw Sequencer Results.
acc- true - ADC result is included in the IIR accumulator. false - ADC result is not included in the IIR accumulator.
output- true - IIR Filtered ADC data is loaded into the output data registers. false - Unfiltered ADC data is loaded into the output data registers.
Returns
0 in case of success, negative error code otherwise.

◆ ades1754_start_scan()

int ades1754_start_scan ( struct ades1754_desc * desc,
bool meas,
uint16_t cell_mask )

ADES1754 Start/Stop Scanning function.

Parameters
desc- ADES1754 device descriptor.
meas- true - Starts scan. false - Stops scan.
cell_mask- Specific Cell Mask word (each bit set means the cell is selected for measurement).
Returns
0 in case of success, negative error code otherwise.

◆ ades1754_switch_scan_mode()

int ades1754_switch_scan_mode ( struct ades1754_desc * desc,
enum ades1754_scan_mode mode )

Select Scan Mode of the cells.

Parameters
desc- ADES1754 device descriptor.
mode- Specific pre-defined value for the Cell Scan Mode.
Returns
0 in case of success, negative error code otherwise.

◆ ades1754_update_dev()

int ades1754_update_dev ( struct ades1754_desc * desc,
uint8_t reg,
uint16_t mask,
uint16_t val )

ADES1754 update device command message.

Parameters
desc- ADES1754 device descriptor.
reg- Register Address.
mask- Mask of field to be updated.
val- Data to be updated.
Returns
0 in case of success, negative error code otherwise.

◆ ades1754_write_all()

int ades1754_write_all ( struct ades1754_desc * desc,
uint8_t reg,
uint16_t data )

ADES1754 write all command message.

Parameters
desc- ADES1754 device descriptor.
reg- Register Address.
data- Data to be written.
Returns
0 in case of success, negative error code otherwise.

◆ ades1754_write_dev()

int ades1754_write_dev ( struct ades1754_desc * desc,
uint8_t reg,
uint16_t data )

ADES1754 write device command message.

Parameters
desc- ADES1754 device descriptor.
reg- Register Address.
data- Data to be written.
Returns
0 in case of success, negative error code otherwise.