libjoybus
Joybus implementation for 32-bit MCUs
Loading...
Searching...
No Matches
joybus_target_api Struct Reference

API for implementing a Joybus target. More...

#include <target.h>

Data Fields

int(* byte_received )(struct joybus_target *target, const uint8_t *command, uint8_t byte_idx, joybus_target_response_cb send_response, void *user_data)
 Handle a received command byte.

Detailed Description

API for implementing a Joybus target.

Field Documentation

◆ byte_received

int(* joybus_target_api::byte_received) (struct joybus_target *target, const uint8_t *command, uint8_t byte_idx, joybus_target_response_cb send_response, void *user_data)

Handle a received command byte.

Parameters
targetthe target to handle the command
commandthe command buffer
byte_idxthe index of the byte that was just received
send_responsea callback function to send the response
user_datauser data to pass to the response callback
Returns
positive number of bytes still expected, 0 if no more bytes expected, a negative joybus_error on failure

The documentation for this struct was generated from the following file: