Go to the documentation of this file.
52 #define LTC3350_AD_CLR_ALARMS 0x00
53 #define LTC3350_AD_MSK_ALARMS 0x01
54 #define LTC3350_AD_MSK_MON_STATUS 0x02
55 #define LTC3350_AD_CAP_ESR_PER 0x04
56 #define LTC3350_AD_VCAPFB_DAC 0x05
57 #define LTC3350_AD_VSHUNT 0x06
58 #define LTC3350_AD_CAP_UV_LVL 0x07
59 #define LTC3350_AD_CAP_OV_LVL 0x08
60 #define LTC3350_AD_GPI_UV_LVL 0x09
61 #define LTC3350_AD_GPI_OV_LVL 0x0A
62 #define LTC3350_AD_VIN_UV_LVL 0x0B
63 #define LTC3350_AD_VIN_OV_LVL 0x0C
64 #define LTC3350_AD_VCAP_UV_LVL 0x0D
65 #define LTC3350_AD_VCAP_OV_LVL 0x0E
66 #define LTC3350_AD_VOUT_UV_LVL 0x0F
67 #define LTC3350_AD_VOUT_OV_LVL 0x10
68 #define LTC3350_AD_IIN_OC_LVL 0x11
69 #define LTC3350_AD_ICHG_UC_LVL 0x12
70 #define LTC3350_AD_DTEMP_COLD_LVL 0x13
71 #define LTC3350_AD_DTEMP_HOT_LVL 0x14
72 #define LTC3350_AD_ESR_HI_LVL 0x15
73 #define LTC3350_AD_CAP_LO_LVL 0x16
74 #define LTC3350_AD_CTL_REG 0x17
75 #define LTC3350_AD_NUM_CAPS 0x1A
76 #define LTC3350_AD_CHRG_STATUS 0x1B
77 #define LTC3350_AD_MON_STATUS 0x1C
78 #define LTC3350_AD_ALARM_REG 0x1D
79 #define LTC3350_AD_MEAS_CAP 0x1E
80 #define LTC3350_AD_MEAS_ESR 0x1F
81 #define LTC3350_AD_MEAS_VCAP1 0x20
82 #define LTC3350_AD_MEAS_VCAP2 0x21
83 #define LTC3350_AD_MEAS_VCAP3 0x22
84 #define LTC3350_AD_MEAS_VCAP4 0x23
85 #define LTC3350_AD_MEAS_GPI 0x24
86 #define LTC3350_AD_MEAS_VIN 0x25
87 #define LTC3350_AD_MEAS_VCAP 0x26
88 #define LTC3350_AD_MEAS_VOUT 0x27
89 #define LTC3350_AD_MEAS_IIN 0x28
90 #define LTC3350_AD_MEAS_ICHG 0x29
91 #define LTC3350_AD_MEAS_DTEMP 0x2A
102 #ifndef LTC3350_USE_MEASUREMENTS
103 #define LTC3350_USE_MEASUREMENTS 1
111 #ifndef LTC3350_USE_ALARMS
112 #define LTC3350_USE_ALARMS 0
191 uint16_t *read_data);
194 uint16_t write_data);
200 #if LTC3350_USE_MEASUREMENTS
214 #if LTC3350_USE_ALARMS
218 uint16_t alarm_threshold);
222 int ltc3350_get_alarm_status_mask(
struct ltc3350_dev *dev,
223 uint16_t *alarm_mask);
225 int ltc3350_clear_alarm_status_mask(
struct ltc3350_dev *dev);
@ LTC3350_CAP_OV_LVL
Definition: ltc3350.h:122
int ltc3350_get_vcap(struct ltc3350_dev *dev, uint8_t n_cap, uint16_t *value)
Reads the Vcap data for selected capacitor.
Definition: ltc3350.c:206
int ltc3350_init(struct ltc3350_dev **device, struct ltc3350_init_param *init_param)
Initializes the communication peripheral and checks if the LTC3350 part is present.
Definition: ltc3350.c:60
@ LTC3350_VOUT_OV_LVL
Definition: ltc3350.h:130
int32_t no_os_i2c_write(struct no_os_i2c_desc *desc, uint8_t *data, uint8_t bytes_number, uint8_t stop_bit)
I2C Write data to slave device.
Definition: no_os_i2c.c:159
int32_t no_os_i2c_init(struct no_os_i2c_desc **desc, const struct no_os_i2c_init_param *param)
Initialize the I2C communication peripheral.
Definition: no_os_i2c.c:52
@ LTC3350_VOUT_OV_LVL_BIT
Definition: ltc3350.h:150
@ LTC3350_ICHG_UC_LVL
Definition: ltc3350.h:132
@ LTC3350_VCAP_UV_LVL
Definition: ltc3350.h:127
@ LTC3350_VOUT_UV_LVL_BIT
Definition: ltc3350.h:149
int ltc3350_write_device_data(struct ltc3350_dev *dev, uint8_t base_address, uint16_t write_data)
Writes data to the device (I2C)
Definition: ltc3350.c:138
int32_t no_os_i2c_remove(struct no_os_i2c_desc *desc)
Free the resources allocated by no_os_i2c_init().
Definition: no_os_i2c.c:113
@ LTC3350_VCAP_OV_LVL_BIT
Definition: ltc3350.h:148
@ LTC3350_GPI_UV_LVL_BIT
Definition: ltc3350.h:143
LTC3350 Device structure.
Definition: ltc3350.h:172
Header file of Delay functions.
Definition: ad9361_util.h:69
int ltc3350_read_device_data(struct ltc3350_dev *dev, uint8_t base_address, uint16_t *read_data)
Reads data from the device (I2C).
Definition: ltc3350.c:110
void * no_os_calloc(size_t nitems, size_t size)
Allocate memory and return a pointer to it, set memory to 0.
Definition: chibios_alloc.c:54
int ltc3350_get_esr(struct ltc3350_dev *dev, uint16_t *value)
Reads the ESR data.
Definition: ltc3350.c:183
int ltc3350_remove(struct ltc3350_dev *dev)
Free the resources allocated by ltc3350_init().
Definition: ltc3350.c:88
@ LTC3350_IIN_OC_LVL_BIT
Definition: ltc3350.h:151
#define LTC3350_AD_CLR_ALARMS
Definition: ltc3350.h:52
@ LTC3350_VCAP_OV_LVL
Definition: ltc3350.h:128
@ LTC3350_VIN_OV_LVL
Definition: ltc3350.h:126
int ltc3350_write_device_data(struct ltc3350_dev *dev, uint8_t base_address, uint16_t write_data)
Writes data to the device (I2C)
Definition: ltc3350.c:138
@ LTC3350_CAP_UV_LVL_B_BIT
Definition: ltc3350.h:141
@ LTC3350_DTEMP_COLD_LVL_BIT
Definition: ltc3350.h:153
@ LTC3350_ESR_HI_LVL_BIT
Definition: ltc3350.h:155
int ltc3350_get_vcap(struct ltc3350_dev *dev, uint8_t n_cap, uint16_t *value)
Reads the Vcap data for selected capacitor.
Definition: ltc3350.c:206
int ltc3350_init(struct ltc3350_dev **device, struct ltc3350_init_param *init_param)
Initializes the communication peripheral and checks if the LTC3350 part is present.
Definition: ltc3350.c:60
@ LTC3350_VIN_UV_LVL
Definition: ltc3350.h:125
int ltc3350_read_device_data(struct ltc3350_dev *dev, uint8_t base_address, uint16_t *read_data)
Reads data from the device (I2C).
Definition: ltc3350.c:110
#define LTC3350_AD_NUM_CAPS
Definition: ltc3350.h:75
@ LTC3350_DTEMP_COLD_LVL
Definition: ltc3350.h:133
@ LTC3350_VIN_OV_LVL_BIT
Definition: ltc3350.h:146
@ LTC3350_GPI_OV_LVL
Definition: ltc3350.h:124
Structure holding the parameters for LTC3350 device initialization.
Definition: ltc3350.h:163
ltc3350_enum_alarms
Definition: ltc3350.h:120
int ltc3350_get_num_caps(struct ltc3350_dev *dev, uint8_t *num_caps)
Gets number of capacitors configured based on PIN.
Definition: ltc3350.c:161
@ LTC3350_VCAP_UV_LVL_BIT
Definition: ltc3350.h:147
Structure holding I2C address descriptor.
Definition: no_os_i2c.h:101
#define LTC3350_AD_MEAS_VCAP1
Definition: ltc3350.h:81
int32_t no_os_i2c_read(struct no_os_i2c_desc *desc, uint8_t *data, uint8_t bytes_number, uint8_t stop_bit)
I2C Read data from slave device.
Definition: no_os_i2c.c:190
Header file of I2C Interface.
#define LTC3350_AD_MEAS_VCAP
Definition: ltc3350.h:87
@ LTC3350_CAP_LO_LVL
Definition: ltc3350.h:136
struct no_os_i2c_desc * i2c_desc
Definition: ltc3350.h:174
@ LTC3350_ICHG_UC_LVL_BIT
Definition: ltc3350.h:152
@ LTC3350_VOUT_UV_LVL
Definition: ltc3350.h:129
#define NO_OS_BIT(x)
Definition: no_os_util.h:45
int ltc3350_get_esr(struct ltc3350_dev *dev, uint16_t *value)
Reads the ESR data.
Definition: ltc3350.c:183
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:69
@ LTC3350_DTEMP_HOT_LVL_BIT
Definition: ltc3350.h:154
Structure holding the parameters for I2C initialization.
Definition: no_os_i2c.h:64
@ LTC3350_ESR_HI_LVL
Definition: ltc3350.h:135
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
@ LTC3350_CAP_OV_LVL_BIT
Definition: ltc3350.h:142
@ LTC3350_GPI_UV_LVL
Definition: ltc3350.h:123
ltc3350_enum_alarms_mask
Definition: ltc3350.h:140
#define LTC3350_AD_ALARM_REG
Definition: ltc3350.h:78
@ LTC3350_IIN_OC_LVL
Definition: ltc3350.h:131
@ LTC3350_DTEMP_HOT_LVL
Definition: ltc3350.h:134
#define LTC3350_AD_MEAS_ESR
Definition: ltc3350.h:80
@ LTC3350_VIN_UV_LVL_BIT
Definition: ltc3350.h:145
int ltc3350_get_num_caps(struct ltc3350_dev *dev, uint8_t *num_caps)
Gets number of capacitors configured based on PIN.
Definition: ltc3350.c:161
#define LTC3350_AD_MSK_ALARMS
Definition: ltc3350.h:53
Header file of utility functions.
@ LTC3350_CAP_UV_LVL
Definition: ltc3350.h:121
int ltc3350_remove(struct ltc3350_dev *dev)
Free the resources allocated by ltc3350_init().
Definition: ltc3350.c:88
#define LTC3350_AD_CAP_UV_LVL
Definition: ltc3350.h:58
struct no_os_i2c_init_param i2c_init
Definition: ltc3350.h:165
@ LTC3350_GPI_OV_LVL_BIT
Definition: ltc3350.h:144
Error macro definition for ARM Compiler.
@ LTC3350_CAP_LO_LVL_BIT
Definition: ltc3350.h:156