Joybus target implementation for standard GameCube controllers and WaveBird receivers.
More...
Joybus target implementation for standard GameCube controllers and WaveBird receivers.
◆ JOYBUS_TARGET_GCN_CONTROLLER
| #define JOYBUS_TARGET_GCN_CONTROLLER |
( |
| target | ) |
|
Value:
GameCube controller Joybus target.
Definition gcn_controller.h:41
Macro to cast from a generic Joybus target to a GameCube controller target.
◆ joybus_target_gcn_controller_motor_cb
Callback type for GameCube controller motor state change events.
- Parameters
-
| controller | the controller whose motor state changed |
| state | the new motor state |
◆ joybus_target_gcn_controller_reset_cb
Callback type for GameCube controller reset events.
- Parameters
-
| controller | the controller that was reset |
◆ joybus_target_gcn_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_target_gcn_controller_init()
Initialize a GameCube controller target as a regular wired controller.
- Parameters
-
| controller | the controller to initialize |
◆ joybus_target_gcn_controller_init_wavebird()
Initialize a GameCube controller target as a WaveBird receiver.
- Parameters
-
| controller | the controller to initialize |
◆ joybus_target_gcn_controller_init_with_type()
Initialize a GameCube controller target with a specific controller type.
- Parameters
-
| controller | the controller to initialize |
| type | the controller type flags |
◆ joybus_target_gcn_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_target_gcn_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_target_gcn_controller_set_motor_cb()
Set the motor state change callback for the controller.
NOTE: Motor state callbacks are called from interrupt context, do not perform any blocking operations within the callback.
- Parameters
-
| controller | the controller to set the callback for |
| callback | the callback function |
◆ joybus_target_gcn_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_target_gcn_controller_set_reset_cb()
Set the reset callback for the controller.
NOTE: Reset callbacks are called from interrupt context, do not perform any blocking operations within the callback.
- Parameters
-
| controller | the controller to set the callback for |
| callback | the callback function |
◆ joybus_target_gcn_controller_set_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_target_gcn_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