CryptoAuthLib v3.7.6
Microchip CryptoAuthentication Library
 
Loading...
Searching...
No Matches
hal_windows_kit_uart.c File Reference

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
 

Detailed Description

ATCA Hardware abstraction layer for Windows using UART.

Function Documentation

◆ hal_uart_control()

ATCA_STATUS hal_uart_control ( ATCAIface  iface,
uint8_t  option,
void *  param,
size_t  paramlen 
)

Perform control operations for the UART.

Parameters
[in]ifaceInterface to interact with.
[in]optionControl parameter identifier
[in]paramOptional pointer to parameter value
[in]paramlenLength of the parameter
Returns
ATCA_SUCCESS on success, otherwise an error code.

◆ hal_uart_init()

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.

Parameters
[in]halpointer to HAL specific data that is maintained by this HAL
[in]cfgpointer to HAL specific configuration data that is used to initialize this HAL
Returns
ATCA_SUCCESS on success, otherwise an error code.

◆ hal_uart_post_init()

ATCA_STATUS hal_uart_post_init ( ATCAIface  iface)

HAL implementation of UART post init.

Parameters
[in]ifaceinstance
Returns
ATCA_SUCCESS on success, otherwise an error code.

◆ hal_uart_receive()

ATCA_STATUS hal_uart_receive ( ATCAIface  iface,
uint8_t  word_address,
uint8_t *  rxdata,
uint16_t *  rxlength 
)

HAL implementation of UART receive function.

Parameters
[in]ifaceDevice to interact with.
[in]word_addressdevice transaction type
[out]rxdataData received will be returned here.
[in,out]rxlengthAs input, the size of the rxdata buffer. As output, the number of bytes received.
Returns
ATCA_SUCCESS on success, otherwise an error code.

◆ hal_uart_release()

ATCA_STATUS hal_uart_release ( void *  hal_data)

manages reference count on given bus and releases resource if no more refences exist

Parameters
[in]hal_data- opaque pointer to hal data structure - known only to the HAL implementation
Returns
ATCA_SUCCESS on success, otherwise an error code.

◆ hal_uart_send()

ATCA_STATUS hal_uart_send ( ATCAIface  iface,
uint8_t  word_address,
uint8_t *  txdata,
int  txlength 
)

HAL implementation of UART send.

Parameters
[in]ifaceinstance
[in]word_addresstransaction type
[in]txdatadata to be send to device
[in]txdatapointer to space to bytes to send
[in]lennumber of bytes to send
Returns
ATCA_SUCCESS on success, otherwise an error code.