Enables access to the on-board status LED(s). More...
Macros | |
| #define | PICO_COLORED_STATUS_LED_COLOR_FROM_RGB(r, g, b) |
| Generate an RGB color value for colored_status_led_set_on_with_color. | |
| #define | PICO_COLORED_STATUS_LED_COLOR_FROM_WRGB(w, r, g, b) |
| Generate an WRGB color value for colored_status_led_set_on_with_color. | |
Functions | |
| bool | status_led_init (void) |
| Initialize the status LED(s). | |
| bool | status_led_init_with_context (struct async_context *context) |
| Initialise the status LED(s). | |
| static bool | colored_status_led_supported (void) |
| Determine if the colored_status_led_ APIs are supported (i.e. if there is a colored status LED, and its use isn't disabled via PICO_COLORED_STATUS_LED_AVAILABLE being set to 0. | |
| static bool | status_led_via_colored_status_led (void) |
| Determine if the colored status LED is being used for the single-color status_led_ APIs. | |
| static bool | status_led_supported (void) |
| Determine if the single-color status_led_ APIs are supported (i.e. if there is a regular LED, and its use isn't disabled via PICO_STATUS_LED_AVAILABLE being set to 0, or if the colored status LED is being used for the single-color status_led_ APIs. | |
| bool | colored_status_led_set_state (bool led_on) |
| Set the colored status LED on or off. | |
| bool | colored_status_led_get_state (void) |
| Get the state of the colored status LED. | |
| bool | colored_status_led_set_on_with_color (uint32_t color) |
| Ensure the colored status LED is on, with the specified color. | |
| uint32_t | colored_status_led_get_on_color (void) |
| Get the color used for the status LED value when it is on. | |
| static bool | status_led_set_state (bool led_on) |
| Set the status LED on or off. | |
| static bool | status_led_get_state () |
| Get the state of the status LED. | |
| void | status_led_deinit () |
| De-initialize the status LED(s). | |
Enables access to the on-board status LED(s).
Boards usually have access to one or two on-board status LEDs which are configured via the board header (PICO_DEFAULT_LED_PIN, CYW43_WL_GPIO_LED_PIN and/or PICO_DEFAULT_WS2812_PIN). This library hides the low-level details so you can use the status LEDs for all boards without changing your code.
| #define PICO_COLORED_STATUS_LED_COLOR_FROM_RGB | ( | r, | |
| g, | |||
| b ) |
Generate an RGB color value for colored_status_led_set_on_with_color.
| #define PICO_COLORED_STATUS_LED_COLOR_FROM_WRGB | ( | w, | |
| r, | |||
| g, | |||
| b ) |
Generate an WRGB color value for colored_status_led_set_on_with_color.
| uint32_t colored_status_led_get_on_color | ( | void | ) |
Get the color used for the status LED value when it is on.
| bool colored_status_led_get_state | ( | void | ) |
Get the state of the colored status LED.
| bool colored_status_led_set_on_with_color | ( | uint32_t | color | ) |
Ensure the colored status LED is on, with the specified color.
| color | The color to use for the colored status LED when it is on, in 0xWWRRGGBB format |
| bool colored_status_led_set_state | ( | bool | led_on | ) |
Set the colored status LED on or off.
| led_on | true to turn the colored LED on. Pass false to turn the colored LED off |
|
inlinestatic |
Determine if the colored_status_led_ APIs are supported (i.e. if there is a colored status LED, and its use isn't disabled via PICO_COLORED_STATUS_LED_AVAILABLE being set to 0.
| void status_led_deinit | ( | ) |
De-initialize the status LED(s).
De-initializes the status LED(s) when they are no longer needed.
|
inlinestatic |
Get the state of the status LED.
| bool status_led_init | ( | void | ) |
Initialize the status LED(s).
Initialize the status LED(s) and the resources they need before use. On some devices (e.g. Pico W, Pico 2 W) accessing the status LED requires talking to the WiFi chip, which requires an async_context. This method will create an async_context for you.
However an application should only use a single async_context instance to talk to the WiFi chip. If the application already has an async context (e.g. created by cyw43_arch_init) you should use status_led_init_with_context instead and pass it the async_context already created by your application
| bool status_led_init_with_context | ( | struct async_context * | context | ) |
Initialise the status LED(s).
Initialize the status LED(s) and the resources they need before use.
| context | An async_context used to communicate with the status LED (e.g. on Pico W or Pico 2 W) |
|
inlinestatic |
Set the status LED on or off.
| led_on | true to turn the LED on. Pass false to turn the LED off |
|
inlinestatic |
Determine if the single-color status_led_ APIs are supported (i.e. if there is a regular LED, and its use isn't disabled via PICO_STATUS_LED_AVAILABLE being set to 0, or if the colored status LED is being used for the single-color status_led_ APIs.
|
inlinestatic |
Determine if the colored status LED is being used for the single-color status_led_ APIs.