Firmware SDK
|
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... | |
Driver for Atmel ATSHA204 CryptoAuthentication.
enum 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.
bool twr_atsha204_get_serial_number | ( | twr_atsha204_t * | self, |
void * | destination, | ||
size_t | size | ||
) |
Get serial number.
[in] | self | Instance |
[out] | destination | Pointer to destination object where device unique ID will be stored |
[in] | size | Size of destination object (in bytes) |
Definition at line 59 of file twr_atsha204.c.
void twr_atsha204_init | ( | twr_atsha204_t * | self, |
twr_i2c_channel_t | i2c_channel, | ||
uint8_t | i2c_address | ||
) |
Initialize ATSHA204 driver.
[in] | self | Instance |
[in] | i2c_channel | I2C channel |
[in] | i2c_address | I2C device address |
Definition at line 15 of file twr_atsha204.c.
Referenced by twr_radio_init().
bool twr_atsha204_is_ready | ( | twr_atsha204_t * | self | ) |
Check if is ready for commands.
[in] | self | Instance |
Definition at line 35 of file twr_atsha204.c.
Referenced by twr_atsha204_get_serial_number(), and twr_atsha204_read_serial_number().
bool twr_atsha204_read_serial_number | ( | twr_atsha204_t * | self | ) |
Reqeust for serial number.
[in] | self | Instance |
Definition at line 40 of file twr_atsha204.c.
Referenced by twr_radio_init().
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.
[in] | self | Instance |
[in] | event_handler | Function address |
[in] | event_param | Optional event parameter (can be NULL) |
Definition at line 29 of file twr_atsha204.c.
Referenced by twr_radio_init().