Core2 for AWS IoT EduKit BSP 1.5.1
Macros | Functions
atecc608.h File Reference

Functions for the ATECC608 Trust&GO secure element. More...

#include "stdio.h"

Go to the source code of this file.

Macros

#define ATECC608_I2C_PORT   I2C_NUM_1
 I2C port the ATECC608 uses to communicate with the ESP32-D0WD main MCU. More...
 

Functions

ATCA_STATUS Atecc608_Init ()
 Initializes the ATECC608 Trust&GO on the I2C bus. More...
 
ATCA_STATUS Atecc608_GetSerialString (char *sn)
 Retrieves the unique serial number from the ATECC608. More...
 

Detailed Description

Functions for the ATECC608 Trust&GO secure element.

Macro Definition Documentation

◆ ATECC608_I2C_PORT

#define ATECC608_I2C_PORT   I2C_NUM_1

I2C port the ATECC608 uses to communicate with the ESP32-D0WD main MCU.

Function Documentation

◆ Atecc608_Init()

ATCA_STATUS Atecc608_Init ( )

Initializes the ATECC608 Trust&GO on the I2C bus.

Note
Must initialize the ATECC608 before performing any operations on the secure element.
The Core2ForAWS_Init() calls this function when the hardware feature is enabled.
Returns
Status of initialization. 0 is success. View the list of possible return status codes here.

◆ Atecc608_GetSerialString()

ATCA_STATUS Atecc608_GetSerialString ( char *  sn)

Retrieves the unique serial number from the ATECC608.

The serial number of the ATECC608 is stored as a uint8 with the length defined in the macro ATCA_SERIAL_NUM_SIZE. It might take a little time to wake the secure element and retrieve the serial number.

Example:

Create a variable named clientId with enough dynamically allocated memory to store the ATECC608 serial number.

char * clientId = malloc(ATCA_SERIAL_NUM_SIZE * 2 + 1); // ATCA_SERIAL_NUM_SIZE returns the 8-bit serial number size.
// Need double for 16-bit and one more for the null terminator
// for the end of the char.
ATCA_STATUS ret = Atecc608_GetSerialString(clientId);
ATCA_STATUS Atecc608_GetSerialString(char *sn)
Retrieves the unique serial number from the ATECC608.
Definition: atecc608.c:56
Parameters
[out]snThe unique serial number of the chip.
Returns
Status of serial number retrieval operation. 0 is success. View the list of possible return status codes here.