CryptoAuthLib
Microchip CryptoAuthentication Library
swi_uart_at90usb1287_asf.h
Go to the documentation of this file.
1 
30 #ifndef SWI_UART_AT90USB1287_ASF_H
31 #define SWI_UART_AT90USB1287_ASF_H
32 
33 #include <asf.h>
34 #include "cryptoauthlib.h"
35 #include "serial.h"
36 
50 #define MAX_SWI_BUSES 1 // AT90USB1287 has only 1 port
51 
52 #define RECEIVE_MODE 0 // UART Receive mode, RX enabled
53 #define TRANSMIT_MODE 1 // UART Transmit mode, RX disabled
54 #define RX_DELAY 10 // Delay before responses come
55 #define TX_DELAY 90 // Delay before new flag is sent
56 
59 typedef struct atcaSWImaster
60 {
61  // struct usart_module for Atmel SWI interface
62  usart_if usart_instance;
63  int ref_ct;
64  // for conveniences during interface release phase
65  int bus_index;
67 
68 
71 void swi_uart_setbaud(ATCASWIMaster_t *instance, uint32_t baudrate);
72 void swi_uart_mode(ATCASWIMaster_t *instance, uint8_t mode);
73 void swi_uart_discover_buses(int swi_uart_buses[], int max_buses);
74 
75 ATCA_STATUS swi_uart_send_byte(ATCASWIMaster_t *instance, uint8_t data);
76 ATCA_STATUS swi_uart_receive_byte(ATCASWIMaster_t *instance, uint8_t *data);
77 
80 #endif // SWI_UART_AT90USB1287_ASF_H
ATCA_STATUS swi_uart_send_byte(ATCASWIMaster_t *instance, uint8_t data)
HAL implementation of SWI UART send byte over ASF. This function send one byte over UART...
Definition: swi_uart_at90usb1287_asf.c:160
int ref_ct
Definition: hal_swi_bitbang.h:66
usart_if usart_instance
Definition: swi_uart_at90usb1287_asf.h:62
void swi_uart_discover_buses(int swi_uart_buses[], int max_buses)
discover UART buses available for this hardware this maintains a list of logical to physical bus mapp...
Definition: swi_uart_at90usb1287_asf.c:146
ATCA_STATUS
Definition: atca_status.h:41
ATCA_STATUS swi_uart_receive_byte(ATCASWIMaster_t *instance, uint8_t *data)
HAL implementation of SWI UART receive bytes over ASF. This function receive one byte over UART...
Definition: swi_uart_at90usb1287_asf.c:209
void swi_uart_setbaud(ATCASWIMaster_t *instance, uint32_t baudrate)
implementation of SWI UART change baudrate.
Definition: swi_uart_at90usb1287_asf.c:110
Single aggregation point for all CryptoAuthLib header files.
This is the hal_data for ATCA HAL.
Definition: hal_swi_bitbang.h:63
void swi_uart_mode(ATCASWIMaster_t *instance, uint8_t mode)
implementation of SWI UART change mode.
Definition: swi_uart_at90usb1287_asf.c:122
ATCA_STATUS swi_uart_init(ATCASWIMaster_t *instance)
Implementation of SWI UART init.
Definition: swi_uart_at90usb1287_asf.c:64
struct atcaSWImaster ATCASWIMaster_t
this is the hal_data for ATCA HAL for SWI UART
int bus_index
for conveniences during interface release phase
Definition: hal_swi_bitbang.h:68
ATCA_STATUS swi_uart_deinit(ATCASWIMaster_t *instance)
Implementation of SWI UART deinit.
Definition: swi_uart_at90usb1287_asf.c:98