ATCA Hardware abstraction layer for Windows using UART. More...
#include "cryptoauthlib.h"
#include "atca_hal.h"
#include <windows.h>
#include <stdio.h>
#include <conio.h>
#include <math.h>
#include <string.h>
Data Structures | |
struct | atca_uart_host_s |
Typedefs | |
typedef struct atca_uart_host_s | atca_uart_host_t |
Functions | |
ATCA_STATUS | hal_uart_init (ATCAIface iface, ATCAIfaceCfg *cfg) |
HAL implementation of UART init. | |
ATCA_STATUS | hal_uart_post_init (ATCAIface iface) |
HAL implementation of UART post init. | |
ATCA_STATUS | hal_uart_send (ATCAIface iface, uint8_t word_address, uint8_t *txdata, int txlength) |
HAL implementation of UART send. | |
ATCA_STATUS | hal_uart_receive (ATCAIface iface, uint8_t word_address, uint8_t *rxdata, uint16_t *rxlength) |
HAL implementation of UART receive function. | |
ATCA_STATUS | hal_uart_control (ATCAIface iface, uint8_t option, void *param, size_t paramlen) |
Perform control operations for the UART. | |
ATCA_STATUS | hal_uart_release (void *hal_data) |
manages reference count on given bus and releases resource if no more refences exist | |
ATCA Hardware abstraction layer for Windows using UART.
ATCA_STATUS hal_uart_control | ( | ATCAIface | iface, |
uint8_t | option, | ||
void * | param, | ||
size_t | paramlen | ||
) |
Perform control operations for the UART.
[in] | iface | Interface to interact with. |
[in] | option | Control parameter identifier |
[in] | param | Optional pointer to parameter value |
[in] | paramlen | Length of the parameter |
ATCA_STATUS hal_uart_init | ( | ATCAIface | iface, |
ATCAIfaceCfg * | cfg | ||
) |
HAL implementation of UART init.
this implementation assumes UART SERIAL PORT peripheral has been enabled by user . It only initialize an UART interface using given config.
[in] | hal | pointer to HAL specific data that is maintained by this HAL |
[in] | cfg | pointer to HAL specific configuration data that is used to initialize this HAL |
ATCA_STATUS hal_uart_post_init | ( | ATCAIface | iface | ) |
HAL implementation of UART post init.
[in] | iface | instance |
ATCA_STATUS hal_uart_receive | ( | ATCAIface | iface, |
uint8_t | word_address, | ||
uint8_t * | rxdata, | ||
uint16_t * | rxlength | ||
) |
HAL implementation of UART receive function.
[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 refences 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 | ||
) |
HAL implementation of UART send.
[in] | iface | instance |
[in] | word_address | transaction type |
[in] | txdata | data to be send to device |
[in] | txdata | pointer to space to bytes to send |
[in] | len | number of bytes to send |