Firmware SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
bc_tca9534a

Driver for TCA9534A I/O expander. More...

Data Structures

struct  bc_tca9534a_t
 Pin state. More...
 

Enumerations

enum  bc_tca9534a_pin_t {
  BC_TCA9534A_PIN_P0 = 0,
  BC_TCA9534A_PIN_P1 = 1,
  BC_TCA9534A_PIN_P2 = 2,
  BC_TCA9534A_PIN_P3 = 3,
  BC_TCA9534A_PIN_P4 = 4,
  BC_TCA9534A_PIN_P5 = 5,
  BC_TCA9534A_PIN_P6 = 6,
  BC_TCA9534A_PIN_P7 = 7
}
 Individual pin names.
 
enum  bc_tca9534a_pin_direction_t {
  BC_TCA9534A_PIN_DIRECTION_OUTPUT = 0,
  BC_TCA9534A_PIN_DIRECTION_INPUT = 1
}
 Pin direction.
 

Functions

bool bc_tca9534a_init (bc_tca9534a_t *self, bc_i2c_channel_t i2c_channel, uint8_t i2c_address)
 Initialize TCA9534A. More...
 
bool bc_tca9534a_read_port (bc_tca9534a_t *self, uint8_t *state)
 Read state of all pins. More...
 
bool bc_tca9534a_write_port (bc_tca9534a_t *self, uint8_t state)
 Write state to all pins. More...
 
bool bc_tca9534a_read_pin (bc_tca9534a_t *self, bc_tca9534a_pin_t pin, int *state)
 Read pin state. More...
 
bool bc_tca9534a_write_pin (bc_tca9534a_t *self, bc_tca9534a_pin_t pin, int state)
 Write pin state. More...
 
bool bc_tca9534a_get_port_direction (bc_tca9534a_t *self, uint8_t *direction)
 Get direction of all pins. More...
 
bool bc_tca9534a_set_port_direction (bc_tca9534a_t *self, uint8_t direction)
 Set direction of all pins. More...
 
bool bc_tca9534a_get_pin_direction (bc_tca9534a_t *self, bc_tca9534a_pin_t pin, bc_tca9534a_pin_direction_t *direction)
 Get pin direction. More...
 
bool bc_tca9534a_set_pin_direction (bc_tca9534a_t *self, bc_tca9534a_pin_t pin, bc_tca9534a_pin_direction_t direction)
 Set pin direction. More...
 

Detailed Description

Driver for TCA9534A I/O expander.

Function Documentation

bool bc_tca9534a_get_pin_direction ( bc_tca9534a_t self,
bc_tca9534a_pin_t  pin,
bc_tca9534a_pin_direction_t direction 
)

Get pin direction.

Parameters
[in]selfInstance
[in]pinPin name
[out]directionPointer to variable where direction of pin will be stored
Returns
true On success
false On failure

Definition at line 99 of file bc_tca9534a.c.

bool bc_tca9534a_get_port_direction ( bc_tca9534a_t self,
uint8_t *  direction 
)

Get direction of all pins.

Parameters
[in]selfInstance
[out]directionPointer to variable where direction of all pins will be stored
Returns
true On success
false On failure

Definition at line 80 of file bc_tca9534a.c.

bool bc_tca9534a_init ( bc_tca9534a_t self,
bc_i2c_channel_t  i2c_channel,
uint8_t  i2c_address 
)

Initialize TCA9534A.

Parameters
[in]selfInstance
[in]i2c_channelI2C channel
[in]i2c_addressI2C device address

Definition at line 8 of file bc_tca9534a.c.

Referenced by bc_module_gps_init(), and bc_module_sensor_init().

Here is the call graph for this function:

Here is the caller graph for this function:

bool bc_tca9534a_read_pin ( bc_tca9534a_t self,
bc_tca9534a_pin_t  pin,
int *  state 
)

Read pin state.

Parameters
[in]selfInstance
[in]pinPin name
[out]statePointer to variable where state of pin will be stored
Returns
true On success
false On failure

Definition at line 47 of file bc_tca9534a.c.

Referenced by bc_module_sensor_get_pull(), and bc_module_sensor_get_revision().

Here is the call graph for this function:

Here is the caller graph for this function:

bool bc_tca9534a_read_port ( bc_tca9534a_t self,
uint8_t *  state 
)

Read state of all pins.

Parameters
[in]selfInstance
[out]statePointer to variable where state of all pins will be stored
Returns
true On success
false On failure

Definition at line 30 of file bc_tca9534a.c.

Referenced by bc_tca9534a_read_pin().

Here is the call graph for this function:

Here is the caller graph for this function:

bool bc_tca9534a_set_pin_direction ( bc_tca9534a_t self,
bc_tca9534a_pin_t  pin,
bc_tca9534a_pin_direction_t  direction 
)

Set pin direction.

Parameters
[in]selfInstance
[in]pinPin name
[in]directionDesired pin direction
Returns
true On success
false On failure

Definition at line 113 of file bc_tca9534a.c.

Referenced by bc_module_sensor_get_revision().

Here is the call graph for this function:

Here is the caller graph for this function:

bool bc_tca9534a_set_port_direction ( bc_tca9534a_t self,
uint8_t  direction 
)

Set direction of all pins.

Parameters
[in]selfInstance
[in]directionDesired direction of all pins
Returns
true On success
false On failure

Definition at line 87 of file bc_tca9534a.c.

Referenced by bc_module_gps_init(), bc_module_sensor_init(), and bc_tca9534a_set_pin_direction().

Here is the call graph for this function:

Here is the caller graph for this function:

bool bc_tca9534a_write_pin ( bc_tca9534a_t self,
bc_tca9534a_pin_t  pin,
int  state 
)

Write pin state.

Parameters
[in]selfInstance
[in]pinPin name
[in]stateDesired state of pin
Returns
true On success
false On failure

Definition at line 61 of file bc_tca9534a.c.

Referenced by bc_module_lcd_off(), bc_module_lcd_on(), and bc_module_sensor_get_revision().

Here is the call graph for this function:

Here is the caller graph for this function:

bool bc_tca9534a_write_port ( bc_tca9534a_t self,
uint8_t  state 
)

Write state to all pins.

Parameters
[in]selfInstance
[in]stateDesired state of all pins
Returns
true On success
false On failure

Definition at line 35 of file bc_tca9534a.c.

Referenced by bc_module_gps_init(), bc_module_sensor_init(), bc_module_sensor_set_pull(), bc_module_sensor_set_vdd(), and bc_tca9534a_write_pin().

Here is the call graph for this function:

Here is the caller graph for this function: