Functions | |
void | sha204c_calculate_crc (uint8_t length, uint8_t *data, uint8_t *crc) |
This function calculates CRC. More... | |
uint8_t | sha204c_check_crc (uint8_t *response) |
< definitions and declarations for the Communication module More... | |
uint8_t | sha204c_resync (uint8_t size, uint8_t *response) |
This function re-synchronizes communication. More... | |
uint8_t | sha204c_send_and_receive (struct sha204_send_and_receive_parameters *args) |
This function runs a communication sequence: Append CRC to tx buffer, send command, delay, and verify response after receiving it. More... | |
uint8_t | sha204c_wakeup (uint8_t *response) |
This function wakes up a SHA204 device and receives a response. More... | |
uint8_t sha204c_check_crc | ( | uint8_t * | response | ) |
< definitions and declarations for the Communication module
This function checks the consistency of a response.
< definitions for timer functions < declarations of function return codes
[in] | response | pointer to response |
References SHA204_BAD_CRC, SHA204_BUFFER_POS_COUNT, SHA204_CRC_SIZE, SHA204_SUCCESS, and sha204c_calculate_crc().
Referenced by sha204c_send_and_receive().
uint8_t sha204c_resync | ( | uint8_t | size, |
uint8_t * | response | ||
) |
This function re-synchronizes communication.
Be aware that succeeding only after waking up the device could mean that it had gone to sleep and lost its TempKey in the process.
Re-synchronizing communication is done in a maximum of three steps:
[in] | size | size of response buffer |
[out] | response | pointer to Wake-up response buffer |
References SHA204_RESYNC_WITH_WAKEUP, SHA204_SUCCESS, sha204c_wakeup(), sha204p_resync(), and sha204p_sleep().
Referenced by sha204c_send_and_receive().