|
Swadge ESP32-S2
APIs to develop for the Magfest Swadge
|
Provides index-based usernames that will avoid the issues inherent in free text entry.
Macros | |
| #define | USER_LIST_SHIFT 2 |
| #define | ADJ1_X 47 |
| #define | WORDSPACING 72 |
| #define | ADJ2_X (ADJ1_X + WORDSPACING) |
| #define | NOUN_X (ADJ2_X + WORDSPACING) |
| #define | WORD_OFFSET 20 |
| #define | COLOR_OFFSET 43 |
Enumerations | |
| enum | listArrayIdx_t { ADJ1 , ADJ2 , NOUN , RAND_NUM } |
Functions | |
| void | initUsernameSystem () |
| Call this to initialize the MAC variable. Call inside the swadge.h file. | |
| void | generateMACUsername (nameData_t *nd) |
| Generates a username based on the MAC of the swadge. | |
| void | generateRandUsername (nameData_t *nd) |
| Generates a random username. | |
| void | setUsernameFromND (nameData_t *nd) |
| Sets the username from a predefined nd. | |
| void | setUsernameFromIdxs (nameData_t *nd, int idx1, int idx2, int idx3, int randomCode) |
| Set the Username From indices. Useful for loading data from swadgepass. | |
| bool | handleUsernamePickerInput (buttonEvt_t *evt, nameData_t *nd) |
| Handles the input of the username. | |
| void | drawUsernamePicker (nameData_t *nd) |
| Draws the picker input. | |
| nameData_t * | getSystemUsername (void) |
| Get the System Username object. | |
| void | setSystemUsername (nameData_t *nd) |
| Saves the username to NVS. | |
| void | setUsernameFrom32 (nameData_t *nd, int32_t packed) |
| Set the Username from a int32. | |
Variables | |
| nameData_t | swadgeUsername |
| #define USER_LIST_SHIFT 2 |
| #define ADJ1_X 47 |
| #define WORDSPACING 72 |
| #define ADJ2_X (ADJ1_X + WORDSPACING) |
| #define NOUN_X (ADJ2_X + WORDSPACING) |
| #define WORD_OFFSET 20 |
| #define COLOR_OFFSET 43 |
| enum listArrayIdx_t |
| void initUsernameSystem | ( | void | ) |
Call this to initialize the MAC variable. Call inside the swadge.h file.
| void generateMACUsername | ( | nameData_t * | nd | ) |
Generates a username based on the MAC of the swadge.
| nd | Data struct the name is saved to |
| void generateRandUsername | ( | nameData_t * | nd | ) |
Generates a random username.
| nd | Data struct the name is saved to |
| void setUsernameFromND | ( | nameData_t * | nd | ) |
Sets the username from a predefined nd.
| nd | nd containing the data |
| void setUsernameFromIdxs | ( | nameData_t * | nd, |
| int | idx1, | ||
| int | idx2, | ||
| int | idx3, | ||
| int | randomCode ) |
Set the Username From indices. Useful for loading data from swadgepass.
| nd | Data struct to receive the objects |
| idx1 | First index |
| idx2 | Second index |
| idx3 | Third index |
| randomCode | numbers at the end of the swadge |
| bool handleUsernamePickerInput | ( | buttonEvt_t * | evt, |
| nameData_t * | nd ) |
Handles the input of the username.
| evt | The button event object |
| nd | Data structure to store data in |
| void drawUsernamePicker | ( | nameData_t * | nd | ) |
Draws the picker input.
| nd | The data |
| nameData_t * getSystemUsername | ( | void | ) |
Get the System Username object.
| void setSystemUsername | ( | nameData_t * | nd | ) |
Saves the username to NVS.
| nd | username to save |
| void setUsernameFrom32 | ( | nameData_t * | nd, |
| int32_t | packed ) |
Set the Username from a int32.
| nd | nameData_t to initialize |
| packed | int32_t to load name from |
| nameData_t swadgeUsername |