no-OS
ltc4306.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef __LTC4306_H__
34 #define __LTC4306_H__
35 
36 /******************************************************************************/
37 /***************************** Include Files **********************************/
38 /******************************************************************************/
39 #include <stdint.h>
40 #include <stdlib.h>
41 #include "no_os_i2c.h"
42 #include "no_os_util.h"
43 
44 /******************************************************************************/
45 /************************** LTC4306 Definitions *******************************/
46 /******************************************************************************/
47 
48 /* Register address definitions */
49 #define LTC4306_CTRL_REG0 0x00
50 #define LTC4306_CTRL_REG1 0x01
51 #define LTC4306_CTRL_REG2 0x02
52 #define LTC4306_CTRL_REG3 0x03
53 #define LTC4306_OUT_OF_BOUNDS 0x04
54 
55 /* Special Addresses */
56 #define LTC4306_MASS_WRITE_ADDR 0xBA
57 #define LTC4306_ALERT_RESPONSE_ADDR 0x19
58 
59 /* Masks (Bits and Fields) */
60 /* REG0 */
61 #define LTC4306_DOWNSTREAM_CONNECT NO_OS_BIT(7)
62 #define LTC4306_ALERT_LOGIC(x) NO_OS_BIT(7 - (x))
63 #define LTC4306_FAILED_CONN NO_OS_BIT(2)
64 #define LTC4306_LATCHED_TOUT NO_OS_BIT(1)
65 #define LTC4306_REALTIME_TOUT NO_OS_BIT(0)
66 
67 /* REG1 */
68 #define LTC4306_UPSTREAM_EN NO_OS_BIT(7)
69 #define LTC4306_DOWNSTREAM_EN NO_OS_BIT(6)
70 #define LTC4306_OUT_DRV_STATE(x) NO_OS_BIT(6 - (x))
71 #define LTC4306_GPIO_LOGIC(x) NO_OS_BIT(2 - (x))
72 
73 /* REG2 */
74 #define LTC4306_GPIO_MODE_MASK NO_OS_GENMASK(7, 6)
75 #define LTC4306_GPIO_MODE_CONFIG(x) NO_OS_BIT(8 - (x))
76 #define LTC4306_CONN_REQ NO_OS_BIT(5)
77 #define LTC4306_OUT_MODE_MASK NO_OS_GENMASK(4, 3)
78 #define LTC4306_OUT_MODE_CONFIG(x) NO_OS_BIT(5 - (x))
79 #define LTC4306_MASS_WRITE NO_OS_BIT(2)
80 #define LTC4306_TOUT NO_OS_GENMASK(1, 0)
81 
82 /* REG3 */
83 #define LTC4306_FET_STATE_MASK NO_OS_GENMASK(7, 4)
84 #define LTC4306_FET_STATE(x) NO_OS_BIT(8 - (x))
85 #define LTC4306_BUS_LOGIC_STATE_MASK NO_OS_GENMASK(3, 0)
86 #define LTC4306_LOGIC_STATE(x) NO_OS_BIT(4 - (x))
87 
88 /* Other definitions */
89 #define LTC4306_MIN_CHANNEL_INDEX 1
90 #define LTC4306_CHANNEL_TWO 2
91 #define LTC4306_CHANNEL_THREE 3
92 #define LTC4306_MAX_CHANNEL_INDEX 4
93 #define LTC4306_GPIO_MIN 1
94 #define LTC4306_GPIO_MAX 2
95 
96 /******************************************************************************/
97 /*************************** Types Declarations *******************************/
98 /******************************************************************************/
99 
104 };
105 
111 };
112 
113 struct ltc4306_dev {
115  /* GPIO status indicators (input or ouptut) */
117  /* GPIO out mode indicators (push pull or open drain */
119  /* FET status indicators (connected or not) */
121  /* Upstream accelerator indicator */
122  bool upstream;
123  /* Downstream accelerator indicator */
125 };
126 
128  /* I2C */
130 };
131 
132 /******************************************************************************/
133 /************************ Functions Declarations ******************************/
134 /******************************************************************************/
135 /* Generate slave address depending on A0 and A1 logic levels */
137  enum ltc4306_addr_conn addr0, enum ltc4306_addr_conn addr1,
138  enum ltc4306_addr_conn addr2);
139 
140 /* Initialize device */
141 int ltc4306_init(struct ltc4306_dev **device,
143 
144 /* Write byte/s to selected starting register */
145 int ltc4306_write(struct ltc4306_dev *dev, uint8_t addr, uint8_t *write_data,
146  uint8_t bytes);
147 
148 /* Read byte/s from selected starting register */
149 int ltc4306_read(struct ltc4306_dev *dev, uint8_t addr, uint8_t *read_data,
150  uint8_t bytes);
151 
152 /* Update selected register using mask and desired value */
153 int ltc4306_reg_update(struct ltc4306_dev *dev, uint8_t addr, int update_mask,
154  int update_val);
155 
156 /* Deallocate resources for device */
157 int ltc4306_remove(struct ltc4306_dev *dev);
158 
159 /* Checks if any downstream bus is connected to upstream bus */
160 int ltc4306_downstream_check(struct ltc4306_dev *dev, bool *downstream_conn);
161 
162 /* Reads the status of selected ALERT pin */
164  uint8_t alert_pin_number, bool *is_high);
165 
166 /* Checks if any downstream connection attempt failed */
167 int ltc4306_read_failed_conn(struct ltc4306_dev *dev, bool *is_high);
168 
169 /* Checks if any latched timeout occurs */
170 int ltc4306_get_latched_timeout(struct ltc4306_dev *dev, bool *timed_out);
171 
172 /* Check status of stuck low timeout circuitry */
173 int ltc4306_get_realtime_timeout(struct ltc4306_dev *dev, bool *timed_out);
174 
175 /* Sets status of upstream accelerator */
176 int ltc4306_set_upstream_accel(struct ltc4306_dev *dev, bool upstream_en);
177 
178 /* Gets status of upstream accelerator */
179 int ltc4306_get_upstream_accel(struct ltc4306_dev *dev, bool *upstream_en);
180 
181 /* Sets status of downstream accelerator */
182 int ltc4306_set_downstream_accel(struct ltc4306_dev *dev, bool downstream_en);
183 
184 /* Gets status of downstream accelerator */
185 int ltc4306_get_downstream_accel(struct ltc4306_dev *dev, bool *downstream_en);
186 
187 /* Sets GPIO Output Driver state */
188 int ltc4306_set_gpio_output_state(struct ltc4306_dev *dev, int gpio,
189  bool is_high);
190 
191 /* Gets GPIO Output Driver state */
192 int ltc4306_get_gpio_output_state(struct ltc4306_dev *dev, int gpio,
193  bool *is_high);
194 
195 /* Reads logic level of selected GPIO */
196 int ltc4306_read_gpio_logic_state(struct ltc4306_dev *dev, int gpio,
197  bool *is_high);
198 
199 /* Sets the LTC4306's connection requirement bit field for downstream connect */
200 int ltc4306_set_conn_req(struct ltc4306_dev *dev, bool connect_regardless);
201 
202 /* Gets the LTC4306's connection requirement bit field for downstream connect */
203 int ltc4306_get_conn_req(struct ltc4306_dev *dev, bool *connect_regardless);
204 
205 /* Configure LTC4306's GPIO mode and output config (for output) */
206 int ltc4306_gpio_configure(struct ltc4306_dev *dev, bool gpio1,
207  bool gpio2, bool gpio1_is_pushpull, bool gpio2_is_pushpull);
208 
209 /* Sets the mass write bit field */
210 int ltc4306_set_mass_write(struct ltc4306_dev *dev, bool mass_write_en);
211 
212 /* Gets the mass write bit field */
213 int ltc4306_get_mass_write(struct ltc4306_dev *dev, bool *mass_write_en);
214 
215 /* Sets the LTC4306's stuck low timeout mode */
216 int ltc4306_set_timeout_mode(struct ltc4306_dev *dev,
217  enum ltc4306_timeout_mode tout);
218 
219 /* Gets the LTC4306's stuck low timeout mode */
220 int ltc4306_get_timeout_mode(struct ltc4306_dev *dev,
221  enum ltc4306_timeout_mode *tout);
222 
223 /* Reads LTC4306's selected Bus Logic */
224 int ltc4306_read_bus_logic_state(struct ltc4306_dev *dev, uint8_t bus_number,
225  bool *is_high);
226 
227 /* Sets the connection for selected LTC4306 downstream channel */
229  uint8_t bus_num, bool connect);
230 
231 /* Gets the connection for selected LTC4306 downstream channel */
233  uint8_t bus_num, bool *connect);
234 
235 #endif /* __LTC4306_H__ */
LTC4306_OUT_OF_BOUNDS
#define LTC4306_OUT_OF_BOUNDS
Definition: ltc4306.h:53
no_os_alloc.h
LTC4306_CONN_REQ
#define LTC4306_CONN_REQ
Definition: ltc4306.h:76
ltc4306_dev::downstream
bool downstream
Definition: ltc4306.h:124
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:159
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:52
ltc4306_dev::i2c_desc
struct no_os_i2c_desc * i2c_desc
Definition: ltc4306.h:114
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:753
ltc4306_set_upstream_accel
int ltc4306_set_upstream_accel(struct ltc4306_dev *dev, bool upstream_en)
En/Disables upstream accelerator.
Definition: ltc4306.c:382
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:720
LTC4306_FAILED_CONN
#define LTC4306_FAILED_CONN
Definition: ltc4306.h:63
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:146
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:720
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:113
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:146
ltc4306_read_failed_conn
int ltc4306_read_failed_conn(struct ltc4306_dev *dev, bool *is_high)
Reads Failed Connection Attempt bit.
Definition: ltc4306.c:316
ltc4306_get_latched_timeout
int ltc4306_get_latched_timeout(struct ltc4306_dev *dev, bool *timed_out)
Reads Latched Timeout status.
Definition: ltc4306.c:338
LTC4306_DISABLED
@ LTC4306_DISABLED
Definition: ltc4306.h:107
LTC4306_MIN_CHANNEL_INDEX
#define LTC4306_MIN_CHANNEL_INDEX
Definition: ltc4306.h:89
ltc4306_get_conn_req
int ltc4306_get_conn_req(struct ltc4306_dev *dev, bool *connect_regardless)
Gets Connection Requirement bit field.
Definition: ltc4306.c:560
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:657
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:489
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:401
ltc4306_get_realtime_timeout
int ltc4306_get_realtime_timeout(struct ltc4306_dev *dev, bool *timed_out)
Reads Realtime Timeout status.
Definition: ltc4306.c:360
device
Definition: ad9361_util.h:69
LTC4306_GPIO_MODE_CONFIG
#define LTC4306_GPIO_MODE_CONFIG(x)
Definition: ltc4306.h:75
ltc4306_get_conn_req
int ltc4306_get_conn_req(struct ltc4306_dev *dev, bool *connect_regardless)
Gets Connection Requirement bit field.
Definition: ltc4306.c:560
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:795
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:235
LTC4306_NO_CONN
@ LTC4306_NO_CONN
Definition: ltc4306.h:103
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:54
LTC4306_7P5MS
@ LTC4306_7P5MS
Definition: ltc4306.h:110
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:795
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:266
ltc4306_set_downstream_accel
int ltc4306_set_downstream_accel(struct ltc4306_dev *dev, bool downstream_en)
En/Disables downstream accelerator.
Definition: ltc4306.c:424
bool
bool
Definition: common.h:48
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:516
ltc4306_init_param
Definition: ltc4306.h:127
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:657
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:289
ltc4306_remove
int ltc4306_remove(struct ltc4306_dev *dev)
Free the resources allocated by ltc4306_init().
Definition: ltc4306.c:125
LTC4306_HIGH
@ LTC4306_HIGH
Definition: ltc4306.h:102
LTC4306_TOUT
#define LTC4306_TOUT
Definition: ltc4306.h:80
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:235
LTC4306_LOW
@ LTC4306_LOW
Definition: ltc4306.h:101
LTC4306_GPIO_MAX
#define LTC4306_GPIO_MAX
Definition: ltc4306.h:94
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:466
ltc4306_get_latched_timeout
int ltc4306_get_latched_timeout(struct ltc4306_dev *dev, bool *timed_out)
Reads Latched Timeout status.
Definition: ltc4306.c:338
LTC4306_CTRL_REG2
#define LTC4306_CTRL_REG2
Definition: ltc4306.h:51
ltc4306_set_upstream_accel
int ltc4306_set_upstream_accel(struct ltc4306_dev *dev, bool upstream_en)
En/Disables upstream accelerator.
Definition: ltc4306.c:382
ltc4306_dev::is_push_pull
bool is_push_pull[LTC4306_GPIO_MAX]
Definition: ltc4306.h:118
LTC4306_REALTIME_TOUT
#define LTC4306_REALTIME_TOUT
Definition: ltc4306.h:65
ltc4306_init_param::i2c_init
struct no_os_i2c_init_param i2c_init
Definition: ltc4306.h:129
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:178
LTC4306_MASS_WRITE
#define LTC4306_MASS_WRITE
Definition: ltc4306.h:79
ltc4306_set_downstream_accel
int ltc4306_set_downstream_accel(struct ltc4306_dev *dev, bool downstream_en)
En/Disables downstream accelerator.
Definition: ltc4306.c:424
LTC4306_DOWNSTREAM_EN
#define LTC4306_DOWNSTREAM_EN
Definition: ltc4306.h:69
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:679
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:208
ltc4306_set_mass_write
int ltc4306_set_mass_write(struct ltc4306_dev *dev, bool mass_write_en)
Enables Mass Write.
Definition: ltc4306.c:640
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:94
LTC4306_OUT_MODE_CONFIG
#define LTC4306_OUT_MODE_CONFIG(x)
Definition: ltc4306.h:78
ltc4306_read_failed_conn
int ltc4306_read_failed_conn(struct ltc4306_dev *dev, bool *is_high)
Reads Failed Connection Attempt bit.
Definition: ltc4306.c:316
LTC4306_ALERT_LOGIC
#define LTC4306_ALERT_LOGIC(x)
Definition: ltc4306.h:62
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:208
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:266
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:466
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:443
ltc4306_dev::is_input
bool is_input[LTC4306_GPIO_MAX]
Definition: ltc4306.h:116
LTC4306_CTRL_REG1
#define LTC4306_CTRL_REG1
Definition: ltc4306.h:50
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:178
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:753
ltc4306_set_conn_req
int ltc4306_set_conn_req(struct ltc4306_dev *dev, bool connect_regardless)
Sets Connection Requirement bit field.
Definition: ltc4306.c:543
LTC4306_15MS
@ LTC4306_15MS
Definition: ltc4306.h:109
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:679
LTC4306_DOWNSTREAM_CONNECT
#define LTC4306_DOWNSTREAM_CONNECT
Definition: ltc4306.h:61
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:94
LTC4306_30MS
@ LTC4306_30MS
Definition: ltc4306.h:108
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:489
no_os_i2c_desc
Structure holding I2C address descriptor.
Definition: no_os_i2c.h:101
LTC4306_CTRL_REG0
#define LTC4306_CTRL_REG0
Definition: ltc4306.h:49
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:190
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:696
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:106
LTC4306_LATCHED_TOUT
#define LTC4306_LATCHED_TOUT
Definition: ltc4306.h:64
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:696
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:69
ltc4306_dev
Definition: ltc4306.h:113
ltc4306_addresses
const uint8_t ltc4306_addresses[]
Definition: ltc4306.c:50
ltc4306_dev::is_closed
bool is_closed[LTC4306_MAX_CHANNEL_INDEX]
Definition: ltc4306.h:120
no_os_i2c_init_param
Structure holding the parameters for I2C initialization.
Definition: no_os_i2c.h:64
LTC4306_CTRL_REG3
#define LTC4306_CTRL_REG3
Definition: ltc4306.h:52
ltc4306_addr_conn
ltc4306_addr_conn
Definition: ltc4306.h:100
LTC4306_UPSTREAM_EN
#define LTC4306_UPSTREAM_EN
Definition: ltc4306.h:68
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
LTC4306_OUT_DRV_STATE
#define LTC4306_OUT_DRV_STATE(x)
Definition: ltc4306.h:70
ltc4306_set_mass_write
int ltc4306_set_mass_write(struct ltc4306_dev *dev, bool mass_write_en)
Enables Mass Write.
Definition: ltc4306.c:640
ltc4306_remove
int ltc4306_remove(struct ltc4306_dev *dev)
Free the resources allocated by ltc4306_init().
Definition: ltc4306.c:125
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:590
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:401
LTC4306_LOGIC_STATE
#define LTC4306_LOGIC_STATE(x)
Definition: ltc4306.h:86
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:360
LTC4306_GPIO_LOGIC
#define LTC4306_GPIO_LOGIC(x)
Definition: ltc4306.h:71
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:590
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:516
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:289
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:443
ltc4306_dev::upstream
bool upstream
Definition: ltc4306.h:122
LTC4306_FET_STATE
#define LTC4306_FET_STATE(x)
Definition: ltc4306.h:84
LTC4306_MAX_CHANNEL_INDEX
#define LTC4306_MAX_CHANNEL_INDEX
Definition: ltc4306.h:92
ltc4306_set_conn_req
int ltc4306_set_conn_req(struct ltc4306_dev *dev, bool connect_regardless)
Sets Connection Requirement bit field.
Definition: ltc4306.c:543