no-OS
ltc4306.h
Go to the documentation of this file.
1 /***************************************************************************/
39 #ifndef __LTC4306_H__
40 #define __LTC4306_H__
41 
42 /******************************************************************************/
43 /***************************** Include Files **********************************/
44 /******************************************************************************/
45 #include <stdint.h>
46 #include <stdlib.h>
47 #include "no_os_i2c.h"
48 #include "no_os_util.h"
49 
50 /******************************************************************************/
51 /************************** LTC4306 Definitions *******************************/
52 /******************************************************************************/
53 
54 /* Register address definitions */
55 #define LTC4306_CTRL_REG0 0x00
56 #define LTC4306_CTRL_REG1 0x01
57 #define LTC4306_CTRL_REG2 0x02
58 #define LTC4306_CTRL_REG3 0x03
59 #define LTC4306_OUT_OF_BOUNDS 0x04
60 
61 /* Special Addresses */
62 #define LTC4306_MASS_WRITE_ADDR 0xBA
63 #define LTC4306_ALERT_RESPONSE_ADDR 0x19
64 
65 /* Masks (Bits and Fields) */
66 /* REG0 */
67 #define LTC4306_DOWNSTREAM_CONNECT NO_OS_BIT(7)
68 #define LTC4306_ALERT_LOGIC(x) NO_OS_BIT(7 - (x))
69 #define LTC4306_FAILED_CONN NO_OS_BIT(2)
70 #define LTC4306_LATCHED_TOUT NO_OS_BIT(1)
71 #define LTC4306_REALTIME_TOUT NO_OS_BIT(0)
72 
73 /* REG1 */
74 #define LTC4306_UPSTREAM_EN NO_OS_BIT(7)
75 #define LTC4306_DOWNSTREAM_EN NO_OS_BIT(6)
76 #define LTC4306_OUT_DRV_STATE(x) NO_OS_BIT(6 - (x))
77 #define LTC4306_GPIO_LOGIC(x) NO_OS_BIT(2 - (x))
78 
79 /* REG2 */
80 #define LTC4306_GPIO_MODE_MASK NO_OS_GENMASK(7, 6)
81 #define LTC4306_GPIO_MODE_CONFIG(x) NO_OS_BIT(8 - (x))
82 #define LTC4306_CONN_REQ NO_OS_BIT(5)
83 #define LTC4306_OUT_MODE_MASK NO_OS_GENMASK(4, 3)
84 #define LTC4306_OUT_MODE_CONFIG(x) NO_OS_BIT(5 - (x))
85 #define LTC4306_MASS_WRITE NO_OS_BIT(2)
86 #define LTC4306_TOUT NO_OS_GENMASK(1, 0)
87 
88 /* REG3 */
89 #define LTC4306_FET_STATE_MASK NO_OS_GENMASK(7, 4)
90 #define LTC4306_FET_STATE(x) NO_OS_BIT(8 - (x))
91 #define LTC4306_BUS_LOGIC_STATE_MASK NO_OS_GENMASK(3, 0)
92 #define LTC4306_LOGIC_STATE(x) NO_OS_BIT(4 - (x))
93 
94 /* Other definitions */
95 #define LTC4306_MIN_CHANNEL_INDEX 1
96 #define LTC4306_CHANNEL_TWO 2
97 #define LTC4306_CHANNEL_THREE 3
98 #define LTC4306_MAX_CHANNEL_INDEX 4
99 #define LTC4306_GPIO_MIN 1
100 #define LTC4306_GPIO_MAX 2
101 
102 /******************************************************************************/
103 /*************************** Types Declarations *******************************/
104 /******************************************************************************/
105 
110 };
111 
117 };
118 
119 struct ltc4306_dev {
121  /* GPIO status indicators (input or ouptut) */
123  /* GPIO out mode indicators (push pull or open drain */
125  /* FET status indicators (connected or not) */
127  /* Upstream accelerator indicator */
128  bool upstream;
129  /* Downstream accelerator indicator */
131 };
132 
134  /* I2C */
136 };
137 
138 /******************************************************************************/
139 /************************ Functions Declarations ******************************/
140 /******************************************************************************/
141 /* Generate slave address depending on A0 and A1 logic levels */
143  enum ltc4306_addr_conn addr0, enum ltc4306_addr_conn addr1,
144  enum ltc4306_addr_conn addr2);
145 
146 /* Initialize device */
147 int ltc4306_init(struct ltc4306_dev **device,
149 
150 /* Write byte/s to selected starting register */
151 int ltc4306_write(struct ltc4306_dev *dev, uint8_t addr, uint8_t *write_data,
152  uint8_t bytes);
153 
154 /* Read byte/s from selected starting register */
155 int ltc4306_read(struct ltc4306_dev *dev, uint8_t addr, uint8_t *read_data,
156  uint8_t bytes);
157 
158 /* Update selected register using mask and desired value */
159 int ltc4306_reg_update(struct ltc4306_dev *dev, uint8_t addr, int update_mask,
160  int update_val);
161 
162 /* Deallocate resources for device */
163 int ltc4306_remove(struct ltc4306_dev *dev);
164 
165 /* Checks if any downstream bus is connected to upstream bus */
166 int ltc4306_downstream_check(struct ltc4306_dev *dev, bool *downstream_conn);
167 
168 /* Reads the status of selected ALERT pin */
170  uint8_t alert_pin_number, bool *is_high);
171 
172 /* Checks if any downstream connection attempt failed */
173 int ltc4306_read_failed_conn(struct ltc4306_dev *dev, bool *is_high);
174 
175 /* Checks if any latched timeout occurs */
176 int ltc4306_get_latched_timeout(struct ltc4306_dev *dev, bool *timed_out);
177 
178 /* Check status of stuck low timeout circuitry */
179 int ltc4306_get_realtime_timeout(struct ltc4306_dev *dev, bool *timed_out);
180 
181 /* Sets status of upstream accelerator */
182 int ltc4306_set_upstream_accel(struct ltc4306_dev *dev, bool upstream_en);
183 
184 /* Gets status of upstream accelerator */
185 int ltc4306_get_upstream_accel(struct ltc4306_dev *dev, bool *upstream_en);
186 
187 /* Sets status of downstream accelerator */
188 int ltc4306_set_downstream_accel(struct ltc4306_dev *dev, bool downstream_en);
189 
190 /* Gets status of downstream accelerator */
191 int ltc4306_get_downstream_accel(struct ltc4306_dev *dev, bool *downstream_en);
192 
193 /* Sets GPIO Output Driver state */
194 int ltc4306_set_gpio_output_state(struct ltc4306_dev *dev, int gpio,
195  bool is_high);
196 
197 /* Gets GPIO Output Driver state */
198 int ltc4306_get_gpio_output_state(struct ltc4306_dev *dev, int gpio,
199  bool *is_high);
200 
201 /* Reads logic level of selected GPIO */
202 int ltc4306_read_gpio_logic_state(struct ltc4306_dev *dev, int gpio,
203  bool *is_high);
204 
205 /* Sets the LTC4306's connection requirement bit field for downstream connect */
206 int ltc4306_set_conn_req(struct ltc4306_dev *dev, bool connect_regardless);
207 
208 /* Gets the LTC4306's connection requirement bit field for downstream connect */
209 int ltc4306_get_conn_req(struct ltc4306_dev *dev, bool *connect_regardless);
210 
211 /* Configure LTC4306's GPIO mode and output config (for output) */
212 int ltc4306_gpio_configure(struct ltc4306_dev *dev, bool gpio1,
213  bool gpio2, bool gpio1_is_pushpull, bool gpio2_is_pushpull);
214 
215 /* Sets the mass write bit field */
216 int ltc4306_set_mass_write(struct ltc4306_dev *dev, bool mass_write_en);
217 
218 /* Gets the mass write bit field */
219 int ltc4306_get_mass_write(struct ltc4306_dev *dev, bool *mass_write_en);
220 
221 /* Sets the LTC4306's stuck low timeout mode */
222 int ltc4306_set_timeout_mode(struct ltc4306_dev *dev,
223  enum ltc4306_timeout_mode tout);
224 
225 /* Gets the LTC4306's stuck low timeout mode */
226 int ltc4306_get_timeout_mode(struct ltc4306_dev *dev,
227  enum ltc4306_timeout_mode *tout);
228 
229 /* Reads LTC4306's selected Bus Logic */
230 int ltc4306_read_bus_logic_state(struct ltc4306_dev *dev, uint8_t bus_number,
231  bool *is_high);
232 
233 /* Sets the connection for selected LTC4306 downstream channel */
235  uint8_t bus_num, bool connect);
236 
237 /* Gets the connection for selected LTC4306 downstream channel */
239  uint8_t bus_num, bool *connect);
240 
241 #endif /* __LTC4306_H__ */
LTC4306_OUT_OF_BOUNDS
#define LTC4306_OUT_OF_BOUNDS
Definition: ltc4306.h:59
no_os_alloc.h
LTC4306_CONN_REQ
#define LTC4306_CONN_REQ
Definition: ltc4306.h:82
ltc4306_dev::downstream
bool downstream
Definition: ltc4306.h:130
no_os_i2c_write
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:165
no_os_i2c_init
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:58
ltc4306_dev::i2c_desc
struct no_os_i2c_desc * i2c_desc
Definition: ltc4306.h:120
ltc4306_set_downstream_channel
int ltc4306_set_downstream_channel(struct ltc4306_dev *dev, uint8_t bus_num, bool connect)
Dis/connects to a downstream bus. Bus logic state must be 1 for connection to occur EXCEPT when conn_...
Definition: ltc4306.c:759
ltc4306_set_upstream_accel
int ltc4306_set_upstream_accel(struct ltc4306_dev *dev, bool upstream_en)
En/Disables upstream accelerator.
Definition: ltc4306.c:388
ltc4306_read_bus_logic_state
int ltc4306_read_bus_logic_state(struct ltc4306_dev *dev, uint8_t bus_number, bool *is_high)
Reads bus logic state.
Definition: ltc4306.c:726
LTC4306_FAILED_CONN
#define LTC4306_FAILED_CONN
Definition: ltc4306.h:69
ltc4306_write
int ltc4306_write(struct ltc4306_dev *dev, uint8_t addr, uint8_t *write_data, uint8_t bytes)
Writes data into a register (I2C).
Definition: ltc4306.c:152
ltc4306_read_bus_logic_state
int ltc4306_read_bus_logic_state(struct ltc4306_dev *dev, uint8_t bus_num, bool *is_high)
Reads bus logic state.
Definition: ltc4306.c:726
no_os_i2c_remove
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:119
ltc4306_write
int ltc4306_write(struct ltc4306_dev *dev, uint8_t addr, uint8_t *write_data, uint8_t bytes)
Writes data into a register (I2C).
Definition: ltc4306.c:152
ltc4306_read_failed_conn
int ltc4306_read_failed_conn(struct ltc4306_dev *dev, bool *is_high)
Reads Failed Connection Attempt bit.
Definition: ltc4306.c:322
ltc4306_get_latched_timeout
int ltc4306_get_latched_timeout(struct ltc4306_dev *dev, bool *timed_out)
Reads Latched Timeout status.
Definition: ltc4306.c:344
LTC4306_DISABLED
@ LTC4306_DISABLED
Definition: ltc4306.h:113
LTC4306_MIN_CHANNEL_INDEX
#define LTC4306_MIN_CHANNEL_INDEX
Definition: ltc4306.h:95
ltc4306_get_conn_req
int ltc4306_get_conn_req(struct ltc4306_dev *dev, bool *connect_regardless)
Gets Connection Requirement bit field.
Definition: ltc4306.c:566
ltc4306_get_mass_write
int ltc4306_get_mass_write(struct ltc4306_dev *dev, bool *mass_write_en)
Gets Mass Write Bit Field status.
Definition: ltc4306.c:663
ltc4306_get_gpio_output_state
int ltc4306_get_gpio_output_state(struct ltc4306_dev *dev, int gpio, bool *is_high)
Gets GPIO Output Driver state.
Definition: ltc4306.c:495
ltc4306_get_upstream_accel
int ltc4306_get_upstream_accel(struct ltc4306_dev *dev, bool *upstream_en)
Get status of upstream accelerator enable bit field.
Definition: ltc4306.c:407
ltc4306_get_realtime_timeout
int ltc4306_get_realtime_timeout(struct ltc4306_dev *dev, bool *timed_out)
Reads Realtime Timeout status.
Definition: ltc4306.c:366
device
Definition: ad9361_util.h:75
LTC4306_GPIO_MODE_CONFIG
#define LTC4306_GPIO_MODE_CONFIG(x)
Definition: ltc4306.h:81
ltc4306_get_conn_req
int ltc4306_get_conn_req(struct ltc4306_dev *dev, bool *connect_regardless)
Gets Connection Requirement bit field.
Definition: ltc4306.c:566
ltc4306_get_downstream_channel
int ltc4306_get_downstream_channel(struct ltc4306_dev *dev, uint8_t bus_num, bool *connect)
Get the connection status of the selected FET.
Definition: ltc4306.c:801
ltc4306_addr_gen
int ltc4306_addr_gen(struct ltc4306_init_param *init_param, enum ltc4306_addr_conn addr0, enum ltc4306_addr_conn addr1, enum ltc4306_addr_conn addr2)
Gives the equivalent hex device address based on the input combination of addr0, addr1,...
Definition: ltc4306.c:241
LTC4306_NO_CONN
@ LTC4306_NO_CONN
Definition: ltc4306.h:109
no_os_calloc
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:60
LTC4306_7P5MS
@ LTC4306_7P5MS
Definition: ltc4306.h:116
ltc4306_get_downstream_channel
int ltc4306_get_downstream_channel(struct ltc4306_dev *dev, uint8_t bus_num, bool *connect)
Get the connection status of the selected FET.
Definition: ltc4306.c:801
ltc4306_downstream_check
int ltc4306_downstream_check(struct ltc4306_dev *dev, bool *downstream_conn)
Get downstream connect bit status to see if any downstream bus connected.
Definition: ltc4306.c:272
ltc4306_set_downstream_accel
int ltc4306_set_downstream_accel(struct ltc4306_dev *dev, bool downstream_en)
En/Disables downstream accelerator.
Definition: ltc4306.c:430
bool
bool
Definition: common.h:54
ltc4306_read_gpio_logic_state
int ltc4306_read_gpio_logic_state(struct ltc4306_dev *dev, int gpio, bool *is_high)
Reads logic of selected GPIO.
Definition: ltc4306.c:522
ltc4306_init_param
Definition: ltc4306.h:133
ltc4306_get_mass_write
int ltc4306_get_mass_write(struct ltc4306_dev *dev, bool *mass_write_en)
Gets Mass Write Bit Field status.
Definition: ltc4306.c:663
no_os_field_prep
uint32_t no_os_field_prep(uint32_t mask, uint32_t val)
ltc4306_read_alert_logic_state
int ltc4306_read_alert_logic_state(struct ltc4306_dev *dev, uint8_t alert_pin_number, bool *is_high)
Reads Alert Logic State of selected ALERT pin.
Definition: ltc4306.c:295
ltc4306_remove
int ltc4306_remove(struct ltc4306_dev *dev)
Free the resources allocated by ltc4306_init().
Definition: ltc4306.c:131
LTC4306_HIGH
@ LTC4306_HIGH
Definition: ltc4306.h:108
LTC4306_TOUT
#define LTC4306_TOUT
Definition: ltc4306.h:86
ltc4306_addr_gen
int ltc4306_addr_gen(struct ltc4306_init_param *init_param, enum ltc4306_addr_conn addr0, enum ltc4306_addr_conn addr1, enum ltc4306_addr_conn addr2)
Gives the equivalent hex device address based on the input combination of addr0, addr1,...
Definition: ltc4306.c:241
LTC4306_LOW
@ LTC4306_LOW
Definition: ltc4306.h:107
LTC4306_GPIO_MAX
#define LTC4306_GPIO_MAX
Definition: ltc4306.h:100
no_os_error.h
Error codes definition.
ltc4306_set_gpio_output_state
int ltc4306_set_gpio_output_state(struct ltc4306_dev *dev, int gpio, bool is_high)
Sets GPIO Output Driver state.
Definition: ltc4306.c:472
ltc4306_get_latched_timeout
int ltc4306_get_latched_timeout(struct ltc4306_dev *dev, bool *timed_out)
Reads Latched Timeout status.
Definition: ltc4306.c:344
LTC4306_CTRL_REG2
#define LTC4306_CTRL_REG2
Definition: ltc4306.h:57
ltc4306_set_upstream_accel
int ltc4306_set_upstream_accel(struct ltc4306_dev *dev, bool upstream_en)
En/Disables upstream accelerator.
Definition: ltc4306.c:388
ltc4306_dev::is_push_pull
bool is_push_pull[LTC4306_GPIO_MAX]
Definition: ltc4306.h:124
LTC4306_REALTIME_TOUT
#define LTC4306_REALTIME_TOUT
Definition: ltc4306.h:71
ltc4306_init_param::i2c_init
struct no_os_i2c_init_param i2c_init
Definition: ltc4306.h:135
ltc4306_read
int ltc4306_read(struct ltc4306_dev *dev, uint8_t addr, uint8_t *read_data, uint8_t bytes)
Reads the value of a register.
Definition: ltc4306.c:184
LTC4306_MASS_WRITE
#define LTC4306_MASS_WRITE
Definition: ltc4306.h:85
ltc4306_set_downstream_accel
int ltc4306_set_downstream_accel(struct ltc4306_dev *dev, bool downstream_en)
En/Disables downstream accelerator.
Definition: ltc4306.c:430
LTC4306_DOWNSTREAM_EN
#define LTC4306_DOWNSTREAM_EN
Definition: ltc4306.h:75
ltc4306_set_timeout_mode
int ltc4306_set_timeout_mode(struct ltc4306_dev *dev, enum ltc4306_timeout_mode tout)
Sets LTC4306's Timeout Mode.
Definition: ltc4306.c:685
ltc4306_reg_update
int ltc4306_reg_update(struct ltc4306_dev *dev, uint8_t addr, int update_mask, int update_val)
Update selected I2C register contents.
Definition: ltc4306.c:214
ltc4306_set_mass_write
int ltc4306_set_mass_write(struct ltc4306_dev *dev, bool mass_write_en)
Enables Mass Write.
Definition: ltc4306.c:646
ltc4306_init
int ltc4306_init(struct ltc4306_dev **device, struct ltc4306_init_param init_param)
Initializes the communication peripheral and checks if the ltc4306 part is present.
Definition: ltc4306.c:100
LTC4306_OUT_MODE_CONFIG
#define LTC4306_OUT_MODE_CONFIG(x)
Definition: ltc4306.h:84
ltc4306_read_failed_conn
int ltc4306_read_failed_conn(struct ltc4306_dev *dev, bool *is_high)
Reads Failed Connection Attempt bit.
Definition: ltc4306.c:322
LTC4306_ALERT_LOGIC
#define LTC4306_ALERT_LOGIC(x)
Definition: ltc4306.h:68
ltc4306.h
Header file of ltc4306 driver.
ltc4306_reg_update
int ltc4306_reg_update(struct ltc4306_dev *dev, uint8_t addr, int update_mask, int update_val)
Update selected I2C register contents.
Definition: ltc4306.c:214
ltc4306_downstream_check
int ltc4306_downstream_check(struct ltc4306_dev *dev, bool *downstream_conn)
Get downstream connect bit status to see if any downstream bus connected.
Definition: ltc4306.c:272
ltc4306_set_gpio_output_state
int ltc4306_set_gpio_output_state(struct ltc4306_dev *dev, int gpio, bool is_high)
Sets GPIO Output Driver state.
Definition: ltc4306.c:472
ltc4306_get_downstream_accel
int ltc4306_get_downstream_accel(struct ltc4306_dev *dev, bool *downstream_en)
Get status of downstream accelerator enable bit field.
Definition: ltc4306.c:449
ltc4306_dev::is_input
bool is_input[LTC4306_GPIO_MAX]
Definition: ltc4306.h:122
LTC4306_CTRL_REG1
#define LTC4306_CTRL_REG1
Definition: ltc4306.h:56
ltc4306_read
int ltc4306_read(struct ltc4306_dev *dev, uint8_t addr, uint8_t *read_data, uint8_t bytes)
Reads the value of a register.
Definition: ltc4306.c:184
ltc4306_set_downstream_channel
int ltc4306_set_downstream_channel(struct ltc4306_dev *dev, uint8_t bus_num, bool connect)
Dis/connects to a downstream bus. Bus logic state must be 1 for connection to occur EXCEPT when conn_...
Definition: ltc4306.c:759
ltc4306_set_conn_req
int ltc4306_set_conn_req(struct ltc4306_dev *dev, bool connect_regardless)
Sets Connection Requirement bit field.
Definition: ltc4306.c:549
LTC4306_15MS
@ LTC4306_15MS
Definition: ltc4306.h:115
ltc4306_set_timeout_mode
int ltc4306_set_timeout_mode(struct ltc4306_dev *dev, enum ltc4306_timeout_mode tout)
Sets LTC4306's Timeout Mode.
Definition: ltc4306.c:685
LTC4306_DOWNSTREAM_CONNECT
#define LTC4306_DOWNSTREAM_CONNECT
Definition: ltc4306.h:67
ltc4306_init
int ltc4306_init(struct ltc4306_dev **device, struct ltc4306_init_param init_param)
Initializes the communication peripheral and checks if the ltc4306 part is present.
Definition: ltc4306.c:100
LTC4306_30MS
@ LTC4306_30MS
Definition: ltc4306.h:114
ltc4306_get_gpio_output_state
int ltc4306_get_gpio_output_state(struct ltc4306_dev *dev, int gpio, bool *is_high)
Gets GPIO Output Driver state.
Definition: ltc4306.c:495
no_os_i2c_desc
Structure holding I2C address descriptor.
Definition: no_os_i2c.h:107
LTC4306_CTRL_REG0
#define LTC4306_CTRL_REG0
Definition: ltc4306.h:55
no_os_i2c_read
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:196
no_os_i2c.h
Header file of I2C Interface.
ltc4306_get_timeout_mode
int ltc4306_get_timeout_mode(struct ltc4306_dev *dev, enum ltc4306_timeout_mode *tout)
Gets LTC4306's Timeout Mode.
Definition: ltc4306.c:702
no_os_field_get
uint32_t no_os_field_get(uint32_t mask, uint32_t word)
ltc4306_timeout_mode
ltc4306_timeout_mode
Definition: ltc4306.h:112
LTC4306_LATCHED_TOUT
#define LTC4306_LATCHED_TOUT
Definition: ltc4306.h:70
ltc4306_get_timeout_mode
int ltc4306_get_timeout_mode(struct ltc4306_dev *dev, enum ltc4306_timeout_mode *tout)
Gets LTC4306's Timeout Mode.
Definition: ltc4306.c:702
no_os_free
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:75
ltc4306_dev
Definition: ltc4306.h:119
ltc4306_addresses
const uint8_t ltc4306_addresses[]
Definition: ltc4306.c:56
ltc4306_dev::is_closed
bool is_closed[LTC4306_MAX_CHANNEL_INDEX]
Definition: ltc4306.h:126
no_os_i2c_init_param
Structure holding the parameters for I2C initialization.
Definition: no_os_i2c.h:70
LTC4306_CTRL_REG3
#define LTC4306_CTRL_REG3
Definition: ltc4306.h:58
ltc4306_addr_conn
ltc4306_addr_conn
Definition: ltc4306.h:106
LTC4306_UPSTREAM_EN
#define LTC4306_UPSTREAM_EN
Definition: ltc4306.h:74
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:119
LTC4306_OUT_DRV_STATE
#define LTC4306_OUT_DRV_STATE(x)
Definition: ltc4306.h:76
ltc4306_set_mass_write
int ltc4306_set_mass_write(struct ltc4306_dev *dev, bool mass_write_en)
Enables Mass Write.
Definition: ltc4306.c:646
ltc4306_remove
int ltc4306_remove(struct ltc4306_dev *dev)
Free the resources allocated by ltc4306_init().
Definition: ltc4306.c:131
ltc4306_gpio_configure
int ltc4306_gpio_configure(struct ltc4306_dev *dev, bool gpio1, bool gpio2, bool gpio1_is_pushpull, bool gpio2_is_pushpull)
Configures GPIO1 and GPIO2 as input or output mode. If selected as output mode, can be configured as ...
Definition: ltc4306.c:596
ltc4306_get_upstream_accel
int ltc4306_get_upstream_accel(struct ltc4306_dev *dev, bool *upstream_en)
Get status of upstream accelerator enable bit field.
Definition: ltc4306.c:407
LTC4306_LOGIC_STATE
#define LTC4306_LOGIC_STATE(x)
Definition: ltc4306.h:92
no_os_util.h
Header file of utility functions.
ltc4306_get_realtime_timeout
int ltc4306_get_realtime_timeout(struct ltc4306_dev *dev, bool *timed_out)
Reads Realtime Timeout status.
Definition: ltc4306.c:366
LTC4306_GPIO_LOGIC
#define LTC4306_GPIO_LOGIC(x)
Definition: ltc4306.h:77
ltc4306_gpio_configure
int ltc4306_gpio_configure(struct ltc4306_dev *dev, bool gpio1, bool gpio2, bool gpio1_is_pushpull, bool gpio2_is_pushpull)
Configures GPIO1 and GPIO2 as input or output mode. If selected as output mode, can be configured as ...
Definition: ltc4306.c:596
ltc4306_read_gpio_logic_state
int ltc4306_read_gpio_logic_state(struct ltc4306_dev *dev, int gpio, bool *is_high)
Reads logic of selected GPIO.
Definition: ltc4306.c:522
ltc4306_read_alert_logic_state
int ltc4306_read_alert_logic_state(struct ltc4306_dev *dev, uint8_t alert_pin_number, bool *is_high)
Reads Alert Logic State of selected ALERT pin.
Definition: ltc4306.c:295
ltc4306_get_downstream_accel
int ltc4306_get_downstream_accel(struct ltc4306_dev *dev, bool *downstream_en)
Get status of downstream accelerator enable bit field.
Definition: ltc4306.c:449
ltc4306_dev::upstream
bool upstream
Definition: ltc4306.h:128
LTC4306_FET_STATE
#define LTC4306_FET_STATE(x)
Definition: ltc4306.h:90
LTC4306_MAX_CHANNEL_INDEX
#define LTC4306_MAX_CHANNEL_INDEX
Definition: ltc4306.h:98
ltc4306_set_conn_req
int ltc4306_set_conn_req(struct ltc4306_dev *dev, bool connect_regardless)
Sets Connection Requirement bit field.
Definition: ltc4306.c:549