Go to the documentation of this file.
4 #ifndef ACC_REG_PROTOCOL_H_
5 #define ACC_REG_PROTOCOL_H_
11 #define ACC_REG_PROTOCOL_ADDRESS_LENGTH (2U)
12 #define ACC_REG_PROTOCOL_REGDATA_LENGTH (4U)
14 #define ACC_REG_ERROR_FLAG_PROTOCOL_STATE_ERROR (1U << 0U)
15 #define ACC_REG_ERROR_FLAG_PACKET_LENGTH_ERROR (1U << 1U)
16 #define ACC_REG_ERROR_FLAG_ADDRESS_ERROR (1U << 2U)
17 #define ACC_REG_ERROR_FLAG_WRITE_FAILED (1U << 3U)
18 #define ACC_REG_ERROR_FLAG_WRITE_TO_READ_ONLY (1U << 4U)
uint32_t acc_reg_protocol_float_to_uint32_milli(float value)
Convert 1000 * float to uint32.
void acc_reg_protocol_data_in(uint8_t *buffer, size_t data_in_length)
Handle data input to the register protocol.
uint32_t acc_reg_protocol_get_error_flags(void)
Get the error flags for the register protocol.
acc_reg_write_func_t * write
bool() acc_reg_write_func_t(const uint32_t data)
Function to writes a register.
void acc_reg_protocol_setup(const acc_reg_protocol_t *protocol_struct, uint16_t register_count)
Setup register protocol.
bool acc_reg_protocol_data_nack(void)
Should protocol NACK the next data.
int32_t acc_reg_protocol_float_to_int32_milli(float value)
Convert 1000 * float to int32.
float acc_reg_protocol_uint32_milli_to_float(uint32_t value)
Convert uint32 / 1000 to float.
float acc_reg_protocol_int32_milli_to_float(int32_t value)
Convert int32 / 1000 to float.
Register access mode and functions struct.
void acc_reg_protocol_data_out(uint8_t *buffer, size_t data_out_length)
Handle data input from the register protocol.
void acc_reg_protocol_reset(void)
Reset register protocol.
void() acc_reg_read_func_t(uint32_t *data)
Function to read a register.
acc_reg_read_func_t * read