CryptoAuthLib v3.7.6
Microchip CryptoAuthentication Library
 
Loading...
Searching...
No Matches
atca_iface.h File Reference

Microchip Crypto Auth hardware interface object. More...

#include <stdint.h>
#include <stddef.h>
#include "atca_devtypes.h"
#include "atca_status.h"
#include "atca_config.h"

Data Structures

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_ifaceATCAIface
 
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 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.
 
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.
 
ATCAIfaceCfgatgetifacecfg (ATCAIface ca_iface)
 Returns the logical interface configuration for the device.
 
void * atgetifacehaldat (ATCAIface ca_iface)
 Returns the HAL data pointer for the device.
 
ATCA_STATUS ifacecfg_set_address (ATCAIfaceCfg *cfg, uint8_t address, ATCAKitType kitiface)
 Change the address of the selected device.
 
uint8_t ifacecfg_get_address (ATCAIfaceCfg *cfg)
 Retrieves the device address given an interface configuration.
 
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.
 
ATCADeviceType iface_get_device_type_by_name (const char *name)
 Get the ATCADeviceType for a string that looks like a part number.
 

Variables

struct {
   uint8_t   address
 
   uint8_t   bus
 
   uint32_t   baud
 
atcai2c
 
struct {
   uint8_t   address
 
   uint8_t   bus
 
atcaswi
 
struct {
   uint8_t   bus
 
   uint8_t   select_pin
 
   uint32_t   baud
 
atcaspi
 
struct {
   ATCAKitType   dev_interface
 
   uint8_t   dev_identity
 
   uint8_t   port
 
   uint32_t   baud
 
   uint8_t   wordsize
 
   uint8_t   parity
 
   uint8_t   stopbits
 
atcauart
 
struct {
   int   idx
 
   ATCAKitType   dev_interface
 
   uint8_t   dev_identity
 
   uint32_t   vid
 
   uint32_t   pid
 
   uint32_t   packetsize
 
atcahid
 
struct {
   ATCAKitType   dev_interface
 
   uint8_t   dev_identity
 
   uint32_t   flags
 
atcakit
 
struct {
   ATCA_STATUS(*   halinit )(void *hal, void *cfg)
 
   ATCA_STATUS(*   halpostinit )(void *iface)
 
   ATCA_STATUS(*   halsend )(void *iface, uint8_t
      word_address, uint8_t *txdata,
       int txlength)
 
   ATCA_STATUS(*   halreceive )(void *iface, uint8_t
      word_address, uint8_t *rxdata,
       uint16_t *rxlength)
 
   ATCA_STATUS(*   halwake )(void *iface)
 
   ATCA_STATUS(*   halidle )(void *iface)
 
   ATCA_STATUS(*   halsleep )(void *iface)
 
   ATCA_STATUS(*   halrelease )(void *hal_data)
 
atcacustom
 

Detailed Description

Microchip Crypto Auth hardware interface object.

Variable Documentation

◆ address

uint8_t address

Device address - the upper 7 bits are the I2c address bits