#include <stdint.h>
Go to the source code of this file.
◆ GAMEPAD_BTN_A
#define GAMEPAD_BTN_A (1 << 0) |
◆ GAMEPAD_BTN_B
#define GAMEPAD_BTN_B (1 << 1) |
◆ GAMEPAD_BTN_DPAD_DOWN
#define GAMEPAD_BTN_DPAD_DOWN (1 << 5) |
◆ GAMEPAD_BTN_DPAD_LEFT
#define GAMEPAD_BTN_DPAD_LEFT (1 << 6) |
◆ GAMEPAD_BTN_DPAD_RIGHT
#define GAMEPAD_BTN_DPAD_RIGHT (1 << 7) |
◆ GAMEPAD_BTN_DPAD_UP
#define GAMEPAD_BTN_DPAD_UP (1 << 4) |
◆ GAMEPAD_BTN_L1
#define GAMEPAD_BTN_L1 (1 << 8) |
◆ GAMEPAD_BTN_L2
#define GAMEPAD_BTN_L2 (1 << 9) |
◆ GAMEPAD_BTN_L3
#define GAMEPAD_BTN_L3 (1 << 10) |
◆ GAMEPAD_BTN_R1
#define GAMEPAD_BTN_R1 (1 << 11) |
◆ GAMEPAD_BTN_R2
#define GAMEPAD_BTN_R2 (1 << 12) |
◆ GAMEPAD_BTN_R3
#define GAMEPAD_BTN_R3 (1 << 13) |
◆ GAMEPAD_BTN_SELECT
#define GAMEPAD_BTN_SELECT (1 << 15) |
◆ GAMEPAD_BTN_START
#define GAMEPAD_BTN_START (1 << 14) |
◆ GAMEPAD_BTN_X
#define GAMEPAD_BTN_X (1 << 2) |
◆ GAMEPAD_BTN_Y
#define GAMEPAD_BTN_Y (1 << 3) |
◆ gamepad_isConnected()
uint8_t gamepad_isConnected |
( |
uint32_t |
port | ) |
|
Check if a gamepad is connected to the given port.
- Parameters
-
port | The port to check (0 to 3) |
- Returns
- 1 if the gamepad is connected, false otherwise
◆ gamepad_readState()
Read the state of the gamepad connected to the given port.
- Parameters
-
port | The port to check (0 to 3) |
state | Pointer to the struct to fill with the current gamepad state |
◆ gamepad_setRumble()
void gamepad_setRumble |
( |
uint32_t |
port, |
|
|
uint8_t |
enable |
|
) |
| |
Set rumble enabled or disabled on the gamepad connected to the given port.
- Parameters
-
port | THe port to check (0 to 3) |
enable | Whether to enable rumble |