|
|
sts_result_t | STS_Bus_Init (sts_bus_t *bus, void *port_handle, sts_hal_transmit_t tx_func, sts_hal_receive_t rx_func) |
| | Initializes the hardware bus abstraction.
|
| |
| sts_result_t | STS_Servo_Init (sts_servo_t *servo, sts_bus_t *bus, uint8_t id) |
| | Initializes a servo handle.
|
| |
| sts_result_t | STS_Bus_Transmit (sts_bus_t *bus, const uint8_t *data, uint16_t len) |
| | Safe wrapper for HAL transmission.
|
| |
| sts_result_t | STS_Bus_Receive (sts_bus_t *bus, uint8_t *data, uint16_t len, uint32_t timeout) |
| | Safe wrapper for HAL reception.
|
| |
| sts_result_t | STS_Bus_FlushRx (sts_bus_t *bus) |
| | Drains stale bytes from the RX buffer between transaction retries. No-op if the port did not register a flush_rx function.
|
| |
| sts_result_t | STS_servo_ping (sts_servo_t *servo) |
| | Pings the servo to check if it's online.
|
| |
|
sts_result_t | STS_Write8 (sts_servo_t *servo, uint8_t reg_addr, uint8_t value) |
| | Writes a single byte (8-bit) to a specific servo register.
|
| |
|
sts_result_t | STS_Write16 (sts_servo_t *servo, uint8_t reg_addr, uint16_t value) |
| | Writes a word (16-bit) to a specific servo register (Little-Endian).
|
| |
|
sts_result_t | STS_Read8 (sts_servo_t *servo, uint8_t reg_addr, uint8_t *value_out) |
| | Reads a single byte (8-bit) from a specific servo register.
|
| |
|
sts_result_t | STS_Read16 (sts_servo_t *servo, uint8_t reg_addr, uint16_t *value_out) |
| | Reads a word (16-bit) from a specific servo register (Little-Endian).
|
| |
: STS Service Layer and Hardware Abstraction Definitions
- Author
- : Grisham Balloo
- Date
- : 2026-03-20
Defines the Hardware Abstraction Layer and public API for the Feetech STS protocol service layer. Uses an injected-dependency model (function pointers) to remain agnostic of the underlying MCU or UART implementation.
Exposes the bus handle, servo handle, HAL typedefs, register access primitives, and the ping service. The internal sts_cmd_t struct is conditionally visible for white-box unit testing via STATIC_TESTABLE.
- Attention
- Copyright (c) 2026 Grisham Balloo. All rights reserved.