CryptoAuthLib
Microchip CryptoAuthentication Library
|
These methods define the hardware abstraction layer for communicating with a CryptoAuth device. More...
Data Structures | |
struct | ATCAHAL_t |
an intermediary data structure to allow the HAL layer to point the standard API functions used by the upper layers to the HAL implementation for the interface. This isolates the upper layers and loosely couples the ATCAIface object from the physical implementation. More... | |
struct | atcahid |
struct | atcaI2Cmaster |
this is the hal_data for ATCA HAL created using ASF More... | |
struct | cdc_device |
struct | atcacdc |
struct | hid_device |
struct | DRV_I2C_Object |
struct | atcaSWImaster |
This is the hal_data for ATCA HAL. More... | |
Macros | |
#define | HID_DEVICES_MAX 10 |
#define | HID_PACKET_MAX 512 |
#define | MAX_I2C_BUSES 1 |
#define | MAX_I2C_BUSES 6 |
#define | MAX_I2C_BUSES 2 |
#define | max(a, b) (((a) > (b)) ? (a) : (b)) |
#define | min(a, b) (((a) < (b)) ? (a) : (b)) |
#define | CDC_DEVICES_MAX 10 |
#define | CDC_BUFFER_MAX 1024 |
#define | INVALID_HANDLE_VALUE ((int)(-1)) |
#define | HID_DEVICES_MAX 10 |
#define | HID_PACKET_MAX 512 |
#define | GetSystemClock() (80000000ul) |
#define | GetPeripheralClock() (GetSystemClock() / (1 << OSCCONbits.PBDIV)) |
#define | GetInstructionClock() (GetSystemClock()) |
#define | MAX_I2C_BUSES 4 |
#define | CPU_CLOCK (80000000UL) |
#define | us_SCALE ((CPU_CLOCK / 2) / 1000000) |
#define | HARMONY_I2C_DRIVER 1 |
#define | MAX_I2C_BUSES 3 |
#define | GetSystemClock() (200000000UL)/* Fcy = 200MHz */ |
#define | us_SCALE (GetSystemClock() / 2000000) |
#define | MAX_I2C_BUSES 2 |
#define | MAX_I2C_BUSES 2 |
#define | MAX_I2C_BUSES 6 |
#define | MAX_I2C_BUSES 2 |
#define | MAX_I2C_BUSES 3 |
#define | SWI_WAKE_TOKEN ((uint8_t)0x00) |
flag preceding a command More... | |
#define | SWI_FLAG_CMD ((uint8_t)0x77) |
flag preceding a command More... | |
#define | SWI_FLAG_TX ((uint8_t)0x88) |
flag requesting a response More... | |
#define | SWI_FLAG_IDLE ((uint8_t)0xBB) |
flag requesting to go into Idle mode More... | |
#define | SWI_FLAG_SLEEP ((uint8_t)0xCC) |
flag requesting to go into Sleep mode More... | |
#define | HID_GUID { 0x4d1e55b2, 0xf16f, 0x11cf, 0x88, 0xcb, 0x00, 0x11, 0x11, 0x00, 0x00, 0x30 } |
#define | HID_DEVICES_MAX 10 |
#define | HID_PACKET_MAX 512 |
#define | MAX_I2C_BUSES 4 |
#define | KIT_MAX_SCAN_COUNT 4 |
#define | KIT_MAX_TX_BUF 32 |
#define | KIT_TX_WRAP_SIZE (7) |
#define | KIT_MSG_SIZE (32) |
#define | KIT_RX_WRAP_SIZE (KIT_MSG_SIZE + 6) |
#define | MAX_SWI_BUSES 1 |
#define | RECEIVE_MODE 0 |
#define | TRANSMIT_MODE 1 |
#define | RX_DELAY 10 |
#define | TX_DELAY 90 |
#define | MAX_SWI_BUSES 6 |
#define | RECEIVE_MODE 0 |
#define | TRANSMIT_MODE 1 |
#define | RX_DELAY 10 |
#define | TX_DELAY 90 |
#define | DEBUG_PIN_1 EXT2_PIN_5 |
#define | DEBUG_PIN_2 EXT2_PIN_6 |
#define | MAX_SWI_BUSES 6 |
#define | RECEIVE_MODE 0 |
#define | TRANSMIT_MODE 1 |
#define | RX_DELAY 10 |
#define | TX_DELAY 93 |
#define | MAX_SWI_BUSES 6 |
#define | RECEIVE_MODE 0 |
#define | TRANSMIT_MODE 1 |
#define | RX_DELAY 10 |
#define | TX_DELAY 90 |
Typedefs | |
typedef struct atcahid | atcahid_t |
typedef struct atcaI2Cmaster | ATCAI2CMaster_t |
this is the hal_data for ATCA HAL created using ASF More... | |
typedef struct atcaI2Cmaster | ATCAI2CMaster_t |
This is the hal_data for ATCA HAL. More... | |
typedef struct atcaI2Cmaster | ATCAI2CMaster_t |
this is the hal_data for ATCA HAL for Atmel START SERCOM More... | |
typedef struct atcaI2Cmaster | ATCAI2CMaster_t |
typedef int | HANDLE |
typedef struct cdc_device | cdc_device_t |
typedef struct atcacdc | atcacdc_t |
typedef struct hid_device | hid_device_t |
typedef struct atcahid | atcahid_t |
typedef struct atcaI2Cmaster | ATCAI2CMaster_t |
this is the hal_data for ATCA HAL More... | |
typedef struct atcaI2Cmaster | ATCAI2CMaster_t |
this is the hal_data for ATCA HAL More... | |
typedef struct atcaI2Cmaster | ATCAI2CMaster_t |
this is the hal_data for ATCA HAL More... | |
typedef struct atcaI2Cmaster | ATCAI2CMaster_t |
this is the hal_data for ATCA HAL for ASF More... | |
typedef struct atcaI2Cmaster | ATCAI2CMaster_t |
this is the hal_data for ATCA HAL for ASF SERCOM More... | |
typedef struct atcaI2Cmaster | ATCAI2CMaster_t |
this is the hal_data for ATCA HAL More... | |
typedef struct atcaI2Cmaster | ATCAI2CMaster_t |
this is the hal_data for ATCA HAL for ASF SERCOM More... | |
typedef struct atcaSWImaster | ATCASWIMaster_t |
This is the hal_data for ATCA HAL. More... | |
typedef struct hid_device | hid_device_t |
typedef struct atcahid | atcahid_t |
typedef struct atcaI2Cmaster | ATCAI2CMaster_t |
this is the hal_data for ATCA HAL created using ASF More... | |
typedef struct atcaSWImaster | ATCASWIMaster_t |
this is the hal_data for ATCA HAL for SWI UART More... | |
typedef struct atcaSWImaster | ATCASWIMaster_t |
this is the hal_data for ATCA HAL for ASF SERCOM More... | |
typedef struct atcaSWImaster | ATCASWIMaster_t |
this is the hal_data for ATCA HAL for ASF SERCOM More... | |
typedef struct atcaSWImaster | ATCASWIMaster_t |
this is the hal_data for ATCA HAL for SWI UART More... | |
Enumerations | |
enum | i2c_read_write_flag { I2C_WRITE = (uint8_t)0x00, I2C_READ = (uint8_t)0x01 } |
This enumeration lists flags for I2C read or write addressing. More... | |
enum | swi_flag { SWI_FLAG_CMD = (uint8_t)0x77, SWI_FLAG_TX = (uint8_t)0x88, SWI_FLAG_IDLE = (uint8_t)0xBB, SWI_FLAG_SLEEP = (uint8_t)0xCC } |
This enumeration lists flags for SWI. More... | |
Functions | |
ATCA_STATUS | hal_iface_init (ATCAIfaceCfg *, ATCAHAL_t *hal) |
Standard HAL API for ATCA to initialize a physical interface. More... | |
ATCA_STATUS | hal_iface_release (ATCAIfaceType, void *hal_data) |
releases a physical interface, HAL knows how to interpret hal_data More... | |
ATCA_STATUS | hal_check_wake (const uint8_t *response, int response_size) |
Utility function for hal_wake to check the reply. More... | |
void | atca_delay_us (uint32_t delay) |
Timer API implemented at the HAL level. More... | |
void | atca_delay_10us (uint32_t delay) |
This function delays for a number of tens of microseconds. More... | |
void | atca_delay_ms (uint32_t delay) |
This function delays for a number of milliseconds. More... | |
ATCA_STATUS | hal_create_mutex (void **ppMutex, char *pName) |
Optional hal interfaces. More... | |
ATCA_STATUS | hal_destroy_mutex (void *pMutex) |
ATCA_STATUS | hal_lock_mutex (void *pMutex) |
ATCA_STATUS | hal_unlock_mutex (void *pMutex) |
ATCA_STATUS | hal_kit_hid_discover_buses (int i2c_buses[], int max_buses) |
discover cdc buses available for this hardware this maintains a list of logical to physical bus mappings freeing the application of the a-priori knowledge More... | |
ATCA_STATUS | hal_kit_hid_discover_devices (int bus_num, ATCAIfaceCfg cfg[], int *found) |
discover any CryptoAuth devices on a given logical bus number More... | |
ATCA_STATUS | hal_kit_hid_init (void *hal, ATCAIfaceCfg *cfg) |
HAL implementation of Kit USB HID init. More... | |
ATCA_STATUS | hal_kit_hid_post_init (ATCAIface iface) |
HAL implementation of Kit HID post init. More... | |
ATCA_STATUS | kit_phy_send (ATCAIface iface, uint8_t *txdata, int txlength) |
HAL implementation of send over USB HID. More... | |
ATCA_STATUS | kit_phy_receive (ATCAIface iface, uint8_t *rxdata, int *rxsize) |
HAL implementation of kit protocol send over USB HID. More... | |
ATCA_STATUS | kit_phy_num_found (int8_t *num_found) |
Number of USB HID devices found. More... | |
ATCA_STATUS | hal_kit_hid_send (ATCAIface iface, uint8_t *txdata, int txlength) |
HAL implementation of kit protocol send over USB HID. More... | |
ATCA_STATUS | hal_kit_hid_receive (ATCAIface iface, uint8_t *rxdata, uint16_t *rxsize) |
HAL implementation of send over USB HID. More... | |
ATCA_STATUS | hal_kit_hid_wake (ATCAIface iface) |
Call the wake for kit protocol. More... | |
ATCA_STATUS | hal_kit_hid_idle (ATCAIface iface) |
Call the idle for kit protocol. More... | |
ATCA_STATUS | hal_kit_hid_sleep (ATCAIface iface) |
Call the sleep for kit protocol. More... | |
ATCA_STATUS | hal_kit_hid_release (void *hal_data) |
Close the physical port for HID. More... | |
ATCA_STATUS | hal_i2c_discover_buses (int i2c_buses[], int max_buses) |
discover i2c buses available for this hardware this maintains a list of logical to physical bus mappings freeing the application of the prior knowledge More... | |
ATCA_STATUS | hal_i2c_discover_devices (int bus_num, ATCAIfaceCfg cfg[], int *found) |
discover any CryptoAuth devices on a given logical bus number More... | |
ATCA_STATUS | hal_i2c_init (void *hal, ATCAIfaceCfg *cfg) |
initialize an I2C interface using given config More... | |
ATCA_STATUS | hal_i2c_post_init (ATCAIface iface) |
HAL implementation of I2C post init. More... | |
ATCA_STATUS | hal_i2c_send (ATCAIface iface, uint8_t *txdata, int txlength) |
HAL implementation of I2C send over ASF. More... | |
ATCA_STATUS | hal_i2c_receive (ATCAIface iface, uint8_t *rxdata, uint16_t *rxlength) |
HAL implementation of I2C receive function for ASF I2C. More... | |
void | change_i2c_speed (ATCAIface iface, uint32_t speed) |
method to change the bus speed of I2C More... | |
ATCA_STATUS | hal_i2c_wake (ATCAIface iface) |
wake up CryptoAuth device using I2C bus More... | |
ATCA_STATUS | hal_i2c_idle (ATCAIface iface) |
idle CryptoAuth device using I2C bus More... | |
ATCA_STATUS | hal_i2c_sleep (ATCAIface iface) |
sleep CryptoAuth device using I2C bus More... | |
ATCA_STATUS | hal_i2c_release (void *hal_data) |
manages reference count on given bus and releases resource if no more refences exist More... | |
ATCA_STATUS | hal_cdc_discover_buses (int cdc_buses[], int max_buses) |
discover cdc buses available for this hardware this maintains a list of logical to physical bus mappings freeing the application of the a-priori knowledge.This function is currently not implemented. More... | |
ATCA_STATUS | hal_cdc_discover_devices (int bus_num, ATCAIfaceCfg cfg[], int *found) |
discover any CryptoAuth devices on a given logical bus number More... | |
ATCA_STATUS | hal_kit_cdc_init (void *hal, ATCAIfaceCfg *cfg) |
HAL implementation of Kit USB CDC init. More... | |
ATCA_STATUS | hal_kit_cdc_post_init (ATCAIface iface) |
HAL implementation of Kit USB CDC post init. More... | |
ATCA_STATUS | kit_phy_send (ATCAIface iface, const char *txdata, int txlength) |
HAL implementation of kit protocol send .It is called by the top layer. More... | |
ATCA_STATUS | kit_phy_receive (ATCAIface iface, char *rxdata, int *rxsize) |
HAL implementation of kit protocol receive data.It is called by the top layer. More... | |
ATCA_STATUS | hal_kit_phy_num_found (int8_t *num_found) |
Number of USB CDC devices found. More... | |
ATCA_STATUS | hal_kit_cdc_send (ATCAIface iface, uint8_t *txdata, int txlength) |
HAL implementation of kit protocol send over USB CDC. More... | |
ATCA_STATUS | hal_kit_cdc_receive (ATCAIface iface, uint8_t *rxdata, uint16_t *rxsize) |
HAL implementation of kit protocol receive over USB CDC. More... | |
ATCA_STATUS | hal_kit_cdc_wake (ATCAIface iface) |
Call the wake for kit protocol over USB CDC. More... | |
ATCA_STATUS | hal_kit_cdc_idle (ATCAIface iface) |
Call the idle for kit protocol over USB CDC. More... | |
ATCA_STATUS | hal_kit_cdc_sleep (ATCAIface iface) |
Call the sleep for kit protocol over USB CDC. More... | |
ATCA_STATUS | hal_kit_cdc_release (void *hal_data) |
Close the physical port for CDC over USB CDC. More... | |
ATCA_STATUS | hal_kit_cdc_discover_buses (int cdc_buses[], int max_buses) |
discover cdc buses available for this hardware this maintains a list of logical to physical bus mappings freeing the application of the a-priori knowledge.This function is currently not implemented. More... | |
ATCA_STATUS | hal_kit_cdc_discover_devices (int bus_num, ATCAIfaceCfg *cfg, int *found) |
discover any CryptoAuth devices on a given logical bus number More... | |
void | i2c_write (I2C_MODULE i2c_id, uint8_t address, uint8_t *data, int len) |
ATCA_STATUS | i2c_read (I2C_MODULE i2c_id, uint8_t address, uint8_t *data, uint16_t len) |
void | delay_us (UINT32 delay) |
void | delay_us (uint32_t delay) |
ATCA_STATUS | hal_swi_discover_buses (int swi_buses[], int max_buses) |
discover swi buses available for this hardware this maintains a list of logical to physical bus mappings freeing the application.This function is currently not supported. of the a-priori knowledge More... | |
ATCA_STATUS | hal_swi_discover_devices (int bus_num, ATCAIfaceCfg cfg[], int *found) |
discover any CryptoAuth devices on a given logical bus number.This function is curently not supported. More... | |
ATCA_STATUS | hal_swi_init (void *hal, ATCAIfaceCfg *cfg) |
hal_swi_init manages requests to initialize a physical interface. It manages use counts so when an interface has released the physical layer, it will disable the interface for some other use. You can have multiple ATCAIFace instances using the same bus, and you can have multiple ATCAIFace instances on multiple swi buses, so hal_swi_init manages these things and ATCAIFace is abstracted from the physical details. More... | |
ATCA_STATUS | hal_swi_post_init (ATCAIface iface) |
HAL implementation of SWI post init. More... | |
ATCA_STATUS | hal_swi_send (ATCAIface iface, uint8_t *txdata, int txlength) |
Send byte(s) via SWI. More... | |
ATCA_STATUS | hal_swi_receive (ATCAIface iface, uint8_t *rxdata, uint16_t *rxlength) |
Receive byte(s) via SWI. More... | |
ATCA_STATUS | hal_swi_wake (ATCAIface iface) |
Send Wake flag via SWI. More... | |
ATCA_STATUS | hal_swi_idle (ATCAIface iface) |
Send Idle flag via SWI. More... | |
ATCA_STATUS | hal_swi_sleep (ATCAIface iface) |
Send Sleep flag via SWI. More... | |
ATCA_STATUS | hal_swi_release (void *hal_data) |
Manages reference count on given bus and releases resource if no more reference(s) exist. More... | |
ATCA_STATUS | hal_swi_send_flag (ATCAIface iface, uint8_t data) |
HAL implementation of SWI send one byte over UART. More... | |
char * | strnchr (const char *s, size_t count, int c) |
char | kit_id_from_devtype (ATCADeviceType devtype) |
ATCA_STATUS | kit_init (ATCAIface iface) |
HAL implementation of kit protocol init. This function calls back to the physical protocol to send the bytes. More... | |
ATCA_STATUS | kit_send (ATCAIface iface, const uint8_t *txdata, int txlength) |
HAL implementation of kit protocol send. This function calls back to the physical protocol to send the bytes. More... | |
ATCA_STATUS | kit_receive (ATCAIface iface, uint8_t *rxdata, uint16_t *rxsize) |
HAL implementation to receive bytes and unwrap from kit protocol. This function calls back to the physical protocol to receive the bytes. More... | |
ATCA_STATUS | kit_wake (ATCAIface iface) |
Call the wake for kit protocol. More... | |
ATCA_STATUS | kit_idle (ATCAIface iface) |
Call the idle for kit protocol. More... | |
ATCA_STATUS | kit_sleep (ATCAIface iface) |
Call the sleep for kit protocol. More... | |
ATCA_STATUS | kit_wrap_cmd (const uint8_t *txdata, int txlen, char *pkitcmd, int *nkitcmd, char target) |
Wrap binary bytes in ascii kit protocol. More... | |
ATCA_STATUS | kit_parse_rsp (const char *pkitbuf, int nkitbuf, uint8_t *kitstatus, uint8_t *rxdata, int *datasize) |
Parse the response ascii from the kit. More... | |
ATCA_STATUS | swi_uart_init (ATCASWIMaster_t *instance) |
Implementation of SWI UART init. More... | |
ATCA_STATUS | swi_uart_deinit (ATCASWIMaster_t *instance) |
Implementation of SWI UART deinit. More... | |
void | swi_uart_setbaud (ATCASWIMaster_t *instance, uint32_t baudrate) |
implementation of SWI UART change baudrate. More... | |
void | swi_uart_mode (ATCASWIMaster_t *instance, uint8_t mode) |
implementation of SWI UART change mode. More... | |
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 mappings freeing the application of the a-priori knowledge More... | |
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. More... | |
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. More... | |
Variables | |
atcahid_t | _gHid |
ATCAI2CMaster_t * | i2c_hal_data [MAX_I2C_BUSES] |
int | i2c_bus_ref_ct = 0 |
atcacdc_t | _gCdc |
char * | dev = "/dev/ttyACM0" |
int | speed = B115200 |
atcahid_t | _gHid |
atcahid_t | _gHid |
struct port_config | pin_conf |
These methods define the hardware abstraction layer for communicating with a CryptoAuth device.
These methods define the hardware abstraction layer for communicating with a CryptoAuth device using SWI interface.
These methods define the hardware abstraction layer for communicating with a CryptoAuth device using SWI Interface.
These methods define the hardware abstraction layer for communicating with a CryptoAuth device using SWI bit banging.
< Uncomment when debugging
These methods define the hardware abstraction layer for communicating with a CryptoAuth device using I2C driver of Harmony.
These methods define the hardware abstraction layer for communicating with a CryptoAuth device using I2C bit banging.
These methods define the hardware abstraction layer for communicating with a CryptoAuth device using I2C driver of ASF.
#define CDC_BUFFER_MAX 1024 |
#define CDC_DEVICES_MAX 10 |
#define CPU_CLOCK (80000000UL) |
#define DEBUG_PIN_1 EXT2_PIN_5 |
#define DEBUG_PIN_2 EXT2_PIN_6 |
#define GetInstructionClock | ( | ) | (GetSystemClock()) |
#define GetPeripheralClock | ( | ) | (GetSystemClock() / (1 << OSCCONbits.PBDIV)) |
#define GetSystemClock | ( | ) | (80000000ul) |
#define GetSystemClock | ( | ) | (200000000UL)/* Fcy = 200MHz */ |
#define HARMONY_I2C_DRIVER 1 |
#define HID_DEVICES_MAX 10 |
#define HID_DEVICES_MAX 10 |
#define HID_DEVICES_MAX 10 |
#define HID_GUID { 0x4d1e55b2, 0xf16f, 0x11cf, 0x88, 0xcb, 0x00, 0x11, 0x11, 0x00, 0x00, 0x30 } |
#define HID_PACKET_MAX 512 |
#define HID_PACKET_MAX 512 |
#define HID_PACKET_MAX 512 |
#define INVALID_HANDLE_VALUE ((int)(-1)) |
#define KIT_MAX_SCAN_COUNT 4 |
#define KIT_MAX_TX_BUF 32 |
#define KIT_MSG_SIZE (32) |
#define KIT_RX_WRAP_SIZE (KIT_MSG_SIZE + 6) |
#define KIT_TX_WRAP_SIZE (7) |
#define max | ( | a, | |
b | |||
) | (((a) > (b)) ? (a) : (b)) |
#define MAX_I2C_BUSES 2 |
#define MAX_I2C_BUSES 2 |
#define MAX_I2C_BUSES 6 |
#define MAX_I2C_BUSES 6 |
#define MAX_I2C_BUSES 3 |
#define MAX_I2C_BUSES 4 |
#define MAX_I2C_BUSES 3 |
#define MAX_I2C_BUSES 2 |
#define MAX_I2C_BUSES 1 |
#define MAX_I2C_BUSES 2 |
#define MAX_I2C_BUSES 4 |
#define MAX_SWI_BUSES 6 |
#define MAX_SWI_BUSES 1 |
#define MAX_SWI_BUSES 6 |
#define MAX_SWI_BUSES 6 |
#define min | ( | a, | |
b | |||
) | (((a) < (b)) ? (a) : (b)) |
#define RECEIVE_MODE 0 |
#define RECEIVE_MODE 0 |
#define RECEIVE_MODE 0 |
#define RECEIVE_MODE 0 |
#define RX_DELAY 10 |
#define RX_DELAY 10 |
#define RX_DELAY 10 |
#define RX_DELAY 10 |
#define SWI_FLAG_CMD ((uint8_t)0x77) |
flag preceding a command
#define SWI_FLAG_IDLE ((uint8_t)0xBB) |
flag requesting to go into Idle mode
#define SWI_FLAG_SLEEP ((uint8_t)0xCC) |
flag requesting to go into Sleep mode
#define SWI_FLAG_TX ((uint8_t)0x88) |
flag requesting a response
#define SWI_WAKE_TOKEN ((uint8_t)0x00) |
flag preceding a command
#define TRANSMIT_MODE 1 |
#define TRANSMIT_MODE 1 |
#define TRANSMIT_MODE 1 |
#define TRANSMIT_MODE 1 |
#define TX_DELAY 90 |
#define TX_DELAY 90 |
#define TX_DELAY 90 |
#define TX_DELAY 93 |
#define us_SCALE ((CPU_CLOCK / 2) / 1000000) |
#define us_SCALE (GetSystemClock() / 2000000) |
typedef struct atcaI2Cmaster ATCAI2CMaster_t |
typedef struct atcaI2Cmaster ATCAI2CMaster_t |
this is the hal_data for ATCA HAL created using ASF
typedef struct atcaI2Cmaster ATCAI2CMaster_t |
this is the hal_data for ATCA HAL for ASF
typedef struct atcaI2Cmaster ATCAI2CMaster_t |
this is the hal_data for ATCA HAL for Atmel START SERCOM
typedef struct atcaI2Cmaster ATCAI2CMaster_t |
this is the hal_data for ATCA HAL created using ASF
typedef struct atcaI2Cmaster ATCAI2CMaster_t |
this is the hal_data for ATCA HAL
typedef struct atcaI2Cmaster ATCAI2CMaster_t |
this is the hal_data for ATCA HAL for ASF SERCOM
typedef struct atcaI2Cmaster ATCAI2CMaster_t |
this is the hal_data for ATCA HAL for ASF SERCOM
typedef struct atcaI2Cmaster ATCAI2CMaster_t |
this is the hal_data for ATCA HAL
typedef struct atcaI2Cmaster ATCAI2CMaster_t |
this is the hal_data for ATCA HAL
typedef struct atcaI2Cmaster ATCAI2CMaster_t |
this is the hal_data for ATCA HAL
typedef struct atcaI2Cmaster ATCAI2CMaster_t |
This is the hal_data for ATCA HAL.
typedef struct atcaSWImaster ATCASWIMaster_t |
this is the hal_data for ATCA HAL for SWI UART
typedef struct atcaSWImaster ATCASWIMaster_t |
this is the hal_data for ATCA HAL for SWI UART
typedef struct atcaSWImaster ATCASWIMaster_t |
this is the hal_data for ATCA HAL for ASF SERCOM
typedef struct atcaSWImaster ATCASWIMaster_t |
this is the hal_data for ATCA HAL for ASF SERCOM
typedef struct atcaSWImaster ATCASWIMaster_t |
This is the hal_data for ATCA HAL.
typedef struct cdc_device cdc_device_t |
typedef int HANDLE |
typedef struct hid_device hid_device_t |
typedef struct hid_device hid_device_t |
enum i2c_read_write_flag |
enum swi_flag |
void atca_delay_10us | ( | uint32_t | delay | ) |
This function delays for a number of tens of microseconds.
[in] | delay | number of 0.01 milliseconds to delay |
void atca_delay_ms | ( | uint32_t | delay | ) |
This function delays for a number of milliseconds.
You can override this function if you like to do something else in your system while delaying.
[in] | delay | number of milliseconds to delay |
void atca_delay_us | ( | uint32_t | delay | ) |
Timer API implemented at the HAL level.
This function delays for a number of microseconds.
[in] | delay | number of microseconds to delay |
[in] | delay | number of 0.001 milliseconds to delay |
void change_i2c_speed | ( | ATCAIface | iface, |
uint32_t | speed | ||
) |
method to change the bus speed of I2C
method to change the bus speed of I2C.This function is not used in Linux.
method to change the bus speec of I2C
[in] | iface | interface on which to change bus speed |
[in] | speed | baud rate (typically 100000 or 400000) |
[in] | iface | interface on which to change bus speed |
[in] | speed | baud rate (typically 100000 or 400000) |
void delay_us | ( | UINT32 | delay | ) |
void delay_us | ( | uint32_t | delay | ) |
ATCA_STATUS hal_cdc_discover_buses | ( | int | cdc_buses[], |
int | max_buses | ||
) |
discover cdc buses available for this hardware this maintains a list of logical to physical bus mappings freeing the application of the a-priori knowledge.This function is currently not implemented.
[in] | cdc_buses | - an array of logical bus numbers |
[in] | max_buses | - maximum number of buses the app wants to attempt to discover |
ATCA_STATUS hal_cdc_discover_devices | ( | int | bus_num, |
ATCAIfaceCfg | cfg[], | ||
int * | found | ||
) |
discover any CryptoAuth devices on a given logical bus number
[in] | bus_num | - logical bus number on which to look for CryptoAuth devices |
[out] | cfg[] | - pointer to head of an array of interface config structures which get filled in by this method |
[out] | *found | - number of devices found on this bus |
ATCA_STATUS hal_check_wake | ( | const uint8_t * | response, |
int | response_size | ||
) |
Utility function for hal_wake to check the reply.
[in] | response | Wake response to be checked. |
[in] | response_size | Size of the response to check. |
ATCA_STATUS hal_create_mutex | ( | void ** | ppMutex, |
char * | pName | ||
) |
Optional hal interfaces.
ATCA_STATUS hal_destroy_mutex | ( | void * | pMutex | ) |
ATCA_STATUS hal_i2c_discover_buses | ( | int | i2c_buses[], |
int | max_buses | ||
) |
discover i2c buses available for this hardware this maintains a list of logical to physical bus mappings freeing the application of the prior knowledge
This HAL implementation assumes you've included the ASF TWI libraries in your project, otherwise, the HAL layer will not compile because the ASF TWI drivers are a dependency.
This HAL implementation assumes you've included the Plib libraries in your project, otherwise, the HAL layer will not compile because the Plib drivers are a dependency.
discover i2c buses available for this hardware this maintains a list of logical to physical bus mappings freeing the application of the a-priori knowledge.This function is not implemented.
discover i2c buses available for this hardware this maintains a list of logical to physical bus mappings freeing the application of the a-priori knowledge
[in] | i2c_buses | an array of logical bus numbers |
[in] | max_buses | maximum number of buses the app wants to attempt to discover |
[in] | i2c_buses | - an array of logical bus numbers |
[in] | max_buses | - maximum number of buses the app wants to attempt to discover |
[in] | i2c_buses | - an array of logical bus numbers |
[in] | max_buses | - maximum number of buses the app wants to attempt to discover |
[in] | i2c_buses | - an array of logical bus numbers |
[in] | max_buses | - maximum number of buses the app wants to attempt to discover |
discover i2c buses available for this hardware this maintains a list of logical to physical bus mappings freeing the application of the a-priori knowledge.This function is currently not implemented.
[in] | i2c_buses | - an array of logical bus numbers |
[in] | max_buses | - maximum number of buses the app wants to attempt to discover |
discover i2c buses available for this hardware this maintains a list of logical to physical bus mappings freeing the application of the a-priori knowledge
[in] | i2c_buses | - an array of logical bus numbers |
[in] | max_buses | - maximum number of buses the app wants to attempt to discover |
discover i2c buses available for this hardware this maintains a list of logical to physical bus mappings freeing the application of the a-priori knowledge
[in] | i2c_buses | - an array of logical bus numbers |
[in] | max_buses | - maximum number of buses the app wants to attempt to discover return ATCA_SUCCESS |
ATCA_STATUS hal_i2c_discover_devices | ( | int | bus_num, |
ATCAIfaceCfg | cfg[], | ||
int * | found | ||
) |
discover any CryptoAuth devices on a given logical bus number
discover any CryptoAuth devices on a given logical bus number.This function is currently not implemented.
[in] | bus_num | logical bus number on which to look for CryptoAuth devices |
[out] | cfg | pointer to head of an array of interface config structures which get filled in by this method |
[out] | found | number of devices found on this bus |
[in] | bus_num | - logical bus number on which to look for CryptoAuth devices |
[out] | cfg[] | - pointer to head of an array of interface config structures which get filled in by this method |
[out] | *found | - number of devices found on this bus |
[in] | bus_num | logical bus number on which to look for CryptoAuth devices |
[out] | cfg | pointer to head of an array of interface config structures which get filled in by this method |
[out] | found | number of devices found on this bus |
[in] | bus_num | logical bus number on which to look for CryptoAuth devices |
[out] | cfg | pointer to head of an array of interface config structures which get filled in by this method |
[out] | found | number of devices found on this bus |
[in] | bus_num | - logical bus number on which to look for CryptoAuth devices |
[out] | cfg[] | - pointer to head of an array of interface config structures which get filled in by this method |
[out] | *found | - number of devices found on this bus |
[in] | bus_num | - logical bus number on which to look for CryptoAuth devices |
[out] | cfg[] | - pointer to head of an array of interface config structures which get filled in by this method |
[out] | *found | - number of devices found on this bus |
[in] | bus_num | Logical bus number on which to look for CryptoAuth devices |
[out] | cfg | Pointer to head of an array of interface config structures which get filled in by this method |
[out] | found | Number of devices found on this bus |
default configuration, to be reused during discovery process
default configuration, to be reused during discovery process
default configuration, to be reused during discovery process
default configuration, to be reused during discovery process
default configuration, to be reused during discovery process
default configuration, to be reused during discovery process
default configuration, to be reused during discovery process
default configuration, to be reused during discovery process
ATCA_STATUS hal_i2c_idle | ( | ATCAIface | iface | ) |
idle CryptoAuth device using I2C bus
[in] | iface | interface to logical device to idle |
[in] | iface | interface to logical device to idle |
< Word Address Value = Idle
ATCA_STATUS hal_i2c_init | ( | void * | hal, |
ATCAIfaceCfg * | cfg | ||
) |
initialize an I2C interface using given config
HAL implementation of I2C init.
hal_i2c_init manages requests to initialize a physical interface. it manages use counts so when an interface has released the physical layer, it will disable the interface for some other use. You can have multiple ATCAIFace instances using the same bus, and you can have multiple ATCAIFace instances on multiple i2c buses, so hal_i2c_init manages these things and ATCAIFace is abstracted from the physical details.
hal_i2c_init manages requests to initialize a physical interface. It manages use counts so when an interface has released the physical layer, it will disable the interface for some other use. You can have multiple ATCAIFace instances using the same bus, and you can have multiple ATCAIFace instances on multiple i2c buses, so hal_i2c_init manages these things and ATCAIFace is abstracted from the physical details.
[in] | hal | opaque ptr to HAL data |
[in] | cfg | pointer to interface configuration |
Initialize an I2C interface using given config.
[in] | hal | opaque pointer to HAL data |
[in] | cfg | interface configuration |
[in] | hal | - opaque ptr to HAL data |
[in] | cfg | - interface configuration |
[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 |
initialize an I2C interface using given config
[in] | hal | - opaque ptr to HAL data |
[in] | cfg | - interface configuration |
[in] | hal | - opaque ptr to HAL data |
[in] | cfg | - interface configuration |
[in] | hal | - opaque ptr to HAL data |
[in] | cfg | - interface configuration |
[in] | hal | - opaque ptr to HAL data |
[in] | cfg | - interface configuration |
ATCA_STATUS hal_i2c_post_init | ( | ATCAIface | iface | ) |
HAL implementation of I2C post init.
[in] | iface | instance |
[in] | iface | instance |
[in] | iface | instance |
ATCA_STATUS hal_i2c_receive | ( | ATCAIface | iface, |
uint8_t * | rxdata, | ||
uint16_t * | rxlength | ||
) |
HAL implementation of I2C receive function for ASF I2C.
HAL implementation of I2C receive function.
HAL implementation of I2C receive function for START I2C.
HAL implementation of receive bytes via I2C bit-banged.
[in] | iface | Device to interact with. |
[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_i2c_release | ( | void * | hal_data | ) |
manages reference count on given bus and releases resource if no more refences exist
manages reference count on given bus and releases resource if no more refernces exist
manages reference count on given bus and releases resource if no more references exist
[in] | hal_data | - opaque pointer to hal data structure - known only to the HAL implementation |
[in] | hal_data | opaque pointer to hal data structure - known only to the HAL implementation |
[in] | hal_data | - opaque pointer to hal data structure - known only to the HAL implementation |
[in] | hal_data | - opaque pointer to hal data structure - known only to the HAL implementation |
[in] | hal_data | - opaque pointer to hal data structure - known only to the HAL implementation return ATCA_SUCCESS |
ATCA_STATUS hal_i2c_send | ( | ATCAIface | iface, |
uint8_t * | txdata, | ||
int | txlength | ||
) |
HAL implementation of I2C send over ASF.
HAL implementation of I2C send.
HAL implementation of I2C send over START.
HAL implementation of Send byte(s) via I2C.
[in] | iface | instance |
[in] | txdata | pointer to space to bytes to send |
[in] | txlength | number of bytes to send |
[in] | iface | interface of the logical device to send data to |
[in] | txdata | pointer to bytes to send |
[in] | txlength | number of bytes to send |
< Word Address Value = Command
< count Word Address byte towards txlength
Set I2C pins
Address the device and indicate that bytes are to be written
Send the remaining bytes
Send STOP regardless of i2c_status
ATCA_STATUS hal_i2c_sleep | ( | ATCAIface | iface | ) |
sleep CryptoAuth device using I2C bus
[in] | iface | interface to logical device to sleep |
[in] | iface | interface to logical device to sleep |
< Word Address Value = Sleep
ATCA_STATUS hal_i2c_wake | ( | ATCAIface | iface | ) |
wake up CryptoAuth device using I2C bus
[in] | iface | interface to logical device to wakeup |
ATCA_STATUS hal_iface_init | ( | ATCAIfaceCfg * | cfg, |
ATCAHAL_t * | hal | ||
) |
Standard HAL API for ATCA to initialize a physical interface.
[in] | cfg | pointer to ATCAIfaceCfg object |
[in] | hal | pointer to ATCAHAL_t intermediate data structure |
ATCA_STATUS hal_iface_release | ( | ATCAIfaceType | iface_type, |
void * | hal_data | ||
) |
releases a physical interface, HAL knows how to interpret hal_data
[in] | iface_type | - the type of physical interface to release |
[in] | hal_data | - pointer to opaque hal data maintained by HAL implementation for this interface type |
ATCA_STATUS hal_kit_cdc_discover_buses | ( | int | cdc_buses[], |
int | max_buses | ||
) |
discover cdc buses available for this hardware this maintains a list of logical to physical bus mappings freeing the application of the a-priori knowledge.This function is currently not implemented.
[in] | cdc_buses | - an array of logical bus numbers |
[in] | max_buses | - maximum number of buses the app wants to attempt to discover |
ATCA_STATUS hal_kit_cdc_discover_devices | ( | int | bus_num, |
ATCAIfaceCfg * | cfg, | ||
int * | found | ||
) |
discover any CryptoAuth devices on a given logical bus number
[in] | bus_num | - logical bus number on which to look for CryptoAuth devices |
[out] | cfg[] | - pointer to head of an array of interface config structures which get filled in by this method |
[out] | *found | - number of devices found on this bus |
ATCA_STATUS hal_kit_cdc_idle | ( | ATCAIface | iface | ) |
Call the idle for kit protocol over USB CDC.
[in] | iface | ATCAIface instance that is the interface object to send the bytes over |
ATCA_STATUS hal_kit_cdc_init | ( | void * | hal, |
ATCAIfaceCfg * | cfg | ||
) |
HAL implementation of Kit USB CDC init.
this discovery assumes a udev rule is active which renames the ATCK101 CDC device as a ttyATCAn the udev rule is:
SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2122", MODE:="0777", SYMLINK+="ttyATCA%n"
[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_kit_cdc_post_init | ( | ATCAIface | iface | ) |
HAL implementation of Kit USB CDC post init.
[in] | iface | instance |
ATCA_STATUS hal_kit_cdc_receive | ( | ATCAIface | iface, |
uint8_t * | rxdata, | ||
uint16_t * | rxsize | ||
) |
HAL implementation of kit protocol receive over USB CDC.
[in] | iface | Device to interact with. |
[out] | rxdata | Data received will be returned here. |
[in,out] | rxsize | As input, the size of the rxdata buffer. As output, the number of bytes received. |
ATCA_STATUS hal_kit_cdc_release | ( | void * | hal_data | ) |
Close the physical port for CDC over USB CDC.
[in] | hal_data | The hardware abstraction data specific to this HAL |
ATCA_STATUS hal_kit_cdc_send | ( | ATCAIface | iface, |
uint8_t * | txdata, | ||
int | txlength | ||
) |
HAL implementation of kit protocol send over USB CDC.
[in] | iface | instance |
[in] | txdata | pointer to bytes to send |
[in] | txlength | number of bytes to send |
ATCA_STATUS hal_kit_cdc_sleep | ( | ATCAIface | iface | ) |
Call the sleep for kit protocol over USB CDC.
[in] | iface | ATCAIface instance that is the interface object to send the bytes over |
ATCA_STATUS hal_kit_cdc_wake | ( | ATCAIface | iface | ) |
Call the wake for kit protocol over USB CDC.
[in] | iface | ATCAIface instance that is the interface object to send the bytes over |
ATCA_STATUS hal_kit_hid_discover_buses | ( | int | cdc_buses[], |
int | max_buses | ||
) |
discover cdc buses available for this hardware this maintains a list of logical to physical bus mappings freeing the application of the a-priori knowledge
discover all HID kits available.This function is currently not implemented. this maintains a list of logical to physical bus mappings freeing the application of the a-priori knowledge
discover hid buses available for this hardware this maintains a list of logical to physical bus mappings freeing the application of the a-priori knowledge.This function is currently not implemented.
[in] | cdc_buses | - an array of logical bus numbers |
[in] | max_buses | - maximum number of buses the app wants to attempt to discover |
[in] | cdc_buses | - an array of logical bus numbers |
[in] | max_buses | - maximum number of buses the app wants to attempt to discover |
[in] | cdc_buses | an array of logical bus numbers |
[in] | max_buses | maximum number of buses the app wants to attempt to discover |
ATCA_STATUS hal_kit_hid_discover_devices | ( | int | bus_num, |
ATCAIfaceCfg | cfg[], | ||
int * | found | ||
) |
discover any CryptoAuth devices on a given logical bus number
discover any CryptoAuth devices on a given logical bus number.This function is currently not implemented.
[in] | bus_num | - logical bus number on which to look for CryptoAuth devices |
[out] | cfg[] | - pointer to head of an array of interface config structures which get filled in by this method |
[out] | *found | - number of devices found on this bus |
[in] | bus_num | - logical bus number on which to look for CryptoAuth devices |
[out] | cfg[] | - pointer to head of an array of interface config structures which get filled in by this method |
[out] | *found | - number of devices found on this bus |
ATCA_STATUS hal_kit_hid_idle | ( | ATCAIface | iface | ) |
Call the idle for kit protocol.
Call the idle for kit protocol over USB HID.
[in] | iface | ATCAIface instance that is the interface object to send the bytes over |
[in] | iface | ATCAIface instance that is the interface object to send the bytes over |
ATCA_STATUS hal_kit_hid_init | ( | void * | hal, |
ATCAIfaceCfg * | cfg | ||
) |
HAL implementation of Kit USB HID init.
[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 |
[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_kit_hid_post_init | ( | ATCAIface | iface | ) |
HAL implementation of Kit HID post init.
[in] | iface | instance |
[in] | iface | instance |
ATCA_STATUS hal_kit_hid_receive | ( | ATCAIface | iface, |
uint8_t * | rxdata, | ||
uint16_t * | rxsize | ||
) |
HAL implementation of send over USB HID.
[in] | iface | instance |
[in] | rxdata | pointer to space to receive the data |
[in,out] | rxsize | ptr to expected number of receive bytes to request |
[in] | iface | instance |
[in] | rxdata | pointer to space to receive the data |
[in,out] | rxsize | ptr to expected number of receive bytes to request |
ATCA_STATUS hal_kit_hid_release | ( | void * | hal_data | ) |
Close the physical port for HID.
[in] | hal_data | The hardware abstraction data specific to this HAL |
[in] | hal_data | The hardware abstraction data specific to this HAL |
ATCA_STATUS hal_kit_hid_send | ( | ATCAIface | iface, |
uint8_t * | txdata, | ||
int | txlength | ||
) |
HAL implementation of kit protocol send over USB HID.
[in] | iface | instance |
[in] | txdata | pointer to bytes to send |
[in] | txlength | number of bytes to send |
[in] | iface | instance |
[in] | txdata | pointer to bytes to send |
[in] | txlength | number of bytes to send |
ATCA_STATUS hal_kit_hid_sleep | ( | ATCAIface | iface | ) |
Call the sleep for kit protocol.
Call the sleep for kit protocol over USB HID.
[in] | iface | ATCAIface instance that is the interface object to send the bytes over |
[in] | iface | ATCAIface instance that is the interface object to send the bytes over |
ATCA_STATUS hal_kit_hid_wake | ( | ATCAIface | iface | ) |
Call the wake for kit protocol.
Call the wake for kit protocol over USB HID.
[in] | iface | ATCAIface instance that is the interface object to send the bytes over |
[in] | iface | ATCAIface instance that is the interface object to send the bytes over |
ATCA_STATUS hal_kit_phy_num_found | ( | int8_t * | num_found | ) |
Number of USB CDC devices found.
[out] | num_found |
ATCA_STATUS hal_lock_mutex | ( | void * | pMutex | ) |
ATCA_STATUS hal_swi_discover_buses | ( | int | swi_buses[], |
int | max_buses | ||
) |
discover swi buses available for this hardware this maintains a list of logical to physical bus mappings freeing the application.This function is currently not supported. of the a-priori knowledge
discover swi buses available for this hardware this maintains a list of logical to physical bus mappings freeing the application of the a-priori knowledge
[in] | swi_buses | - an array of logical bus numbers |
[in] | max_buses | - maximum number of buses the app wants to attempt to discover |
[in] | swi_buses | - an array of logical bus numbers |
[in] | max_buses | - maximum number of buses the app wants to attempt to discover |
ATCA_STATUS hal_swi_discover_devices | ( | int | bus_num, |
ATCAIfaceCfg | cfg[], | ||
int * | found | ||
) |
discover any CryptoAuth devices on a given logical bus number.This function is curently not supported.
discover any CryptoAuth devices on a given logical bus number
[in] | bus_num | - logical bus number on which to look for CryptoAuth devices |
[out] | cfg[] | - pointer to head of an array of interface config structures which get filled in by this method |
[out] | *found | - number of devices found on this bus |
[in] | bus_num | - logical bus number on which to look for CryptoAuth devices |
[out] | cfg[] | - pointer to head of an array of interface config structures which get filled in by this method |
[out] | *found | - number of devices found on this bus |
default configuration, to be reused during discovery process
ATCA_STATUS hal_swi_idle | ( | ATCAIface | iface | ) |
Send Idle flag via SWI.
idle CryptoAuth device using SWI interface
[in] | iface | interface of the logical device to idle |
[in] | iface | interface to logical device to idle |
Set SWI pin
ATCA_STATUS hal_swi_init | ( | void * | hal, |
ATCAIfaceCfg * | cfg | ||
) |
hal_swi_init manages requests to initialize a physical interface. It manages use counts so when an interface has released the physical layer, it will disable the interface for some other use. You can have multiple ATCAIFace instances using the same bus, and you can have multiple ATCAIFace instances on multiple swi buses, so hal_swi_init manages these things and ATCAIFace is abstracted from the physical details.
hal_swi_init manages requests to initialize a physical interface. it manages use counts so when an interface has released the physical layer, it will disable the interface for some other use. You can have multiple ATCAIFace instances using the same bus, and you can have multiple ATCAIFace instances on multiple swi buses, so hal_swi_init manages these things and ATCAIFace is abstracted from the physical details.
Initialize an SWI interface using given config.
[in] | hal | opaque pointer to HAL data |
[in] | cfg | interface configuration |
initialize an SWI interface using given config
[in] | hal | - opaque ptr to HAL data |
[in] | cfg | - interface configuration |
assign GPIO pin
ATCA_STATUS hal_swi_post_init | ( | ATCAIface | iface | ) |
HAL implementation of SWI post init.
[in] | iface | ATCAIface instance |
[in] | iface | instance |
ATCA_STATUS hal_swi_receive | ( | ATCAIface | iface, |
uint8_t * | rxdata, | ||
uint16_t * | rxlength | ||
) |
Receive byte(s) via SWI.
HAL implementation of SWI receive function over UART.
[in] | iface | Device to interact with. |
[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. |
Set SWI pin
ATCA_STATUS hal_swi_release | ( | void * | hal_data | ) |
Manages reference count on given bus and releases resource if no more reference(s) exist.
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 |
[in] | hal_data | - opaque pointer to hal data structure - known only to the HAL implementation |
if the use count for this bus has gone to 0 references, disable it. protect against an unbracketed release
ATCA_STATUS hal_swi_send | ( | ATCAIface | iface, |
uint8_t * | txdata, | ||
int | txlength | ||
) |
Send byte(s) via SWI.
HAL implementation of SWI send command over UART.
[in] | iface | interface of the logical device to send data to |
[in] | txdata | pointer to bytes to send |
[in] | txlength | number of bytes to send |
[in] | iface | instance |
[in] | txdata | pointer to space to bytes to send |
[in] | txlength | number of bytes to send |
Skip the Word Address data as SWI doesn't use it
Set SWI pin
Send Command Flag
Send the remaining bytes
ATCA_STATUS hal_swi_send_flag | ( | ATCAIface | iface, |
uint8_t | data | ||
) |
HAL implementation of SWI send one byte over UART.
[in] | iface | instance |
[in] | data | bytes to send |
ATCA_STATUS hal_swi_sleep | ( | ATCAIface | iface | ) |
Send Sleep flag via SWI.
sleep CryptoAuth device using SWI interface
[in] | iface | interface of the logical device to sleep |
[in] | iface | interface to logical device to sleep |
Set SWI pin
ATCA_STATUS hal_swi_wake | ( | ATCAIface | iface | ) |
Send Wake flag via SWI.
wake up CryptoAuth device using SWI interface
[in] | iface | interface of the logical device to wake up |
[in] | iface | interface to logical device to wakeup |
Set SWI pin
Generate Wake Token
Wait tWHI + tWLO
ATCA_STATUS hal_unlock_mutex | ( | void * | pMutex | ) |
ATCA_STATUS i2c_read | ( | I2C_MODULE | i2c_id, |
uint8_t | address, | ||
uint8_t * | data, | ||
uint16_t | len | ||
) |
void i2c_write | ( | I2C_MODULE | i2c_id, |
uint8_t | address, | ||
uint8_t * | data, | ||
int | len | ||
) |
char kit_id_from_devtype | ( | ATCADeviceType | devtype | ) |
Kit Protocol is key
ATCA_STATUS kit_idle | ( | ATCAIface | iface | ) |
Call the idle for kit protocol.
[in] | iface | the interface object to send the bytes over |
ATCA_STATUS kit_init | ( | ATCAIface | iface | ) |
HAL implementation of kit protocol init. This function calls back to the physical protocol to send the bytes.
[in] | iface | instance |
ATCA_STATUS kit_parse_rsp | ( | const char * | pkitbuf, |
int | nkitbuf, | ||
uint8_t * | kitstatus, | ||
uint8_t * | rxdata, | ||
int * | datasize | ||
) |
Parse the response ascii from the kit.
[out] | pkitbuf | pointer to ascii kit protocol data to parse |
[in] | nkitbuf | length of the ascii kit protocol data |
[in] | kitstatus | status of the ascii device |
[in] | rxdata | pointer to the binary data buffer |
[in] | datasize | size of the pointer to the binary data buffer |
ATCA_STATUS kit_phy_num_found | ( | int8_t * | num_found | ) |
Number of USB HID devices found.
[out] | num_found |
[out] | num_found |
[out] | num_found |
ATCA_STATUS kit_phy_receive | ( | ATCAIface | iface, |
char * | rxdata, | ||
int * | rxsize | ||
) |
HAL implementation of kit protocol receive data.It is called by the top layer.
[in] | iface | instance |
[out] | rxdata | pointer to space to receive the data |
[in,out] | rxsize | ptr to expected number of receive bytes to request |
ATCA_STATUS kit_phy_receive | ( | ATCAIface | iface, |
uint8_t * | rxdata, | ||
int * | rxsize | ||
) |
HAL implementation of kit protocol send over USB HID.
HAL implementation of kit protocol receive.This function is called by the top layer.
[in] | iface | instance |
[out] | rxdata | pointer to space to receive the data |
[in,out] | rxsize | ptr to expected number of receive bytes to request |
[in] | iface | instance |
[out] | rxdata | pointer to space to receive the data |
[in,out] | rxsize | ptr to expected number of receive bytes to request |
ATCA_STATUS kit_phy_send | ( | ATCAIface | iface, |
uint8_t * | txdata, | ||
int | txlength | ||
) |
HAL implementation of send over USB HID.
HAL implementation of send over Kit protocol.This function is called by the top layer.
[in] | iface | instance |
[in] | txdata | pointer to bytes to send |
[in] | txlength | number of bytes to send |
[in] | iface | instance |
[in] | txdata | pointer to bytes to send |
[in] | txlength | number of bytes to send |
ATCA_STATUS kit_phy_send | ( | ATCAIface | iface, |
const char * | txdata, | ||
int | txlength | ||
) |
HAL implementation of kit protocol send .It is called by the top layer.
[in] | iface | instance |
[in] | txdata | pointer to bytes to send |
[in] | txlength | number of bytes to send |
ATCA_STATUS kit_receive | ( | ATCAIface | iface, |
uint8_t * | rxdata, | ||
uint16_t * | rxsize | ||
) |
HAL implementation to receive bytes and unwrap from kit protocol. This function calls back to the physical protocol to receive the bytes.
[in] | iface | instance |
[in] | rxdata | pointer to space to receive the data |
[in,out] | rxsize | ptr to expected number of receive bytes to request |
ATCA_STATUS kit_send | ( | ATCAIface | iface, |
const uint8_t * | txdata, | ||
int | txlength | ||
) |
HAL implementation of kit protocol send. This function calls back to the physical protocol to send the bytes.
[in] | iface | instance |
[in] | txdata | pointer to bytes to send |
[in] | txlength | number of bytes to send |
ATCA_STATUS kit_sleep | ( | ATCAIface | iface | ) |
Call the sleep for kit protocol.
[in] | iface | the interface object to send the bytes over |
ATCA_STATUS kit_wake | ( | ATCAIface | iface | ) |
Call the wake for kit protocol.
[in] | iface | the interface object to send the bytes over |
ATCA_STATUS kit_wrap_cmd | ( | const uint8_t * | txdata, |
int | txlen, | ||
char * | pkitcmd, | ||
int * | nkitcmd, | ||
char | target | ||
) |
Wrap binary bytes in ascii kit protocol.
[in] | txdata | Binary data to wrap. |
[in] | txlen | Length of binary data in bytes. |
[out] | pkitcmd | ASCII kit protocol wrapped data is return here. |
[in,out] | nkitcmd | As input, the size of the pkitcmd buffer. As output, the number of bytes returned in the pkitcmd buffer. |
[in] | target | Target char to use 's' for SHA devices, 'e' for ECC devices. |
char* strnchr | ( | const char * | s, |
size_t | count, | ||
int | c | ||
) |
ATCA_STATUS swi_uart_deinit | ( | ATCASWIMaster_t * | instance | ) |
Implementation of SWI UART deinit.
HAL implementation of SWI UART deinit.
[in] | instance | instance |
[in] | instance | instance |
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 mappings freeing the application of the a-priori knowledge
[in] | swi_uart_buses | - an array of logical bus numbers |
[in] | max_buses | - maximum number of buses the app wants to attempt to discover |
ATCA_STATUS swi_uart_init | ( | ATCASWIMaster_t * | instance | ) |
Implementation of SWI UART init.
HAL implementation of SWI UART init.
[in] | instance | instance |
[in] | instance | instance |
void swi_uart_mode | ( | ATCASWIMaster_t * | instance, |
uint8_t | mode | ||
) |
implementation of SWI UART change mode.
HAL implementation of SWI UART change mode.
[in] | instance | instance |
[in] | mode | (TRANSMIT_MODE or RECEIVE_MODE) |
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.
[in] | instance | instance |
[in,out] | data | pointer to space to receive the data |
[in] | instance | instance |
[out] | data | pointer to space to receive the data |
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.
[in] | instance | instance |
[in] | data | byte to send |
[in] | instance | instance |
[in] | data | number of byte to send |
void swi_uart_setbaud | ( | ATCASWIMaster_t * | instance, |
uint32_t | baudrate | ||
) |
implementation of SWI UART change baudrate.
HAL implementation of SWI UART change baudrate.
[in] | instance | instance |
[in] | baudrate | (typically 230400 , 160000 or 115200) |
[in] | instance | instance |
[in] | baudrate | (typically 230400 or 115200) |
atcacdc_t _gCdc |
atcahid_t _gHid |
atcahid_t _gHid |
atcahid_t _gHid |
char* dev = "/dev/ttyACM0" |
int i2c_bus_ref_ct = 0 |
ATCAI2CMaster_t* i2c_hal_data[MAX_I2C_BUSES] |
struct port_config pin_conf |
int speed = B115200 |