Interface definition for Dynamixel packet writer.
More...
Interface definition for Dynamixel packet writer.
- Author
- Loïc Dauphin loic..nosp@m.daup.nosp@m.hin@i.nosp@m.nria.nosp@m..fr
Definition in file dynamixel_writer.h.
#include "dynamixel_protocol.h"
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
Go to the source code of this file.
|
struct | dynamixel_writer_t |
| Dynamixel packet writer struct. More...
|
|
void | dynamixel_writer_init (dynamixel_writer_t *writer, uint8_t *buffer, size_t limit) |
| Initialize the Dynamixel packet writer.
|
|
const uint8_t * | dynamixel_writer_get_data (const dynamixel_writer_t *writer) |
| Get the data buffer to send.
|
|
size_t | dynamixel_writer_get_size (const dynamixel_writer_t *writer) |
| Get the data buffer's size to send.
|
|
void | dynamixel_writer_ping_make (dynamixel_writer_t *writer, uint8_t id) |
| Build a PING packet.
|
|
void | dynamixel_writer_write_make (dynamixel_writer_t *writer, uint8_t id, uint16_t reg, const uint8_t *buffer, size_t size) |
| Build a WRITE packet.
|
|
void | dynamixel_writer_read_make (dynamixel_writer_t *writer, uint8_t id, uint16_t reg, size_t size) |
| Build a READ packet.
|
|
◆ dynamixel_writer_get_data()
Get the data buffer to send.
- Parameters
-
[out] | writer | the packet writer |
- Returns
- the beginning address of the buffer
◆ dynamixel_writer_get_size()
Get the data buffer's size to send.
- Parameters
-
[out] | writer | the packet writer |
- Returns
- the buffer's size
◆ dynamixel_writer_init()
void dynamixel_writer_init |
( |
dynamixel_writer_t * |
writer, |
|
|
uint8_t * |
buffer, |
|
|
size_t |
limit |
|
) |
| |
Initialize the Dynamixel packet writer.
- Parameters
-
[out] | writer | the packet writer |
[in] | buffer | the buffer used to store data |
[in] | limit | the size of the buffer (= maximum packet size) |
◆ dynamixel_writer_ping_make()
Build a PING packet.
- Parameters
-
[out] | writer | the packet writer |
[in] | id | the destination's id |
◆ dynamixel_writer_read_make()
void dynamixel_writer_read_make |
( |
dynamixel_writer_t * |
writer, |
|
|
uint8_t |
id, |
|
|
uint16_t |
reg, |
|
|
size_t |
size |
|
) |
| |
Build a READ packet.
- Parameters
-
[out] | writer | the packet writer |
[in] | id | the destination's id |
[in] | reg | the register to read |
[in] | size | the size to read |
◆ dynamixel_writer_write_make()
void dynamixel_writer_write_make |
( |
dynamixel_writer_t * |
writer, |
|
|
uint8_t |
id, |
|
|
uint16_t |
reg, |
|
|
const uint8_t * |
buffer, |
|
|
size_t |
size |
|
) |
| |
Build a WRITE packet.
- Parameters
-
[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 |