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

Defines an execution handler that executes a given command on a device and returns the results. More...

#include "atca_status.h"
#include "calib_command.h"
#include "atca_device.h"
#include "atca_config.h"

Data Structures

struct  device_execution_time_t
 Structure to hold the device execution time and the opcode for the corresponding command. More...
 

Macros

#define ATCA_UNSUPPORTED_CMD   ((uint16_t)0xFFFF)
 
#define CALIB_SWI_FLAG_WAKE   0x00
 flag preceding a command
 
#define CALIB_SWI_FLAG_CMD   0x77
 flag preceding a command
 
#define CALIB_SWI_FLAG_TX   0x88
 flag requesting a response
 
#define CALIB_SWI_FLAG_IDLE   0xBB
 flag requesting to go into Idle mode
 
#define CALIB_SWI_FLAG_SLEEP   0xCC
 flag requesting to go into Sleep mode
 

Functions

ATCA_STATUS calib_get_execution_time (uint8_t opcode, ATCADevice device)
 return the typical execution time for the given command
 
ATCA_STATUS calib_execute_send (ATCADevice device, uint8_t word_address, uint8_t *txdata, uint16_t txlength)
 
ATCA_STATUS calib_execute_receive (ATCADevice device, uint8_t device_address, uint8_t *rxdata, uint16_t *rxlength)
 
ATCA_STATUS calib_execute_command (ATCAPacket *packet, ATCADevice device)
 Wakes up device, sends the packet, waits for command completion, receives response, and puts the device into the idle state.
 

Detailed Description

Defines an execution handler that executes a given command on a device and returns the results.

The basic flow is to wake the device, send the command, wait/poll for completion, and finally receives the response from the device and does basic checks before returning to caller.

This handler supports the ATSHA and ATECC device family.

Function Documentation

◆ calib_execute_command()

ATCA_STATUS calib_execute_command ( ATCAPacket packet,
ATCADevice  device 
)

Wakes up device, sends the packet, waits for command completion, receives response, and puts the device into the idle state.

Parameters
[in,out]packetAs input, the packet to be sent. As output, the data buffer in the packet structure will contain the response.
[in]deviceCryptoAuthentication device to send the command to.
Returns
ATCA_SUCCESS on success, otherwise an error code.

◆ calib_get_execution_time()

ATCA_STATUS calib_get_execution_time ( uint8_t  opcode,
ATCADevice  device 
)

return the typical execution time for the given command

Parameters
[in]opcodeOpcode value of the command
[in]ca_cmdCommand object for which the execution times are associated
Returns
ATCA_SUCCESS