|
Swadge ESP32-S2
APIs to develop for the Magfest Swadge
|
Macros | |
| #define | ITEMS_PER_PAGE 5 |
| #define | ITEM_MARGIN 1 |
| #define | ITEM_HEIGHT 31 |
| #define | Y_SECTION_MARGIN 6 |
| #define | Y_ITEM_START 55 |
| #define | MAX_ITEM_TEXT_WIDTH 191 |
| #define | ARROW_PERIOD_US 1000000 |
| #define | DEFAULT_BODY_HEIGHT 66 |
| #define | CLOUD_COUNT 4 |
| #define | CLOUD_LIGHT_COLOR_1 c555 |
| #define | CLOUD_LIGHT_COLOR_2 c444 |
| #define | CLOUD_DARK_COLOR_1 c222 |
| #define | CLOUD_DARK_COLOR_2 c111 |
| #define | CLOUD_MIN_X (-500) |
| #define | CLOUD_MIN_Y_VISIBLE 5 |
| #define | CLOUD_MIN_SPEED_PX_PER_SEC 4 |
| #define | CLOUD_MAX_SPEED_PX_PER_SEC 25 |
| #define | BATTERY_LVL_FULL 872 |
| #define | BATTERY_LVL_DEAD 452 |
| #define | BATTERY_TOP_INSET 3 |
| #define | BATTERY_SIDE_BOTTOM_INSET 2 |
Functions | |
| menuZorldoRenderer_t * | initMenuZorldoRenderer (font_t *titleFont, font_t *menuFont) |
| Initialize a and return a menu renderer. | |
| void | deinitMenuZorldoRenderer (menuZorldoRenderer_t *renderer) |
| Deinitialize a menu renderer and free associated memory. This will not free the font passed into initMenuZorldoRenderer(). | |
| void | setDrawMenuZorldoBody (menuZorldoRenderer_t *renderer, bool drawBody) |
| Set whether or not to draw the menu background. | |
| void | setMenuZorldoBodyHeight (menuZorldoRenderer_t *renderer, int16_t height) |
| Set the height of the body between top and bottom decorated parts If the given height is negative, it will be set to the default height. | |
| void | drawMenuZorldoBody (uint16_t topLeftX, uint16_t topLeftY, menuZorldoRenderer_t *renderer, int64_t elapsedUs) |
| Draw the menu body background. | |
| void | drawMenuZorldo (menu_t *menu, menuZorldoRenderer_t *renderer, int64_t elapsedUs) |
| Draw a themed menu to the display and control the LEDs. | |
| void | setZorldoLedsOn (menuZorldoRenderer_t *renderer, bool ledsOn) |
| Set the renderer's LEDs to be on or off. | |
| #define ITEMS_PER_PAGE 5 |
| #define ITEM_MARGIN 1 |
| #define ITEM_HEIGHT 31 |
| #define Y_SECTION_MARGIN 6 |
| #define Y_ITEM_START 55 |
| #define MAX_ITEM_TEXT_WIDTH 191 |
| #define ARROW_PERIOD_US 1000000 |
| #define DEFAULT_BODY_HEIGHT 66 |
| #define CLOUD_COUNT 4 |
| #define CLOUD_LIGHT_COLOR_1 c555 |
| #define CLOUD_LIGHT_COLOR_2 c444 |
| #define CLOUD_DARK_COLOR_1 c222 |
| #define CLOUD_DARK_COLOR_2 c111 |
| #define CLOUD_MIN_X (-500) |
| #define CLOUD_MIN_Y_VISIBLE 5 |
| #define CLOUD_MIN_SPEED_PX_PER_SEC 4 |
| #define CLOUD_MAX_SPEED_PX_PER_SEC 25 |
| #define BATTERY_LVL_FULL 872 |
| #define BATTERY_LVL_DEAD 452 |
| #define BATTERY_TOP_INSET 3 |
| #define BATTERY_SIDE_BOTTOM_INSET 2 |
| menuZorldoRenderer_t * initMenuZorldoRenderer | ( | font_t * | titleFont, |
| font_t * | menuFont ) |
Initialize a and return a menu renderer.
| titleFont | The font used to draw the title, preferably PIX_ROMANA_FONT. If this is NULL it will be allocated by the renderer in SPIRAM. |
| menuFont | The font used to draw this menu, preferably MINISHCAP_FONT. If this is NULL it will be allocated by the renderer in SPIRAM. |
| void deinitMenuZorldoRenderer | ( | menuZorldoRenderer_t * | renderer | ) |
Deinitialize a menu renderer and free associated memory. This will not free the font passed into initMenuZorldoRenderer().
| renderer | The renderer to deinitialize. It must not be used after deinitialization. |
| void setDrawMenuZorldoBody | ( | menuZorldoRenderer_t * | renderer, |
| bool | drawBody ) |
Set whether or not to draw the menu background.
| renderer | The renderer. |
| drawBody | true to draw the body background, false to skip it |
| void setMenuZorldoBodyHeight | ( | menuZorldoRenderer_t * | renderer, |
| int16_t | height ) |
Set the height of the body between top and bottom decorated parts If the given height is negative, it will be set to the default height.
| renderer | The renderer to adjust the body height for |
| height | The new height. If the given value is negative, the default height will be set. |
| void drawMenuZorldoBody | ( | uint16_t | topLeftX, |
| uint16_t | topLeftY, | ||
| menuZorldoRenderer_t * | renderer, | ||
| int64_t | elapsedUs ) |
Draw the menu body background.
| topLeftX | The X coordinate of the top left corner of the body |
| topLeftY | The Y coordinate of the top left corner of the body |
| renderer | The renderer to draw a body with |
| elapsedUs | The time elapsed since this function was last called, for cloud animation |
| void drawMenuZorldo | ( | menu_t * | menu, |
| menuZorldoRenderer_t * | renderer, | ||
| int64_t | elapsedUs ) |
Draw a themed menu to the display and control the LEDs.
| menu | The menu to draw |
| renderer | The renderer to draw with |
| elapsedUs | The time elapsed since this function was last called, for LED animation |
| void setZorldoLedsOn | ( | menuZorldoRenderer_t * | renderer, |
| bool | ledsOn ) |
Set the renderer's LEDs to be on or off.
| renderer | The renderer to set |
| ledsOn | true to animate the LEDs, false to keep them off |