|
Swadge 2024 2.0.0
APIs to develop games for the Magfest Swadge
|
Macros | |
| #define | RMT_LED_STRIP_RESOLUTION_HZ 10000000 |
| 10MHz resolution, 1 tick = 0.1us (led strip needs a high resolution) | |
Functions | |
| esp_err_t | initLeds (gpio_num_t gpio, gpio_num_t gpioAlt, uint8_t brightness) |
| Initialize the RGB LEDs. | |
| esp_err_t | deinitLeds (void) |
| Deinitialize LEDs. | |
| void | powerDownLed (void) |
| Power down the LEDs. | |
| void | powerUpLed (void) |
| Power up the LEDs. | |
| void | setLedBrightness (uint8_t brightness) |
| Set the global LED brightness. setLedBrightnessSetting() should be called instead if the new volume should be persistent through a reboot. | |
| esp_err_t | setLeds (led_t *leds, uint8_t numLeds) |
| Set the RGB LEDs to the given values. | |
| const led_t * | getLedState (void) |
Return a pointer to the current LED state, always of length CONFIG_NUM_LEDS | |
| void | flushLeds (void) |
| Wait until any pending LED transactions are finished, then return. | |
| #define RMT_LED_STRIP_RESOLUTION_HZ 10000000 |
10MHz resolution, 1 tick = 0.1us (led strip needs a high resolution)
| esp_err_t initLeds | ( | gpio_num_t | gpio, |
| gpio_num_t | gpioAlt, | ||
| uint8_t | brightness ) |
Initialize the RGB LEDs.
| gpio | The GPIO the LEDs are attached to |
| gpioAlt | A GPIO to mirror the LED output to |
| brightness | The brightness to start the LEDs at |
| esp_err_t deinitLeds | ( | void | ) |
Deinitialize LEDs.
| void powerDownLed | ( | void | ) |
Power down the LEDs.
| void powerUpLed | ( | void | ) |
Power up the LEDs.
| void setLedBrightness | ( | uint8_t | brightness | ) |
Set the global LED brightness. setLedBrightnessSetting() should be called instead if the new volume should be persistent through a reboot.
| brightness | 0 (off) to MAX_LED_BRIGHTNESS (max bright) |
| esp_err_t setLeds | ( | led_t * | leds, |
| uint8_t | numLeds ) |
Set the RGB LEDs to the given values.
| leds | A pointer to an array of led_t structs to set the LEDs to. The array must have at least numLeds elements |
| numLeds | The number of LEDs to set, probably CONFIG_NUM_LEDS |
| const led_t * getLedState | ( | void | ) |
Return a pointer to the current LED state, always of length CONFIG_NUM_LEDS
| void flushLeds | ( | void | ) |
Wait until any pending LED transactions are finished, then return.