ATCA Hardware abstraction layer for SWI uart over Harmony PLIB. More...
Functions | |
ATCA_STATUS | hal_uart_init (ATCAIface iface, ATCAIfaceCfg *cfg) |
Initialize an uart interface using given config. | |
ATCA_STATUS | hal_uart_post_init (ATCAIface iface) |
HAL implementation of SWI post init. | |
ATCA_STATUS | hal_uart_send (ATCAIface iface, uint8_t word_address, uint8_t *txdata, int txlength) |
Send byte(s) via SWI. | |
ATCA_STATUS | hal_uart_receive (ATCAIface iface, uint8_t word_address, uint8_t *rxdata, uint16_t *rxlength) |
Receive byte(s) via SWI. | |
ATCA_STATUS | hal_uart_control (ATCAIface iface, uint8_t option, void *param, size_t paramlen) |
ATCA_STATUS | hal_uart_release (void *hal_data) |
Manages reference count on given bus and releases resource if no more reference(s) exist. | |
Variables | |
PLIB_SWI_SERIAL_SETUP | serial_setup |
ATCA Hardware abstraction layer for SWI uart over Harmony PLIB.
This code is structured in two parts. Part 1 is the connection of the ATCA HAL API to the physical I2C implementation. Part 2 is the Harmony UART (ring buffer mode) primitives to set up the interface.
ATCA_STATUS hal_uart_init | ( | ATCAIface | iface, |
ATCAIfaceCfg * | cfg | ||
) |
Initialize an uart interface using given config.
[in] | hal | opaque pointer to HAL data |
[in] | cfg | interface configuration |
ATCA_STATUS hal_uart_post_init | ( | ATCAIface | iface | ) |
HAL implementation of SWI post init.
[in] | iface | ATCAIface instance |
ATCA_STATUS hal_uart_receive | ( | ATCAIface | iface, |
uint8_t | word_address, | ||
uint8_t * | rxdata, | ||
uint16_t * | rxlength | ||
) |
Receive byte(s) via SWI.
[in] | iface | Device to interact with. |
[in] | word_address | device transaction type |
[out] | rxdata | Data received will be returned here. |
[in,out] | rxlength | As input, the size of the rxdata buffer. As output, the number of bytes received. |
ATCA_STATUS hal_uart_release | ( | void * | hal_data | ) |
Manages reference count on given bus and releases resource if no more reference(s) exist.
[in] | hal_data | opaque pointer to hal data structure - known only to the HAL implementation |
ATCA_STATUS hal_uart_send | ( | ATCAIface | iface, |
uint8_t | word_address, | ||
uint8_t * | txdata, | ||
int | txlength | ||
) |
Send byte(s) via SWI.
[in] | iface | interface of the logical device to send data to |
[in] | word_address | device transaction type |
[in] | txdata | pointer to bytes to send |
[in] | txlength | number of bytes to send |
PLIB_SWI_SERIAL_SETUP serial_setup |