|
Swadge ESP32-S2
APIs to develop for the Magfest Swadge
|
Macros | |
| #define | NUM_TZ_RING 5 |
Enumerations | |
| enum | touchInitMode_t { TI_NONE , TI_JOYSTICK , TI_LINEAR } |
Functions | |
| void | initTouchPads (const touch_pad_t *touchPads, uint8_t numTouchPads, float touchPadSensitivity, bool denoiseEnable) |
| Initialize touchPad sensors. | |
| void | deinitTouchPads (void) |
| Deinitialize the touch pads. | |
| void | powerUpTouchPads (void) |
| Power up the touchpad. | |
| void | powerDownTouchPads (void) |
| Power down the touchpad. | |
| void | initTouchJoystick (uint8_t centerPadIdx, const uint8_t *ringPadIdxs) |
| Initialize the touch pads as a virtual joystick. The arguments are indices into the array touchPads[] which should have been previously passed into initTouchPads(). | |
| bool | getTouchJoystick (int32_t *phi, int32_t *r, int32_t *intensity) |
| Get high-level touch input, an analog input. | |
| void | initTouchLinear (const touchLinearCfg_t *touchLinearCfgs, uint8_t numTouchLinearCfgs) |
| Initialize the touch pads as a set of linear arrays. | |
| uint8_t | getTouchLinear (linearTouch_t *touches, uint8_t numLinearTouches) |
| Get a high level touch input from each configured linear array. | |
Variables | |
| touchInitMode_t | _touchInitMode = TI_NONE |
| The initialization mode for the touch pads. | |
| uint8_t | _centerZone = 0 |
| The index of the touch pad in _touchPads[] used as the center zone for the joystick. | |
| uint8_t | _ringZones [NUM_TZ_RING] = {0} |
| The indices of the touch pads in _touchPads[] used as the ring for the joystick. | |
| uint8_t | _numTouchLinearCfgs = 0 |
| The number of linear configurations of touch pads. | |
| const touchLinearCfg_t * | _touchLinearCfgs = NULL |
| The linear configurations of touch pads, including indices into _touchPads[]. | |
| #define NUM_TZ_RING 5 |
| enum touchInitMode_t |
| void initTouchPads | ( | const touch_pad_t * | touchPads, |
| uint8_t | numTouchPads, | ||
| float | touchPadSensitivity, | ||
| bool | denoiseEnable ) |
Initialize touchPad sensors.
| touchPads | A list of touchPads to initialize |
| numTouchPads | The number of touchPads to initialize |
| touchPadSensitivity | The sensitivity to set for these touchPads |
| denoiseEnable | true to denoise the input, false to use it raw |
| void deinitTouchPads | ( | void | ) |
Deinitialize the touch pads.
| void powerUpTouchPads | ( | void | ) |
Power up the touchpad.
| void powerDownTouchPads | ( | void | ) |
Power down the touchpad.
| void initTouchJoystick | ( | uint8_t | centerPadIdx, |
| const uint8_t * | ringPadIdxs ) |
Initialize the touch pads as a virtual joystick. The arguments are indices into the array touchPads[] which should have been previously passed into initTouchPads().
| centerPadIdx | The touch pad index to use as the center of the joystick |
| ringPadIdxs | A list of touch pad indices to use as the ring of the joystick. Must be at least NUM_TZ_RING long. |
| bool getTouchJoystick | ( | int32_t * | phi, |
| int32_t * | r, | ||
| int32_t * | intensity ) |
Get high-level touch input, an analog input.
| [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. |
| void initTouchLinear | ( | const touchLinearCfg_t * | touchLinearCfgs, |
| uint8_t | numTouchLinearCfgs ) |
Initialize the touch pads as a set of linear arrays.
| touchLinearCfgs | A list of configurations for each linear touch pad array |
| numTouchLinearCfgs | The number of configurations of linear touch pad arrays. This memory is not copied, so it must be valid for the lifetime of the firmware. |
| uint8_t getTouchLinear | ( | linearTouch_t * | touches, |
| uint8_t | numLinearTouches ) |
Get a high level touch input from each configured linear array.
| [out] | touches | The results of the touch, including if a touch was detected, intensity, and position |
| [in] | numLinearTouches | The number of linear arrays to try to read |
| touchInitMode_t _touchInitMode = TI_NONE |
The initialization mode for the touch pads.
| uint8_t _centerZone = 0 |
The index of the touch pad in _touchPads[] used as the center zone for the joystick.
| uint8_t _ringZones[NUM_TZ_RING] = {0} |
The indices of the touch pads in _touchPads[] used as the ring for the joystick.
| uint8_t _numTouchLinearCfgs = 0 |
The number of linear configurations of touch pads.
| const touchLinearCfg_t* _touchLinearCfgs = NULL |
The linear configurations of touch pads, including indices into _touchPads[].