libjoybus
Joybus implementation for 32-bit MCUs
Loading...
Searching...
No Matches
Common Commands

Functions

int joybus_identify (struct joybus *bus, struct joybus_id *response)
 Identify the target device attached to the Joybus.
int joybus_identify_async (struct joybus *bus, struct joybus_id *response, joybus_transfer_cb callback, void *user_data)
 Identify the target device attached to the Joybus, asynchronously.
int joybus_reset (struct joybus *bus, struct joybus_id *response)
 Reset the target device attached to the Joybus.
int joybus_reset_async (struct joybus *bus, struct joybus_id *response, joybus_transfer_cb callback, void *user_data)
 Reset the target device attached to the Joybus, asynchronously.

Detailed Description

Function Documentation

◆ joybus_identify()

int joybus_identify ( struct joybus * bus,
struct joybus_id * response )

Identify the target device attached to the Joybus.

Parameters
busthe Joybus to use
responsebuffer to store the identify response in
Returns
0 on success, a negative joybus_error on failure

◆ joybus_identify_async()

int joybus_identify_async ( struct joybus * bus,
struct joybus_id * response,
joybus_transfer_cb callback,
void * user_data )

Identify the target device attached to the Joybus, asynchronously.

Calls the provided callback when complete. The response buffer will be populated with a 3-byte response containing the device ID and status.

Parameters
busthe Joybus to use
responsebuffer to store the identify response in
callbacka callback function to call when the transfer is complete
user_datauser data to pass to the callback function
Returns
0 if the transfer was started, a negative joybus_error otherwise

◆ joybus_reset()

int joybus_reset ( struct joybus * bus,
struct joybus_id * response )

Reset the target device attached to the Joybus.

Parameters
busthe Joybus to use
responsebuffer to store the reset response in
Returns
0 on success, a negative joybus_error on failure

◆ joybus_reset_async()

int joybus_reset_async ( struct joybus * bus,
struct joybus_id * response,
joybus_transfer_cb callback,
void * user_data )

Reset the target device attached to the Joybus, asynchronously.

Parameters
busthe Joybus instance to use
responsebuffer to store the identify response in
callbacka callback function to call when the transfer is complete
user_datauser data to pass to the callback function
Returns
0 if the transfer was started, a negative joybus_error otherwise