libdragon
|
Joybus internal API. More...
Go to the source code of this file.
Functions | |
void | joybus_exec_async (const void *input, void(*callback)(uint64_t *output, void *ctx), void *ctx) |
Execute an asynchronous joybus message. | |
Joybus internal API.
void joybus_exec_async | ( | const void * | input, |
void(*)(uint64_t *output, void *ctx) | callback, | ||
void * | ctx | ||
) |
Execute an asynchronous joybus message.
This function executes an asynchronous joybus protocol exchange, sending a message block (input), and receiving a reply (output). The message is sent in background and a completion function "callback" is called when the output is ready to be processed.
It is possible to schedule multiple joybus messages by calling this function multiple times. They will be automatically executed in order. The maximum number of pending messages at any given time is MAX_JOYBUS_MSGS.
[in] | input | The input block (must be of JOYBUS_BLOCK_SIZE bytes). No specific alignment is required for this data block. |
[in] | callback | A callback completion function that will be called when the joybus command is finished. The function will receive a pointer to the output buffer and the opaque pointer to the callback's context. Can be NULL if no callback is required. |
[in] | ctx | Context opaque pointer to pass to the callback. Can be NULL if no context is required. |