10#include <joybus/bus.h>
Joybus command codes and transfer lengths.
#define JOYBUS_CMD_GCN_PROBE_DEVICE_RX
GCN probe device response length.
Definition commands.h:140
Common definitions for GameCube controllers.
joybus_gcn_motor_state
GameCube controller motor states.
Definition gcn_controller.h:106
joybus_gcn_analog_mode
Analog modes for packing GameCube controller input state.
Definition gcn_controller.h:86
int joybus_gcn_read_long(struct joybus *bus, enum joybus_gcn_motor_state motor_state, struct joybus_gcn_controller_state *response)
Read the current input state of a GameCube controller, with full precision.
Definition gcn.c:136
int joybus_gcn_read_long_async(struct joybus *bus, enum joybus_gcn_motor_state motor_state, struct joybus_gcn_controller_state *response, joybus_transfer_cb callback, void *user_data)
Read the current input state of a GameCube controller, with full precision, asynchronously.
Definition gcn.c:143
int joybus_gcn_probe_device_async(struct joybus *bus, uint8_t response[JOYBUS_CMD_GCN_PROBE_DEVICE_RX], joybus_transfer_cb callback, void *user_data)
Send a "probe device" command to a WaveBird controller, asynchronously.
Definition gcn.c:163
int joybus_gcn_read_origin(struct joybus *bus, struct joybus_gcn_controller_state *response)
Read the origin (neutral) state of a GameCube controller.
Definition gcn.c:100
int joybus_gcn_probe_device(struct joybus *bus, uint8_t response[JOYBUS_CMD_GCN_PROBE_DEVICE_RX])
Send a "probe device" command to a WaveBird controller.
Definition gcn.c:157
int joybus_gcn_read_async(struct joybus *bus, enum joybus_gcn_analog_mode analog_mode, enum joybus_gcn_motor_state motor_state, struct joybus_gcn_controller_state *response, joybus_transfer_cb callback, void *user_data)
Read the current input state of a GameCube controller, asynchronously.
Definition gcn.c:80
int joybus_gcn_calibrate(struct joybus *bus, struct joybus_gcn_controller_state *response)
Calibrate a GameCube controller, setting its current input state as the origin.
Definition gcn.c:117
int joybus_gcn_fix_device(struct joybus *bus, uint16_t wireless_id, struct joybus_id *response)
Send a "fix device" command to a WaveBird controller.
Definition gcn.c:177
int joybus_gcn_read_origin_async(struct joybus *bus, struct joybus_gcn_controller_state *response, joybus_transfer_cb callback, void *user_data)
Read the origin (neutral) state of a GameCube controller, asynchronously.
Definition gcn.c:106
int joybus_gcn_calibrate_async(struct joybus *bus, struct joybus_gcn_controller_state *response, joybus_transfer_cb callback, void *user_data)
Calibrate a GameCube controller, setting its current input state as the origin, asynchronously.
Definition gcn.c:123
int joybus_gcn_read(struct joybus *bus, enum joybus_gcn_analog_mode analog_mode, enum joybus_gcn_motor_state motor_state, struct joybus_gcn_controller_state *response)
Read the current input state of a GameCube controller.
Definition gcn.c:73
int joybus_gcn_fix_device_async(struct joybus *bus, uint16_t wireless_id, struct joybus_id *response, joybus_transfer_cb callback, void *user_data)
Send a "fix device" command to a WaveBird controller, asynchronously.
Definition gcn.c:183
void(* joybus_transfer_cb)(struct joybus *bus, int status, void *user_data)
Function type for transfer completion callbacks.
Definition bus.h:74
Joybus device identification values and utilities.
GameCube controller input/origin state.
Definition gcn_controller.h:43
Represents the 3-byte ID field from an "identify" buffer.
Definition identify.h:98
A Joybus instance.
Definition bus.h:96