Drivers for any device using feetech's servomotors communication bus.
More...
Drivers for any device using feetech's servomotors communication bus.
The bus is mainly used for servomotors, but a device can be anything : sensors, other actuators.
|
int | feetech_ping (uart_half_duplex_t *stream, feetech_id_t id) |
| Send a PING message to a device.
|
|
void | feetech_init (feetech_t *device, uart_half_duplex_t *stream, feetech_id_t id) |
| Initialize a Feetech device.
|
|
int | feetech_write8 (const feetech_t *device, feetech_addr_t addr, uint8_t value) |
| Write to a device 8bits address.
|
|
int | feetech_write16 (const feetech_t *device, feetech_addr_t addr, uint16_t value) |
| Write to a device 16bits address.
|
|
int | feetech_write (const feetech_t *device, feetech_addr_t addr, const uint8_t *data, size_t length) |
| Write to a device address.
|
|
int | feetech_read8 (const feetech_t *device, feetech_addr_t addr, uint8_t *value) |
| Read from a device 8bits address.
|
|
int | feetech_read16 (const feetech_t *device, feetech_addr_t addr, uint16_t *value) |
| Read from a device 16bits address.
|
|
int | feetech_read (const feetech_t *device, feetech_addr_t addr, uint8_t *data, size_t length) |
| Read from a device address.
|
|
◆ feetech_addr_t
◆ feetech_id_t
device id type
Definition at line 36 of file feetech.h.
◆ anonymous enum
Possible feetech return values.
Enumerator |
---|
FEETECH_OK | Success.
|
FEETECH_TIMEOUT | No response from the device.
|
FEETECH_BUFFER_TOO_SMALL | Buffer is too small for the message.
|
FEETECH_INVALID_MESSAGE | Invalid message received.
|
Definition at line 50 of file feetech.h.
◆ feetech_init()
Initialize a Feetech device.
- Parameters
-
[out] | device | the Feetech device |
[in] | stream | the stream |
[in] | id | the device address |
◆ feetech_ping()
Send a PING message to a device.
- Parameters
-
[in] | stream | the stream |
[in] | id | the device address |
- Returns
- FEETECH_OK if a device answered
-
FEETECH_TIMEOUT if the device did not answer
-
FEETECH_BUFFER_TOO_SMALL if buffer is too small for the message
-
FEETECH_INVALID_MESSAGE if an invalid message was received
◆ feetech_read()
Read from a device address.
- Parameters
-
[in] | device | the Feetech device |
[in] | addr | the address to start read |
[out] | data | the data buffer to fill |
[in] | length | the data length |
- Returns
- FEETECH_OK on success
-
FEETECH_TIMEOUT if the device did not answer
-
FEETECH_BUFFER_TOO_SMALL if buffer is too small for the message
-
FEETECH_INVALID_MESSAGE if an invalid message was received
◆ feetech_read16()
Read from a device 16bits address.
- Parameters
-
[in] | device | the Feetech device |
[in] | addr | the address to read |
[out] | value | the value to read |
- Returns
- FEETECH_OK on success
-
FEETECH_TIMEOUT if the device did not answer
-
FEETECH_BUFFER_TOO_SMALL if buffer is too small for the message
-
FEETECH_INVALID_MESSAGE if an invalid message was received
◆ feetech_read8()
Read from a device 8bits address.
- Parameters
-
[in] | device | the Feetech device |
[in] | addr | the address to read |
[out] | value | the value to read |
- Returns
- FEETECH_OK on success
-
FEETECH_TIMEOUT if the device did not answer
-
FEETECH_BUFFER_TOO_SMALL if buffer is too small for the message
-
FEETECH_INVALID_MESSAGE if an invalid message was received
◆ feetech_write()
Write to a device address.
- Parameters
-
[in] | device | the Feetech device |
[in] | addr | the address to start write |
[in] | data | the data to write |
[in] | length | the data length |
- Returns
- FEETECH_OK on success
-
FEETECH_TIMEOUT if the device did not answer
-
FEETECH_BUFFER_TOO_SMALL if buffer is too small for the message
-
FEETECH_INVALID_MESSAGE if an invalid message was received
◆ feetech_write16()
Write to a device 16bits address.
- Parameters
-
[in] | device | the Feetech device |
[in] | addr | the address to write |
[in] | value | the value to write |
- Returns
- FEETECH_OK on success
-
FEETECH_TIMEOUT if the device did not answer
-
FEETECH_BUFFER_TOO_SMALL if buffer is too small for the message
-
FEETECH_INVALID_MESSAGE if an invalid message was received
◆ feetech_write8()
Write to a device 8bits address.
- Parameters
-
[in] | device | the Feetech device |
[in] | addr | the address to write |
[in] | value | the value to write |
- Returns
- FEETECH_OK on success
-
FEETECH_TIMEOUT if the device did not answer
-
FEETECH_BUFFER_TOO_SMALL if buffer is too small for the message
-
FEETECH_INVALID_MESSAGE if an invalid message was received