17#ifndef _PICO_STATUS_LED_H
18#define _PICO_STATUS_LED_H
26#if defined(CYW43_WL_GPIO_LED_PIN)
34#ifndef PICO_STATUS_LED_AVAILABLE
35#if defined(PICO_DEFAULT_LED_PIN) || defined(CYW43_WL_GPIO_LED_PIN)
36#define PICO_STATUS_LED_AVAILABLE 1
38#define PICO_STATUS_LED_AVAILABLE 0
43#ifndef PICO_COLORED_STATUS_LED_AVAILABLE
44#ifdef PICO_DEFAULT_WS2812_PIN
45#define PICO_COLORED_STATUS_LED_AVAILABLE 1
47#define PICO_COLORED_STATUS_LED_AVAILABLE 0
52#ifndef PICO_STATUS_LED_VIA_COLORED_STATUS_LED
53#define PICO_STATUS_LED_VIA_COLORED_STATUS_LED (PICO_COLORED_STATUS_LED_AVAILABLE && !PICO_STATUS_LED_AVAILABLE)
57#ifndef PICO_COLORED_STATUS_LED_USES_WRGB
58#define PICO_COLORED_STATUS_LED_USES_WRGB 0
64#ifndef PICO_COLORED_STATUS_LED_COLOR_FROM_RGB
65#define PICO_COLORED_STATUS_LED_COLOR_FROM_RGB(r, g, b) (((r) << 16) | ((g) << 8) | (b))
73#ifndef PICO_COLORED_STATUS_LED_COLOR_FROM_WRGB
74#define PICO_COLORED_STATUS_LED_COLOR_FROM_WRGB(w, r, g, b) (((w) << 24) | ((r) << 16) | ((g) << 8) | (b))
78#ifndef PICO_DEFAULT_COLORED_STATUS_LED_ON_COLOR
79#if PICO_COLORED_STATUS_LED_USES_WRGB
80#define PICO_DEFAULT_COLORED_STATUS_LED_ON_COLOR PICO_COLORED_STATUS_LED_COLOR_FROM_WRGB(0xaa, 0, 0, 0)
82#define PICO_DEFAULT_COLORED_STATUS_LED_ON_COLOR PICO_COLORED_STATUS_LED_COLOR_FROM_RGB(0xaa, 0xaa, 0xaa)
124 return PICO_COLORED_STATUS_LED_AVAILABLE;
133 return PICO_STATUS_LED_VIA_COLORED_STATUS_LED;
148 return PICO_STATUS_LED_AVAILABLE;
201#if defined(PICO_DEFAULT_LED_PIN)
202 #if PICO_DEFAULT_LED_PIN_INVERTED
203 gpio_put(PICO_DEFAULT_LED_PIN, !led_on);
205 gpio_put(PICO_DEFAULT_LED_PIN, led_on);
208#elif defined(CYW43_WL_GPIO_LED_PIN)
227#if defined(PICO_DEFAULT_LED_PIN)
228 #if PICO_DEFAULT_LED_PIN_INVERTED
229 return !
gpio_get(PICO_DEFAULT_LED_PIN);
231 return gpio_get(PICO_DEFAULT_LED_PIN);
233#elif defined CYW43_WL_GPIO_LED_PIN
int cyw43_gpio_get(cyw43_t *self, int gpio, bool *val)
Get the value of the cyw43 gpio.
Definition cyw43_ctrl.c:749
int cyw43_gpio_set(cyw43_t *self, int gpio, bool val)
Set the value of the cyw43 gpio.
Definition cyw43_ctrl.c:737
static void gpio_put(uint gpio, bool value)
Drive a single GPIO high/low.
Definition gpio.h:1180
static bool gpio_get(uint gpio)
Get state of a single specified GPIO.
Definition gpio.h:894
static bool status_led_set_state(bool led_on)
Set the status LED on or off.
Definition status_led.h:197
bool status_led_init_with_context(struct async_context *context)
Initialise the status LED(s).
Definition status_led.c:235
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:144
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:151
static bool status_led_get_state()
Get the state of the status LED.
Definition status_led.h:223
void status_led_deinit()
De-initialize the status LED(s).
Definition status_led.c:240
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:132
bool colored_status_led_get_state(void)
Get the state of the colored status LED.
Definition status_led.c:177
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:156
bool colored_status_led_set_state(bool led_on)
Set the colored status LED on or off.
Definition status_led.c:160
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:123
bool status_led_init(void)
Initialize the status LED(s).
Definition status_led.c:231
Base structure type of all async_contexts. For details about its use, see pico_async_context.
Definition async_context.h:179