Firmware SDK
twr_atsha204

Driver for Atmel ATSHA204 CryptoAuthentication. More...

Typedefs

typedef struct twr_atsha204_t twr_atsha204_t
 ATSHA204 instance.
 

Enumerations

enum  twr_atsha204_event_t {
  TWR_ATSHA204_EVENT_ERROR = 0,
  TWR_ATSHA204_EVENT_REVISION_NUMBER = 1,
  TWR_ATSHA204_EVENT_SERIAL_NUMBER = 2
}
 

Functions

void twr_atsha204_init (twr_atsha204_t *self, twr_i2c_channel_t i2c_channel, uint8_t i2c_address)
 Initialize ATSHA204 driver. More...
 
void twr_atsha204_set_event_handler (twr_atsha204_t *self, void(*event_handler)(twr_atsha204_t *, twr_atsha204_event_t, void *), void *event_param)
 Set callback function. More...
 
bool twr_atsha204_is_ready (twr_atsha204_t *self)
 Check if is ready for commands. More...
 
bool twr_atsha204_read_serial_number (twr_atsha204_t *self)
 Reqeust for serial number. More...
 
bool twr_atsha204_get_serial_number (twr_atsha204_t *self, void *destination, size_t size)
 Get serial number. More...
 

Detailed Description

Driver for Atmel ATSHA204 CryptoAuthentication.

Enumeration Type Documentation

◆ twr_atsha204_event_t

Enumerator
TWR_ATSHA204_EVENT_ERROR 

Error event.

TWR_ATSHA204_EVENT_REVISION_NUMBER 

Event revision number is available.

TWR_ATSHA204_EVENT_SERIAL_NUMBER 

Event serial number is available.

Definition at line 14 of file twr_atsha204.h.

Function Documentation

◆ twr_atsha204_get_serial_number()

bool twr_atsha204_get_serial_number ( twr_atsha204_t self,
void *  destination,
size_t  size 
)

Get serial number.

Parameters
[in]selfInstance
[out]destinationPointer to destination object where device unique ID will be stored
[in]sizeSize of destination object (in bytes)
Returns
true When value is valid
false When value is invalid

Definition at line 59 of file twr_atsha204.c.

Here is the call graph for this function:

◆ twr_atsha204_init()

void twr_atsha204_init ( twr_atsha204_t self,
twr_i2c_channel_t  i2c_channel,
uint8_t  i2c_address 
)

Initialize ATSHA204 driver.

Parameters
[in]selfInstance
[in]i2c_channelI2C channel
[in]i2c_addressI2C device address

Definition at line 15 of file twr_atsha204.c.

Referenced by twr_radio_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ twr_atsha204_is_ready()

bool twr_atsha204_is_ready ( twr_atsha204_t self)

Check if is ready for commands.

Parameters
[in]selfInstance
Returns
true If ready
false If not ready

Definition at line 35 of file twr_atsha204.c.

Referenced by twr_atsha204_get_serial_number(), and twr_atsha204_read_serial_number().

Here is the caller graph for this function:

◆ twr_atsha204_read_serial_number()

bool twr_atsha204_read_serial_number ( twr_atsha204_t self)

Reqeust for serial number.

Parameters
[in]selfInstance
Returns
true On success
False When other command is in progress

Definition at line 40 of file twr_atsha204.c.

Referenced by twr_radio_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ twr_atsha204_set_event_handler()

void twr_atsha204_set_event_handler ( twr_atsha204_t self,
void(*)(twr_atsha204_t *, twr_atsha204_event_t, void *)  event_handler,
void *  event_param 
)

Set callback function.

Parameters
[in]selfInstance
[in]event_handlerFunction address
[in]event_paramOptional event parameter (can be NULL)

Definition at line 29 of file twr_atsha204.c.

Referenced by twr_radio_init().

Here is the caller graph for this function: