This module contains APIs to program and use I2C based TCA6424 IO Expander module on the board.
◆ TCA6424_MODE_INPUT
#define TCA6424_MODE_INPUT (0U) |
Configure IO pin as input.
◆ TCA6424_MODE_OUTPUT
#define TCA6424_MODE_OUTPUT (1U) |
Configure IO pin as output.
◆ TCA6424_OUT_STATE_LOW
#define TCA6424_OUT_STATE_LOW (0U) |
Configure IO pin output as LOW.
◆ TCA6424_OUT_STATE_HIGH
#define TCA6424_OUT_STATE_HIGH (1U) |
Configure IO pin output as HIGH.
◆ TCA6424_open()
Open TCA6424 driver.
Make sure the I2C driver is opened before calling this API.
- Parameters
-
config | [IN] Driver object. Caller need to allocate memory for this. |
params | [IN] Open parameters |
- Returns
- SystemP_SUCCESS on success, else failure
◆ TCA6424_close()
Close TCA6424 driver.
- Parameters
-
◆ TCA6424_config()
int32_t TCA6424_config |
( |
TCA6424_Config * |
config, |
|
|
uint32_t |
ioIndex, |
|
|
uint32_t |
mode |
|
) |
| |
API to set a IO pin of TCA6424 as input or output.
- Parameters
-
config | [IN] TCA6424 driver config from TCA6424_open |
ioIndex | [IN] Index to the TCA6424 IO which needs to be set/reset. |
mode | [IN] Refer TCA6424_Mode |
- Returns
- SystemP_SUCCESS on success, else failure
◆ TCA6424_setOutput()
int32_t TCA6424_setOutput |
( |
TCA6424_Config * |
config, |
|
|
uint32_t |
ioIndex, |
|
|
uint32_t |
state |
|
) |
| |
API to set a IO pin of TCA6424 to either HIGH or LOW.
- Parameters
-
config | [IN] TCA6424 driver config from TCA6424_open |
ioIndex | [IN] Index to the TCA6424 IO which needs to be set/reset. |
state | [IN] Refer TCA6424_OutState |
- Returns
- SystemP_SUCCESS on success, else failure
◆ TCA6424_getAttrs()
Returns TCA6424 attributes.
- Parameters
-
config | [IN] TCA6424 driver config from TCA6424_open |
attrs | [IN/OUT] Structure where the attribute is returned |
◆ TCA6424_Params_init()
Set default parameters in the TCA6424_Params structure.
Call this API to set defaults and then override the fields as needed before calling TCA6424_open.
- Parameters
-
params | [OUT] Initialized parameters |