This module contains APIs to program and use I2C based TCA6416 IO Expander module on the board.
◆ TCA6416_MODE_INPUT
#define TCA6416_MODE_INPUT (0U) |
Configure IO pin as input.
◆ TCA6416_MODE_OUTPUT
#define TCA6416_MODE_OUTPUT (1U) |
Configure IO pin as output.
◆ TCA6416_OUT_STATE_LOW
#define TCA6416_OUT_STATE_LOW (0U) |
Configure IO pin output as LOW.
◆ TCA6416_OUT_STATE_HIGH
#define TCA6416_OUT_STATE_HIGH (1U) |
Configure IO pin output as HIGH.
◆ TCA6416_open()
Open TCA6416 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
◆ TCA6416_close()
Close TCA6416 driver.
- Parameters
-
◆ TCA6416_config()
int32_t TCA6416_config |
( |
TCA6416_Config * |
config, |
|
|
uint32_t |
ioIndex, |
|
|
uint32_t |
mode |
|
) |
| |
API to set a IO pin of TCA6416 as input or output.
- Parameters
-
config | [IN] TCA6416 driver config from TCA6416_open |
ioIndex | [IN] Index to the TCA6416 IO which needs to be set/reset. |
mode | [IN] Refer TCA6416_Mode |
- Returns
- SystemP_SUCCESS on success, else failure
◆ TCA6416_setOutput()
int32_t TCA6416_setOutput |
( |
TCA6416_Config * |
config, |
|
|
uint32_t |
ioIndex, |
|
|
uint32_t |
state |
|
) |
| |
API to set a IO pin of TCA6416 to either HIGH or LOW.
- Parameters
-
config | [IN] TCA6416 driver config from TCA6416_open |
ioIndex | [IN] Index to the TCA6416 IO which needs to be set/reset. |
state | [IN] Refer TCA6416_OutState |
- Returns
- SystemP_SUCCESS on success, else failure
◆ TCA6416_getAttrs()
Returns TCA6416 attributes.
- Parameters
-
config | [IN] TCA6416 driver config from TCA6416_open |
attrs | [IN/OUT] Structure where the attribute is returned |
◆ TCA6416_Params_init()
Set default parameters in the TCA6416_Params structure.
Call this API to set defaults and then override the fields as needed before calling TCA6416_open.
- Parameters
-
params | [OUT] Initialized parameters |