MySensors Library & Examples
2.3.2
|
atsha204Class class
Definition at line 303 of file sha204_library.h.
#include <sha204_library.h>
Public Member Functions | |
atsha204Class (uint8_t pin) | |
Constructor. More... | |
uint8_t | sha204c_wakeup (uint8_t *response) |
Wake up device. More... | |
uint8_t | sha204c_send_and_receive (uint8_t *tx_buffer, uint8_t rx_size, uint8_t *rx_buffer, uint8_t execution_delay, uint8_t execution_timeout) |
Send and receive data. More... | |
uint8_t | sha204c_resync (uint8_t size, uint8_t *response) |
Resyncronize the device. More... | |
uint8_t | sha204m_random (uint8_t *tx_buffer, uint8_t *rx_buffer, uint8_t mode) |
Generate random data. More... | |
uint8_t | sha204m_dev_rev (uint8_t *tx_buffer, uint8_t *rx_buffer) |
Read device revision. More... | |
uint8_t | sha204m_read (uint8_t *tx_buffer, uint8_t *rx_buffer, uint8_t zone, uint16_t address) |
Read from device. More... | |
uint8_t | sha204m_execute (uint8_t op_code, uint8_t param1, uint16_t param2, uint8_t datalen1, uint8_t *data1, uint8_t datalen2, uint8_t *data2, uint8_t datalen3, uint8_t *data3, uint8_t tx_size, uint8_t *tx_buffer, uint8_t rx_size, uint8_t *rx_buffer) |
Execute command. More... | |
uint8_t | sha204m_check_parameters (uint8_t op_code, uint8_t param1, uint16_t param2, uint8_t datalen1, uint8_t *data1, uint8_t datalen2, uint8_t *data2, uint8_t datalen3, uint8_t *data3, uint8_t tx_size, uint8_t *tx_buffer, uint8_t rx_size, uint8_t *rx_buffer) |
Validate parameters. More... | |
uint8_t | getSerialNumber (uint8_t *response) |
Gets the serial number. More... | |
uint16_t | calculateAndUpdateCrc (uint8_t length, uint8_t *data, uint16_t current_crc) |
Calculates and update crc. More... | |
|
explicit |
Constructor.
[in] | pin | The pin to use for communication |
uint16_t atsha204Class::calculateAndUpdateCrc | ( | uint8_t | length, |
uint8_t * | data, | ||
uint16_t | current_crc | ||
) |
Calculates and update crc.
[in] | length | The length |
data | The data | |
[in] | current_crc | The current crc |
uint8_t atsha204Class::getSerialNumber | ( | uint8_t * | response | ) |
Gets the serial number.
response | The response |
uint8_t atsha204Class::sha204c_resync | ( | uint8_t | size, |
uint8_t * | response | ||
) |
Resyncronize the device.
[in] | size | The size of the response buffer |
response | The response |
uint8_t atsha204Class::sha204c_send_and_receive | ( | uint8_t * | tx_buffer, |
uint8_t | rx_size, | ||
uint8_t * | rx_buffer, | ||
uint8_t | execution_delay, | ||
uint8_t | execution_timeout | ||
) |
Send and receive data.
tx_buffer | The transmit buffer | |
[in] | rx_size | The receive size |
rx_buffer | The receive buffer | |
[in] | execution_delay | The execution delay |
[in] | execution_timeout | The execution timeout |
uint8_t atsha204Class::sha204c_wakeup | ( | uint8_t * | response | ) |
Wake up device.
response | The response from the device |
uint8_t atsha204Class::sha204m_check_parameters | ( | uint8_t | op_code, |
uint8_t | param1, | ||
uint16_t | param2, | ||
uint8_t | datalen1, | ||
uint8_t * | data1, | ||
uint8_t | datalen2, | ||
uint8_t * | data2, | ||
uint8_t | datalen3, | ||
uint8_t * | data3, | ||
uint8_t | tx_size, | ||
uint8_t * | tx_buffer, | ||
uint8_t | rx_size, | ||
uint8_t * | rx_buffer | ||
) |
Validate parameters.
[in] | op_code | The operation code |
[in] | param1 | The parameter 1 |
[in] | param2 | The parameter 2 |
[in] | datalen1 | The datalen 1 |
data1 | The data 1 | |
[in] | datalen2 | The datalen 2 |
data2 | The data 2 | |
[in] | datalen3 | The datalen 3 |
data3 | The data 3 | |
[in] | tx_size | The transmit size |
tx_buffer | The transmit buffer | |
[in] | rx_size | The receive size |
rx_buffer | The receive buffer |
uint8_t atsha204Class::sha204m_dev_rev | ( | uint8_t * | tx_buffer, |
uint8_t * | rx_buffer | ||
) |
Read device revision.
tx_buffer | The transmit buffer |
rx_buffer | The receive buffer |
uint8_t atsha204Class::sha204m_execute | ( | uint8_t | op_code, |
uint8_t | param1, | ||
uint16_t | param2, | ||
uint8_t | datalen1, | ||
uint8_t * | data1, | ||
uint8_t | datalen2, | ||
uint8_t * | data2, | ||
uint8_t | datalen3, | ||
uint8_t * | data3, | ||
uint8_t | tx_size, | ||
uint8_t * | tx_buffer, | ||
uint8_t | rx_size, | ||
uint8_t * | rx_buffer | ||
) |
Execute command.
[in] | op_code | The operation code |
[in] | param1 | The parameter 1 |
[in] | param2 | The parameter 2 |
[in] | datalen1 | The datalen 1 |
data1 | The data 1 | |
[in] | datalen2 | The datalen 2 |
data2 | The data 2 | |
[in] | datalen3 | The datalen 3 |
data3 | The data 3 | |
[in] | tx_size | The transmit size |
tx_buffer | The transmit buffer | |
[in] | rx_size | The receive size |
rx_buffer | The receive buffer |
uint8_t atsha204Class::sha204m_random | ( | uint8_t * | tx_buffer, |
uint8_t * | rx_buffer, | ||
uint8_t | mode | ||
) |
Generate random data.
tx_buffer | The transmit buffer | |
rx_buffer | The receive buffer | |
[in] | mode | The mode |
uint8_t atsha204Class::sha204m_read | ( | uint8_t * | tx_buffer, |
uint8_t * | rx_buffer, | ||
uint8_t | zone, | ||
uint16_t | address | ||
) |
Read from device.
tx_buffer | The transmit buffer | |
rx_buffer | The receive buffer | |
[in] | zone | The zone |
[in] | address | The address |