Functions for using the USB Gamecube Controller Adapter.
More...
|
enum | HPADChan {
HPAD_CHAN_0 = 0
,
HPAD_CHAN_1 = 1
,
HPAD_CHAN_2 = 2
,
HPAD_CHAN_3 = 3
,
HPAD_CHAN_4 = 4
,
HPAD_CHAN_5 = 5
,
HPAD_CHAN_6 = 6
,
HPAD_CHAN_7 = 7
} |
|
enum | HPADGGGGChan {
HPAD_GGGG_CHAN_0 = 0
,
HPAD_GGGG_CHAN_1 = 1
} |
|
enum | HPADButtons {
HPAD_BUTTON_A = 0x0001
,
HPAD_BUTTON_B = 0x0002
,
HPAD_BUTTON_X = 0x0004
,
HPAD_BUTTON_Y = 0x0008
,
HPAD_BUTTON_LEFT = 0x0010
,
HPAD_BUTTON_RIGHT = 0x0020
,
HPAD_BUTTON_DOWN = 0x0040
,
HPAD_BUTTON_UP = 0x0080
,
HPAD_BUTTON_START = 0x0100
,
HPAD_TRIGGER_Z = 0x0200
,
HPAD_TRIGGER_R = 0x0400
,
HPAD_TRIGGER_L = 0x0800
,
HPAD_STICK_EMULATION_LEFT = 0x00001000
,
HPAD_STICK_EMULATION_RIGHT = 0x00002000
,
HPAD_STICK_EMULATION_DOWN = 0x00004000
,
HPAD_STICK_EMULATION_UP = 0x00008000
,
HPAD_SUBSTICK_EMULATION_LEFT = 0x00010000
,
HPAD_SUBSTICK_EMULATION_RIGHT = 0x00020000
,
HPAD_SUBSTICK_EMULATION_DOWN = 0x00040000
,
HPAD_SUBSTICK_EMULATION_UP = 0x00080000
} |
|
enum | HPADMotorCommand {
HPAD_MOTOR_COMMAND_STOP = 0
,
HPAD_MOTOR_COMMAND_RUMBLE = 1
,
HPAD_MOTOR_COMMAND_STOP_HARD = 2
} |
|
Functions for using the USB Gamecube Controller Adapter.
◆ HPADStatus
Definition at line 83 of file hpad.h.
Data Fields |
int32_t |
hold |
Indicates what HPADButtons are held down. |
int32_t |
trigger |
Indicates what HPADButtons have been pressed since last sample. |
int32_t |
release |
Indicates what HPADButtons have been released since last sample. |
int8_t |
stickX |
X-Position of the analog stick. |
int8_t |
stickY |
Y-Position of the analog stick. |
int8_t |
substickX |
X-Position of the analog substick/C-Stick. |
int8_t |
substickY |
Y-Position of the analog substick/C-Stick. |
uint8_t |
triggerL |
Position of the left analog trigger. |
uint8_t |
triggerR |
Position of the right analog trigger. |
uint8_t |
status |
Status of the controller. |
int32_t |
error |
Read error, 0 for success. |
◆ HPADGGGGStatus
Definition at line 122 of file hpad.h.
Data Fields |
BOOL |
connected |
TRUE if the adapeter is connected |
BOOL |
powerSupplyConnected |
TRUE if the power supply is connected |
BOOL |
active |
TRUE if the adapter is active/is sending samples |
◆ HPAD_STICK_AXIS_MIN
#define HPAD_STICK_AXIS_MIN -56 |
The minimum value of the stick axis.
Definition at line 16 of file hpad.h.
◆ HPAD_STICK_AXIS_MAX
#define HPAD_STICK_AXIS_MAX 56 |
The maximum value of the stick axis.
Definition at line 18 of file hpad.h.
◆ HPAD_SUBSTICK_AXIS_MIN
#define HPAD_SUBSTICK_AXIS_MIN -44 |
The minimum value of the substick axis.
Definition at line 20 of file hpad.h.
◆ HPAD_SUBSTICK_AXIS_MAX
#define HPAD_SUBSTICK_AXIS_MAX 44 |
The maximum value of the substick axis.
Definition at line 22 of file hpad.h.
◆ HPAD_TRIGGER_MIN
#define HPAD_TRIGGER_MIN 0 |
The minimum value of the trigger.
Definition at line 24 of file hpad.h.
◆ HPAD_TRIGGER_MAX
#define HPAD_TRIGGER_MAX 150 |
The maximum value of the trigger.
Definition at line 26 of file hpad.h.
◆ HPADStatus
Definition at line 1 of file hpad.h.
◆ HPADGGGGStatus
Definition at line 1 of file hpad.h.
◆ HPADChan
◆ HPADGGGGChan
◆ HPADButtons
◆ HPADMotorCommand
◆ HPADConnectCallback
typedef void(* HPADConnectCallback) (HPADChan chan, int32_t status) |
◆ HPADGGGGConnectCallback
◆ HPADPowerSupplyCallback
◆ HPADSamplingCallback
◆ HPADResetCallback
typedef void(* HPADResetCallback) (HPADGGGGChan chan, int32_t status) |
◆ HPADChan
Enumerator |
---|
HPAD_CHAN_0 | |
HPAD_CHAN_1 | |
HPAD_CHAN_2 | |
HPAD_CHAN_3 | |
HPAD_CHAN_4 | |
HPAD_CHAN_5 | |
HPAD_CHAN_6 | |
HPAD_CHAN_7 | |
Definition at line 31 of file hpad.h.
◆ HPADGGGGChan
Enumerator |
---|
HPAD_GGGG_CHAN_0 | Adapter Channel 0.
|
HPAD_GGGG_CHAN_1 | Adapter Channel 1.
|
Definition at line 43 of file hpad.h.
◆ HPADButtons
Enumerator |
---|
HPAD_BUTTON_A | |
HPAD_BUTTON_B | |
HPAD_BUTTON_X | |
HPAD_BUTTON_Y | |
HPAD_BUTTON_LEFT | |
HPAD_BUTTON_RIGHT | |
HPAD_BUTTON_DOWN | |
HPAD_BUTTON_UP | |
HPAD_BUTTON_START | |
HPAD_TRIGGER_Z | |
HPAD_TRIGGER_R | |
HPAD_TRIGGER_L | |
HPAD_STICK_EMULATION_LEFT | |
HPAD_STICK_EMULATION_RIGHT | |
HPAD_STICK_EMULATION_DOWN | |
HPAD_STICK_EMULATION_UP | |
HPAD_SUBSTICK_EMULATION_LEFT | |
HPAD_SUBSTICK_EMULATION_RIGHT | |
HPAD_SUBSTICK_EMULATION_DOWN | |
HPAD_SUBSTICK_EMULATION_UP | |
Definition at line 51 of file hpad.h.
◆ HPADMotorCommand
Enumerator |
---|
HPAD_MOTOR_COMMAND_STOP | |
HPAD_MOTOR_COMMAND_RUMBLE | |
HPAD_MOTOR_COMMAND_STOP_HARD | |
Definition at line 76 of file hpad.h.
◆ HPADInit()
int32_t HPADInit |
( |
void |
| ) |
|
Initializes the HPAD library.
- Returns
- 0 on success.
◆ HPADShutdown()
int32_t HPADShutdown |
( |
void |
| ) |
|
Shuts down the HPAD library.
- Returns
- 0 on success.
◆ HPADRead()
Reads status buffers from a specified HPAD channel.
- Warning
- The count parameter is ignored and this function will always fill up to 16 sampling buffers. Make sure to always make space for 16 buffers.
- Parameters
-
chan | The channel to read from. |
buffers | Pointer to an array of HPADStatus buffers to fill. |
count | Number of buffers to fill. |
- Returns
- The amount of buffers read or a negative value on error.
- Parameters
-
chan | The channel to read from. |
buffers | Pointer to an array of HPADStatus buffers to fill. |
count | Number of buffers to fill. Must be 16. |
- Returns
- The amount of buffers read or a negative value on error.
Definition at line 200 of file hpad.h.
◆ HPADControlMotor()
Sends a motor/rumble command to the specified HPAD channel.
- Parameters
-
chan | The channel to send the command to. |
command | The motor command to send. |
- Returns
- 0 on success.
◆ HPADRecalibrate()
int32_t HPADRecalibrate |
( |
HPADChan |
chan | ) |
|
Invalidates calibration data of the specified HPAD channel.
- Parameters
-
chan | The channel to invalidate data. |
- Returns
- 0 on success.
◆ HPADSetConnectCallback()
Sets a callback for once the specified HPAD channel is connected.
- Parameters
-
chan | The channel to set the callback. |
callback | A pointer to the callback function. |
- Returns
- A pointer to the previous callback or
NULL
.
◆ HPADGetGGGGStatus()
Get the status of the specified GGGG channel (GC Adapter).
- Parameters
-
chan | The channel to get the status from. |
status | A pointer to write the status to. |
- Returns
- 0 on success.
◆ HPADSetGgggConnectCallback()
Sets a callback for once the specified GGGG Adapter is connected.
- Parameters
-
chan | The channel to set the callback. |
callback | A pointer to the callback function. |
- Returns
- A pointer to the previous callback or
NULL
.
◆ HPADSetPowerSupplyCallback()
Sets a callback for once the power supply of the specified GGGG Adapter is connected.
- Parameters
-
chan | The channel to set the callback. |
callback | A pointer to the callback function. |
- Returns
- A pointer to the previous callback or
NULL
.
◆ HPADSetSamplingCallback()
Sets a callback for once a sample is received from the specified GGGG Adapter.
- Parameters
-
chan | The channel to set the callback. |
callback | A pointer to the callback function. |
- Returns
- A pointer to the previous callback or
NULL
.
◆ HPADResetDevice()
Resets the specified GGGG Adapter.
- Parameters
-
chan | The channel to reset. |
callback | A pointer to a callback function after resetting is complete. |
- Returns
- 0 on success.