Firmware SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
bc_atsha204

Driver for Atmel ATSHA204 CryptoAuthentication. More...

Typedefs

typedef struct bc_atsha204_t bc_atsha204_t
 ATSHA204 instance.
 

Enumerations

enum  bc_atsha204_event_t {
  BC_ATSHA204_EVENT_ERROR = 0,
  BC_ATSHA204_EVENT_REVISION_NUMBER = 1,
  BC_ATSHA204_EVENT_SERIAL_NUMBER = 2
}
 

Functions

void bc_atsha204_init (bc_atsha204_t *self, bc_i2c_channel_t i2c_channel, uint8_t i2c_address)
 Initialize ATSHA204 driver. More...
 
void bc_atsha204_set_event_handler (bc_atsha204_t *self, void(*event_handler)(bc_atsha204_t *, bc_atsha204_event_t, void *), void *event_param)
 Set callback function. More...
 
bool bc_atsha204_is_ready (bc_atsha204_t *self)
 Check if is ready for commands. More...
 
bool bc_atsha204_read_serial_number (bc_atsha204_t *self)
 Reqeust for serial number. More...
 
bool bc_atsha204_get_serial_number (bc_atsha204_t *self, void *destination, size_t size)
 Get serial number. More...
 

Detailed Description

Driver for Atmel ATSHA204 CryptoAuthentication.

Enumeration Type Documentation

Enumerator
BC_ATSHA204_EVENT_ERROR 

Error event.

BC_ATSHA204_EVENT_REVISION_NUMBER 

Event revision number is available.

BC_ATSHA204_EVENT_SERIAL_NUMBER 

Event serial number is available.

Definition at line 14 of file bc_atsha204.h.

Function Documentation

bool bc_atsha204_get_serial_number ( bc_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 bc_atsha204.c.

Here is the call graph for this function:

void bc_atsha204_init ( bc_atsha204_t self,
bc_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 bc_atsha204.c.

Referenced by bc_radio_init().

Here is the call graph for this function:

Here is the caller graph for this function:

bool bc_atsha204_is_ready ( bc_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 bc_atsha204.c.

Referenced by bc_atsha204_get_serial_number(), and bc_atsha204_read_serial_number().

Here is the caller graph for this function:

bool bc_atsha204_read_serial_number ( bc_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 bc_atsha204.c.

Referenced by bc_radio_init().

Here is the call graph for this function:

Here is the caller graph for this function:

void bc_atsha204_set_event_handler ( bc_atsha204_t self,
void(*)(bc_atsha204_t *, bc_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 bc_atsha204.c.

Referenced by bc_radio_init().

Here is the caller graph for this function: