Dynamixel driver¶
Drivers for any device using dynamixel’s servomotors communication bus.
The bus is mainly used for servomotors, but a device can be anything : sensors, other actuators.
-
enum
@119
¶ - DYNAMIXEL_OK
- Success.
- DYNAMIXEL_TIMEOUT
- No response from the device.
- DYNAMIXEL_BUFFER_TOO_SMALL
- Buffer is too small for the message.
- DYNAMIXEL_INVALID_MESSAGE
- Invalid message received.
-
uint8_t
dynamixel_id_t
¶ device id type
-
uint16_t
dynamixel_addr_t
¶ register address type
-
int
dynamixel_ping
(uart_half_duplex_t * stream,dynamixel.h::dynamixel_id_t
id)¶ Send a PING message to a device.
Parameters
stream: the stream id: the device address Return values
- DYNAMIXEL_OK if a device answered
- DYNAMIXEL_TIMEOUT if the device did not answer
- DYNAMIXEL_BUFFER_TOO_SMALL if buffer is too small for the message
- DYNAMIXEL_INVALID_MESSAGE if an invalid message was received
-
void
dynamixel_init
(dynamixel_t * device, uart_half_duplex_t * stream,dynamixel.h::dynamixel_id_t
id)¶ Initialize a Dynamixel device.
Parameters
device: the Dynamixel device stream: the stream id: the device address
-
int
dynamixel_write8
(const dynamixel_t * device,dynamixel.h::dynamixel_addr_t
reg, uint8_t value)¶ Write to a device 8bits register.
Parameters
device: the Dynamixel device reg: the register to write value: the value to write Return values
- DYNAMIXEL_OK on success
- DYNAMIXEL_TIMEOUT if the device did not answer
- DYNAMIXEL_BUFFER_TOO_SMALL if buffer is too small for the message
- DYNAMIXEL_INVALID_MESSAGE if an invalid message was received
-
int
dynamixel_write16
(const dynamixel_t * device,dynamixel.h::dynamixel_addr_t
reg, uint16_t value)¶ Write to a device 16bits register.
Parameters
device: the Dynamixel device reg: the register to write value: the value to write Return values
- DYNAMIXEL_OK on success
- DYNAMIXEL_TIMEOUT if the device did not answer
- DYNAMIXEL_BUFFER_TOO_SMALL if buffer is too small for the message
- DYNAMIXEL_INVALID_MESSAGE if an invalid message was received
-
int
dynamixel_write
(const dynamixel_t * device,dynamixel.h::dynamixel_addr_t
reg, const uint8_t * data,msp430_types.h::size_t
length)¶ Write to a device address.
Parameters
device: the Dynamixel device reg: the address to start write data: the data to write length: the data length Return values
- DYNAMIXEL_OK on success
- DYNAMIXEL_TIMEOUT if the device did not answer
- DYNAMIXEL_BUFFER_TOO_SMALL if buffer is too small for the message
- DYNAMIXEL_INVALID_MESSAGE if an invalid message was received
-
int
dynamixel_read8
(const dynamixel_t * device,dynamixel.h::dynamixel_addr_t
reg, uint8_t * value)¶ Read from a device 8bits register.
Parameters
device: the Dynamixel device reg: the register to read value: the value to read Return values
- DYNAMIXEL_OK on success
- DYNAMIXEL_TIMEOUT if the device did not answer
- DYNAMIXEL_BUFFER_TOO_SMALL if buffer is too small for the message
- DYNAMIXEL_INVALID_MESSAGE if an invalid message was received
-
int
dynamixel_read16
(const dynamixel_t * device,dynamixel.h::dynamixel_addr_t
reg, uint16_t * value)¶ Read from a device 16bits register.
Parameters
device: the Dynamixel device reg: the register to read value: the value to read Return values
- DYNAMIXEL_OK on success
- DYNAMIXEL_TIMEOUT if the device did not answer
- DYNAMIXEL_BUFFER_TOO_SMALL if buffer is too small for the message
- DYNAMIXEL_INVALID_MESSAGE if an invalid message was received
-
int
dynamixel_read
(const dynamixel_t * device,dynamixel.h::dynamixel_addr_t
reg, uint8_t * data,msp430_types.h::size_t
length)¶ Read from a device address.
Parameters
device: the Dynamixel device reg: the address to start read data: the data buffer to fill length: the data length Return values
- DYNAMIXEL_OK on success
- DYNAMIXEL_TIMEOUT if the device did not answer
- DYNAMIXEL_BUFFER_TOO_SMALL if buffer is too small for the message
- DYNAMIXEL_INVALID_MESSAGE if an invalid message was received
-
struct
dynamixel_t
¶ Descriptor struct for a dynamixel device.
-
uart_half_duplex_t *
stream
¶ the stream used
-
dynamixel.h::dynamixel_id_t
id
¶ the device address
-
uart_half_duplex_t *