Interface definition for Feetech packet writer. More...
Interface definition for Feetech packet writer.
Definition in file feetech_writer.h.
Go to the source code of this file.
Data Structures | |
struct | feetech_writer_t |
Feetech packet writer struct. More... | |
void | feetech_writer_init (feetech_writer_t *writer, uint8_t *buffer, size_t buffer_max_size) |
Initialize the Feetech packet writer. More... | |
const uint8_t * | feetech_writer_get_data (const feetech_writer_t *writer) |
Get the data buffer to send. More... | |
size_t | feetech_writer_get_size (const feetech_writer_t *writer) |
Get the data buffer's size to send. More... | |
void | feetech_writer_response_make (feetech_writer_t *writer, uint8_t id, const uint8_t *buffer, size_t size) |
Build a response packet. More... | |
void | feetech_writer_ack_make (feetech_writer_t *writer, uint8_t id) |
Build an ack packet. More... | |
void | feetech_writer_ping_make (feetech_writer_t *writer, uint8_t id) |
Build a PING packet. More... | |
void | feetech_writer_write_make (feetech_writer_t *writer, uint8_t id, uint8_t reg, const uint8_t *buffer, size_t size) |
Build a WRITE packet. More... | |
void | feetech_writer_write8_make (feetech_writer_t *writer, uint8_t id, uint8_t reg, uint8_t value) |
Build a WRITE packet (8 bits) More... | |
void | feetech_writer_write16_make (feetech_writer_t *writer, uint8_t id, uint8_t reg, uint16_t value) |
Build a WRITE packet (16 bits) More... | |
void | feetech_writer_read_make (feetech_writer_t *writer, uint8_t id, uint8_t reg, size_t size) |
Build a READ packet. More... | |
void | feetech_writer_sync_write_begin (feetech_writer_t *writer, uint8_t reg, size_t size) |
Begin to build a SYNC_WRITE packet. More... | |
void | feetech_writer_sync_write_end (feetech_writer_t *writer) |
End the building of a SYNC_WRITE packet. More... | |
void | feetech_writer_sync_write_add (feetech_writer_t *writer, uint8_t id, const uint8_t *buffer, size_t size) |
Add an item to a SYNC_WRITE packet. More... | |
void | feetech_writer_sync_write_add_8bits (feetech_writer_t *writer, uint8_t id, uint8_t value) |
Add an item to a SYNC_WRITE packet (8 bits) More... | |
void | feetech_writer_sync_write_add_16bits (feetech_writer_t *writer, uint8_t id, uint16_t value) |
Add an item to a SYNC_WRITE packet (16 bits) More... | |
void feetech_writer_ack_make | ( | feetech_writer_t * | writer, |
uint8_t | id | ||
) |
Build an ack packet.
[out] | writer | the packet writer |
[in] | id | the responder's id |
const uint8_t* feetech_writer_get_data | ( | const feetech_writer_t * | writer | ) |
Get the data buffer to send.
[out] | writer | the packet writer |
size_t feetech_writer_get_size | ( | const feetech_writer_t * | writer | ) |
Get the data buffer's size to send.
[out] | writer | the packet writer |
void feetech_writer_init | ( | feetech_writer_t * | writer, |
uint8_t * | buffer, | ||
size_t | buffer_max_size | ||
) |
Initialize the Feetech packet writer.
[out] | writer | the packet writer |
[in] | buffer | the buffer used to store data |
[in] | buffer_max_size | the size of the buffer (= maximum packet size) |
void feetech_writer_ping_make | ( | feetech_writer_t * | writer, |
uint8_t | id | ||
) |
Build a PING packet.
[out] | writer | the packet writer |
[in] | id | the destination's id |
void feetech_writer_read_make | ( | feetech_writer_t * | writer, |
uint8_t | id, | ||
uint8_t | reg, | ||
size_t | size | ||
) |
Build a READ packet.
[out] | writer | the packet writer |
[in] | id | the destination's id |
[in] | reg | the register to read |
[in] | size | the size to read |
void feetech_writer_response_make | ( | feetech_writer_t * | writer, |
uint8_t | id, | ||
const uint8_t * | buffer, | ||
size_t | size | ||
) |
Build a response packet.
[out] | writer | the packet writer |
[in] | id | the responder's id |
[in] | buffer | the response data |
[in] | size | the response size |
void feetech_writer_sync_write_add | ( | feetech_writer_t * | writer, |
uint8_t | id, | ||
const uint8_t * | buffer, | ||
size_t | size | ||
) |
Add an item to a SYNC_WRITE packet.
[out] | writer | the packet writer |
[in] | id | the destination's id |
[in] | buffer | the data buffer to write |
[in] | size | the data buffer's size |
void feetech_writer_sync_write_add_16bits | ( | feetech_writer_t * | writer, |
uint8_t | id, | ||
uint16_t | value | ||
) |
Add an item to a SYNC_WRITE packet (16 bits)
[out] | writer | the packet writer |
[in] | id | the destination's id |
[in] | value | the value to write |
void feetech_writer_sync_write_add_8bits | ( | feetech_writer_t * | writer, |
uint8_t | id, | ||
uint8_t | value | ||
) |
Add an item to a SYNC_WRITE packet (8 bits)
[out] | writer | the packet writer |
[in] | id | the destination's id |
[in] | value | the value to write |
void feetech_writer_sync_write_begin | ( | feetech_writer_t * | writer, |
uint8_t | reg, | ||
size_t | size | ||
) |
Begin to build a SYNC_WRITE packet.
[out] | writer | the packet writer |
[in] | reg | the register to write in |
[in] | size | the data buffer's size |
void feetech_writer_sync_write_end | ( | feetech_writer_t * | writer | ) |
End the building of a SYNC_WRITE packet.
[out] | writer | the packet writer |
void feetech_writer_write16_make | ( | feetech_writer_t * | writer, |
uint8_t | id, | ||
uint8_t | reg, | ||
uint16_t | value | ||
) |
Build a WRITE packet (16 bits)
[out] | writer | the packet writer |
[in] | id | the destination's id |
[in] | reg | the register to write in |
[in] | value | the value to write in the register |
void feetech_writer_write8_make | ( | feetech_writer_t * | writer, |
uint8_t | id, | ||
uint8_t | reg, | ||
uint8_t | value | ||
) |
Build a WRITE packet (8 bits)
[out] | writer | the packet writer |
[in] | id | the destination's id |
[in] | reg | the register to write in |
[in] | value | the value to write in the register |
void feetech_writer_write_make | ( | feetech_writer_t * | writer, |
uint8_t | id, | ||
uint8_t | reg, | ||
const uint8_t * | buffer, | ||
size_t | size | ||
) |
Build a WRITE packet.
[out] | writer | the packet writer |
[in] | id | the destination's id |
[in] | reg | the register to write in |
[in] | buffer | the data buffer to write |
[in] | size | the data buffer's size |