GameCube controller Joybus target.
More...
GameCube controller Joybus target.
◆ JOYBUS_GC_CONTROLLER
| #define JOYBUS_GC_CONTROLLER |
( |
| target | ) |
|
Value:
GameCube controller Joybus target.
Definition gc_controller.h:38
Macro to cast to a GameCube controller target.
◆ joybus_gc_controller_motor_cb_t
| typedef void(* joybus_gc_controller_motor_cb_t) (struct joybus_gc_controller *controller, uint8_t state) |
Callback type for GameCube controller motor state change events.
- Parameters
-
| controller | the controller whose motor state changed |
| state | the new motor state |
◆ joybus_gc_controller_reset_cb_t
Callback type for GameCube controller reset events.
- Parameters
-
| controller | the controller that was reset |
◆ joybus_gc_controller_get_wireless_id()
Get the current wireless ID of the controller.
- Parameters
-
| controller | the controller to get the wireless ID from |
- Returns
- the current 10-bit wireless ID
◆ joybus_gc_controller_init()
Initialize a GameCube controller.
This function sets up the initial state, and registers SI command handlers for OEM GameCube controller, and WaveBird controller commands.
- Parameters
-
| controller | the controller to initialize |
| type | the device type flags |
◆ joybus_gc_controller_input_valid()
Mark the input state as valid.
When the input state is marked valid, we'll use the contents of controller->input when replying to poll commands, otherwise we'll use the origin state.
- Parameters
-
| controller | the controller to set the input state for |
| valid | true if the input state is valid |
◆ joybus_gc_controller_is_wireless()
Check if the controller is a WaveBird controller.
- Parameters
-
| controller | the controller to check |
- Returns
- true if the controller is a WaveBird controller
◆ joybus_gc_controller_set_origin()
Update the origin of the controller.
If the origin data differs from the current origin, the "need origin" flag is set.
- Parameters
-
| controller | the controller to set the wireless origin for |
| new_origin | pointer to the new origin data (6 bytes) |
◆ joybus_gc_controller_set_wireless_id()
| void joybus_gc_controller_set_wireless_id |
( |
struct joybus_gc_controller * | controller, |
|
|
uint16_t | wireless_id ) |
Set the wireless ID of the controller.
Wireless IDs are 10-bit numbers used to identify a WaveBird controller. Although these IDs aren’t globally unique, they are assumed to be distinct enough so that it’s unlikely for a single user to have two controllers with the same ID. The ID helps bind a controller to a specific port after data reception.
- Parameters
-
| controller | the controller to set the wireless ID for |
| wireless_id | the new 10-bit wireless ID |
◆ joybus_gc_controller_wireless_id_fixed()
Determine if the wireless ID has been fixed.
Fixing the wireless ID is used to bind a WaveBird controller to a specific receiver.
- Parameters
-
| controller | the controller to check |
- Returns
- true if the wireless ID is fixed