17#ifndef _PICO_STATUS_LED_H
18#define _PICO_STATUS_LED_H
22#if defined(CYW43_WL_GPIO_LED_PIN)
33#ifndef PICO_STATUS_LED_AVAILABLE
34#if defined(PICO_DEFAULT_LED_PIN) || defined(CYW43_WL_GPIO_LED_PIN)
35#define PICO_STATUS_LED_AVAILABLE 1
37#define PICO_STATUS_LED_AVAILABLE 0
42#ifndef PICO_COLORED_STATUS_LED_AVAILABLE
43#ifdef PICO_DEFAULT_WS2812_PIN
44#define PICO_COLORED_STATUS_LED_AVAILABLE 1
46#define PICO_COLORED_STATUS_LED_AVAILABLE 0
51#ifndef PICO_STATUS_LED_VIA_COLORED_STATUS_LED
52#define PICO_STATUS_LED_VIA_COLORED_STATUS_LED (PICO_COLORED_STATUS_LED_AVAILABLE && !PICO_STATUS_LED_AVAILABLE)
56#ifndef PICO_COLORED_STATUS_LED_USES_WRGB
57#define PICO_COLORED_STATUS_LED_USES_WRGB 0
63#ifndef PICO_COLORED_STATUS_LED_COLOR_FROM_RGB
64#define PICO_COLORED_STATUS_LED_COLOR_FROM_RGB(r, g, b) (((r) << 16) | ((g) << 8) | (b))
72#ifndef PICO_COLORED_STATUS_LED_COLOR_FROM_WRGB
73#define PICO_COLORED_STATUS_LED_COLOR_FROM_WRGB(w, r, g, b) (((w) << 24) | ((r) << 16) | ((g) << 8) | (b))
77#ifndef PICO_DEFAULT_COLORED_STATUS_LED_ON_COLOR
78#if PICO_COLORED_STATUS_LED_USES_WRGB
79#define PICO_DEFAULT_COLORED_STATUS_LED_ON_COLOR PICO_COLORED_STATUS_LED_COLOR_FROM_WRGB(0xaa, 0, 0, 0)
81#define PICO_DEFAULT_COLORED_STATUS_LED_ON_COLOR PICO_COLORED_STATUS_LED_COLOR_FROM_RGB(0xaa, 0xaa, 0xaa)
123 return PICO_COLORED_STATUS_LED_AVAILABLE;
132 return PICO_STATUS_LED_VIA_COLORED_STATUS_LED;
147 return PICO_STATUS_LED_AVAILABLE;
200#if defined(PICO_DEFAULT_LED_PIN)
201 #if PICO_DEFAULT_LED_PIN_INVERTED
202 gpio_put(PICO_DEFAULT_LED_PIN, !led_on);
204 gpio_put(PICO_DEFAULT_LED_PIN, led_on);
207#elif defined(CYW43_WL_GPIO_LED_PIN)
208 cyw43_gpio_set(&cyw43_state, CYW43_WL_GPIO_LED_PIN, led_on);
226#if defined(PICO_DEFAULT_LED_PIN)
227 #if PICO_DEFAULT_LED_PIN_INVERTED
228 return !
gpio_get(PICO_DEFAULT_LED_PIN);
230 return gpio_get(PICO_DEFAULT_LED_PIN);
232#elif defined CYW43_WL_GPIO_LED_PIN
234 cyw43_gpio_get(&cyw43_state, CYW43_WL_GPIO_LED_PIN, &value);
static void gpio_put(uint gpio, bool value)
Drive a single GPIO high/low.
Definition gpio.h:1155
static bool gpio_get(uint gpio)
Get state of a single specified GPIO.
Definition gpio.h:869
static bool status_led_set_state(bool led_on)
Set the status LED on or off.
Definition status_led.h:196
bool status_led_init_with_context(struct async_context *context)
Initialise the status LED(s).
Definition status_led.c:150
static bool status_led_supported(void)
Determine if the single-color status_led_ APIs are supported (i.e. if there is a regular LED,...
Definition status_led.h:143
bool colored_status_led_set_on_with_color(uint32_t color)
Ensure the colored status LED is on, with the specified color.
Definition status_led.c:69
static bool status_led_get_state()
Get the state of the status LED.
Definition status_led.h:222
void status_led_deinit()
De-initialize the status LED(s).
Definition status_led.c:155
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.
Definition status_led.h:131
bool colored_status_led_get_state(void)
Get the state of the colored status LED.
Definition status_led.c:94
uint32_t colored_status_led_get_on_color(void)
Get the color used for the status LED value when it is on.
Definition status_led.c:74
bool colored_status_led_set_state(bool led_on)
Set the colored status LED on or off.
Definition status_led.c:78
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,...
Definition status_led.h:122
bool status_led_init(void)
Initialize the status LED(s).
Definition status_led.c:146
Base structure type of all async_contexts. For details about its use, see pico_async_context.
Definition async_context.h:179