Interface for implementing Joybus targets (controllers).
More...
|
| #define | JOYBUS_TARGET(target) |
| | Macro to cast a concrete Joybus target instance to a generic Joybus target instance.
|
|
| typedef void(* | joybus_target_response_cb_t) (const uint8_t *response, uint8_t len, void *user_data) |
| | Callback type for sending responses from target command handlers.
|
Interface for implementing Joybus targets (controllers).
◆ JOYBUS_TARGET
| #define JOYBUS_TARGET |
( |
| target | ) |
|
Value:
A Joybus target, a device on the Joybus that can respond to commands.
Definition target.h:45
Macro to cast a concrete Joybus target instance to a generic Joybus target instance.
◆ joybus_target_response_cb_t
| typedef void(* joybus_target_response_cb_t) (const uint8_t *response, uint8_t len, void *user_data) |
Callback type for sending responses from target command handlers.
- Parameters
-
| response | the response data to send |
| len | the length of the response data |
| user_data | user data passed to the command handler |
◆ joybus_target_byte_received()
Handle a received command byte for a Joybus target.
- Parameters
-
| target | the target to handle the command |
| command | the command buffer |
| byte_idx | the index of the byte that was just received |
| send_response | a callback function to send the response |
| user_data | user data to pass to the response callback |
- Returns
- positive number of bytes still expected, 0 if no more bytes expected, negative error code on failure