Swadge 2024 2.0.0
APIs to develop games for the Magfest Swadge
|
Macros | |
#define | DEBOUNCE_HIST_LEN 5 |
The number of samples kept in history to debounce buttons. | |
#define | TOUCH_CENTER 2 |
#define | NUM_TZ_RING 5 |
Functions | |
void | initButtons (gpio_num_t *pushButtons, uint8_t numPushButtons, touch_pad_t *touchPads, uint8_t numTouchPads) |
Initialize both pushbuttons and touch buttons. | |
void | deinitButtons (void) |
Free memory used by the buttons. | |
bool | checkButtonQueue (buttonEvt_t *evt) |
Service the queue of button events that caused interrupts This only returns a single event, even if there are multiple in the queue This function may be called multiple times in a row to completely empty the queue. | |
int | getTouchJoystick (int32_t *phi, int32_t *r, int32_t *intensity) |
Get high-level touch input, an analog input. NOTE: You must have touch callbacks enabled to use this. | |
#define DEBOUNCE_HIST_LEN 5 |
The number of samples kept in history to debounce buttons.
#define TOUCH_CENTER 2 |
#define NUM_TZ_RING 5 |
void initButtons | ( | gpio_num_t * | pushButtons, |
uint8_t | numPushButtons, | ||
touch_pad_t * | touchPads, | ||
uint8_t | numTouchPads ) |
Initialize both pushbuttons and touch buttons.
pushButtons | A list of GPIOs with pushbuttons to initialize. The list should be in the same order as buttonBit_t, starting at PB_UP |
numPushButtons | The number of pushbuttons to initialize |
touchPads | A list of touch areas that make up a touchpad to initialize. |
numTouchPads | The number of touch buttons to initialize |
void deinitButtons | ( | void | ) |
Free memory used by the buttons.
bool checkButtonQueue | ( | buttonEvt_t * | evt | ) |
Service the queue of button events that caused interrupts This only returns a single event, even if there are multiple in the queue This function may be called multiple times in a row to completely empty the queue.
evt | If an event occurred, return it through this argument |
int getTouchJoystick | ( | int32_t * | phi, |
int32_t * | r, | ||
int32_t * | intensity ) |
Get high-level touch input, an analog input. NOTE: You must have touch callbacks enabled to use this.
[out] | phi | the angle of the touch. Where 0 is right, 320 is up, 640 is left and 960 is down. |
[out] | r | is how far from center you are. 511 is on the outside edge, 0 is on the inside. |
[out] | intensity | is how hard the user is pressing. |