Abstract interface to all CryptoAuth device types. This interface connects to the HAL implementation and abstracts the physical details of the device communication from all the upper layers of CryptoAuthLib. More...
Data Structures | |
struct | devtype_names_t |
struct | ATCAIfaceCfg |
struct | ATCAHAL_t |
HAL Driver Structure. More... | |
struct | atca_iface |
atca_iface is the context structure for a configured interface More... | |
Macros | |
#define | ATCA_IFACECFG_NAME(x) (x) |
#define | ATCA_IFACECFG_I2C_ADDRESS(c) (c)->cfg.atcai2c.address |
#define | ATCA_IFACECFG_I2C_BAUD(c) (c)->cfg.atcai2c.baud |
#define | ATCA_IFACECFG_VALUE(c, v) (c)->cfg.v |
Typedefs | |
typedef struct atca_iface * | ATCAIface |
typedef struct atca_iface | atca_iface_t |
atca_iface is the context structure for a configured interface | |
Enumerations | |
enum | ATCAIfaceType { ATCA_I2C_IFACE = 0 , ATCA_SWI_IFACE = 1 , ATCA_UART_IFACE = 2 , ATCA_SPI_IFACE = 3 , ATCA_HID_IFACE = 4 , ATCA_KIT_IFACE = 5 , ATCA_CUSTOM_IFACE = 6 , ATCA_I2C_GPIO_IFACE = 7 , ATCA_SWI_GPIO_IFACE = 8 , ATCA_SPI_GPIO_IFACE = 9 , ATCA_UNKNOWN_IFACE = 0xFE } |
enum | ATCAKitType { ATCA_KIT_AUTO_IFACE , ATCA_KIT_I2C_IFACE , ATCA_KIT_SWI_IFACE , ATCA_KIT_SPI_IFACE , ATCA_KIT_UNKNOWN_IFACE } |
Functions | |
ATCA_STATUS | initATCAIface (ATCAIfaceCfg *cfg, ATCAIface ca_iface) |
Initializer for ATCAIface objects. | |
ATCA_STATUS | atinit (ATCAIface ca_iface) |
Performs the HAL initialization by calling intermediate HAL wrapper function. If using the basic API, the atcab_init() function should be called instead. | |
ATCA_STATUS | atsend (ATCAIface ca_iface, uint8_t word_address, uint8_t *txdata, int txlength) |
Sends the data to the device by calling intermediate HAL wrapper function. | |
ATCA_STATUS | atreceive (ATCAIface ca_iface, uint8_t word_address, uint8_t *rxdata, uint16_t *rxlength) |
Receives data from the device by calling intermediate HAL wrapper function. | |
ATCA_STATUS | atcontrol (ATCAIface ca_iface, uint8_t option, void *param, size_t paramlen) |
Perform control operations with the underlying hal driver. | |
ATCA_STATUS | atwake (ATCAIface ca_iface) |
Wakes up the device by calling intermediate HAL wrapper function. The atcab_wakeup() function should be used instead. | |
ATCA_STATUS | atidle (ATCAIface ca_iface) |
Puts the device into idle state by calling intermediate HAL wrapper function. The atcab_idle() function should be used instead. | |
ATCA_STATUS | atsleep (ATCAIface ca_iface) |
Puts the device into sleep state by calling intermediate HAL wrapper function. The atcab_sleep() function should be used instead. | |
ATCAIfaceCfg * | atgetifacecfg (ATCAIface ca_iface) |
Returns the logical interface configuration for the device. | |
void * | atgetifacehaldat (ATCAIface ca_iface) |
Returns the HAL data pointer for the device. | |
bool | ifacetype_is_kit (ATCAIfaceType iface_type) |
Check if the given interface is a "kit protocol" one. | |
bool | atca_iface_is_kit (ATCAIface ca_iface) |
Check if the given interface is configured as a "kit protocol" one where transactions are atomic. | |
bool | atca_iface_is_swi (ATCAIface ca_iface) |
Check if the given interface is configured as a SWI. | |
int | atca_iface_get_retries (ATCAIface ca_iface) |
Retrive the number of retries for a configured interface. | |
uint16_t | atca_iface_get_wake_delay (ATCAIface ca_iface) |
Retrive the wake/retry delay for a configured interface/device. | |
uint8_t | ifacecfg_get_address (ATCAIfaceCfg *cfg) |
Retrieves the device address given an interface configuration. | |
ATCA_STATUS | ifacecfg_set_address (ATCAIfaceCfg *cfg, uint8_t address, ATCAKitType kitiface) |
Change the address of the selected device. | |
ATCA_STATUS | releaseATCAIface (ATCAIface ca_iface) |
Instruct the HAL driver to release any resources associated with this interface. | |
void | deleteATCAIface (ATCAIface *ca_iface) |
Instruct the HAL driver to release any resources associated with this interface, then delete the object. | |
ATCADeviceType | iface_get_device_type_by_name (const char *name) |
Get the ATCADeviceType for a string that looks like a part number. | |
Abstract interface to all CryptoAuth device types. This interface connects to the HAL implementation and abstracts the physical details of the device communication from all the upper layers of CryptoAuthLib.
enum ATCAIfaceType |
bool atca_iface_is_kit | ( | ATCAIface | ca_iface | ) |
Check if the given interface is configured as a "kit protocol" one where transactions are atomic.
bool atca_iface_is_swi | ( | ATCAIface | ca_iface | ) |
Check if the given interface is configured as a SWI.
ATCA_STATUS atcontrol | ( | ATCAIface | ca_iface, |
uint8_t | option, | ||
void * | param, | ||
size_t | paramlen | ||
) |
Perform control operations with the underlying hal driver.
[in] | ca_iface | Device to interact with. |
[in] | option | Control parameter identifier |
[in] | param | Optional pointer to parameter value |
[in] | paramlen | Length of the parameter |
ATCAIfaceCfg * atgetifacecfg | ( | ATCAIface | ca_iface | ) |
Returns the logical interface configuration for the device.
[in] | ca_iface | Device interface. |
void * atgetifacehaldat | ( | ATCAIface | ca_iface | ) |
Returns the HAL data pointer for the device.
[in] | ca_iface | Device interface. |
ATCA_STATUS atidle | ( | ATCAIface | ca_iface | ) |
Puts the device into idle state by calling intermediate HAL wrapper function. The atcab_idle() function should be used instead.
[in] | ca_iface | Device to interact with. |
ATCA_STATUS atinit | ( | ATCAIface | ca_iface | ) |
Performs the HAL initialization by calling intermediate HAL wrapper function. If using the basic API, the atcab_init() function should be called instead.
[in] | ca_iface | Device to interact with. |
ATCA_STATUS atreceive | ( | ATCAIface | ca_iface, |
uint8_t | word_address, | ||
uint8_t * | rxdata, | ||
uint16_t * | rxlength | ||
) |
Receives data from the device by calling intermediate HAL wrapper function.
[in] | ca_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 atsend | ( | ATCAIface | ca_iface, |
uint8_t | word_address, | ||
uint8_t * | txdata, | ||
int | txlength | ||
) |
Sends the data to the device by calling intermediate HAL wrapper function.
[in] | ca_iface | Device to interact with. |
[in] | word_address | device transaction type |
[in] | txdata | Data to be transmitted to the device. |
[in] | txlength | Number of bytes to be transmitted to the device. |
ATCA_STATUS atsleep | ( | ATCAIface | ca_iface | ) |
Puts the device into sleep state by calling intermediate HAL wrapper function. The atcab_sleep() function should be used instead.
[in] | ca_iface | Device to interact with. |
ATCA_STATUS atwake | ( | ATCAIface | ca_iface | ) |
Wakes up the device by calling intermediate HAL wrapper function. The atcab_wakeup() function should be used instead.
[in] | ca_iface | Device to interact with. |
void deleteATCAIface | ( | ATCAIface * | ca_iface | ) |
Instruct the HAL driver to release any resources associated with this interface, then delete the object.
[in] | ca_iface | Device interface. |
ATCA_STATUS ifacecfg_set_address | ( | ATCAIfaceCfg * | cfg, |
uint8_t | address, | ||
ATCAKitType | kitiface | ||
) |
Change the address of the selected device.
[in] | cfg | Interface configuration structure to update |
[in] | address | Desired address |
[in] | kitiface | Optional parameter to set the kit iface type |
bool ifacetype_is_kit | ( | ATCAIfaceType | iface_type | ) |
Check if the given interface is a "kit protocol" one.
ATCA_STATUS initATCAIface | ( | ATCAIfaceCfg * | cfg, |
ATCAIface | ca_iface | ||
) |
Initializer for ATCAIface objects.
[in] | cfg | Logical configuration for the interface |
[in] | ca_iface | Interface structure to initialize. |
ATCA_STATUS releaseATCAIface | ( | ATCAIface | ca_iface | ) |
Instruct the HAL driver to release any resources associated with this interface.
[in] | ca_iface | Device interface. |