9
9
*
10
10
* \brief Enables access to the on-board status LED(s)
11
11
*
12
- * Boards usually have access to an on-board status LEDs which are configured via the board header (\see PICO_DEFAULT_LED_PIN and \see PICO_DEFAULT_WS2812_PIN)
13
- * This library hides the details so you can use the status LEDs for all boards without changing your code.
12
+ * 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).
13
+ * This library hides the low-level details so you can use the status LEDs for all boards without changing your code.
14
+ * \note If your board has both a single-color LED and a colored LED, you can independently control the single-color LED with the `status_led_` APIs, and the colored LED with the `colored_status_led_` APIs
14
15
*/
15
16
16
17
#ifndef _PICO_STATUS_LED_H
@@ -28,7 +29,7 @@ struct async_context;
28
29
extern "C" {
29
30
#endif
30
31
31
- // PICO_CONFIG: PICO_STATUS_LED_AVAILABLE, Indicate whether a non-colored status LED is available, type=bool, default=1 if PICO_DEFAULT_LED_PIN or CYW43_WL_GPIO_LED_PIN is defined; may be set by the user to 0 to not use either even if they are available, group=pico_status_led
32
+ // PICO_CONFIG: PICO_STATUS_LED_AVAILABLE, Indicate whether a single-color status LED is available, type=bool, default=1 if PICO_DEFAULT_LED_PIN or CYW43_WL_GPIO_LED_PIN is defined; may be set by the user to 0 to not use either even if they are available, group=pico_status_led
32
33
#ifndef PICO_STATUS_LED_AVAILABLE
33
34
#if defined(PICO_DEFAULT_LED_PIN ) || defined(CYW43_WL_GPIO_LED_PIN )
34
35
#define PICO_STATUS_LED_AVAILABLE 1
@@ -66,7 +67,7 @@ extern "C" {
66
67
/*! \brief Generate an WRGB color value for \ref colored_status_led_set_on_with_color
67
68
* \ingroup pico_status_led
68
69
*
69
- * \note: If your hardware does not support a white pixel, the white component is ignored
70
+ * \note If your hardware does not support a white pixel, the white component is ignored
70
71
*/
71
72
#ifndef PICO_COLORED_STATUS_LED_COLOR_FROM_WRGB
72
73
#define PICO_COLORED_STATUS_LED_COLOR_FROM_WRGB (w , r , g , b ) (((w) << 24) | ((r) << 16) | ((g) << 8) | (b))
@@ -92,7 +93,7 @@ extern "C" {
92
93
* If the application already has an async context (e.g. created by cyw43_arch_init) you should use \ref
93
94
* status_led_init_with_context instead and pass it the \ref async_context already created by your application
94
95
*
95
- * \note: You must call this function (or \ref status_led_init_with_context) before using any other pico_status_led functions.
96
+ * \note You must call this function (or \ref status_led_init_with_context) before using any other pico_status_led functions.
96
97
*
97
98
* \return Returns true if the LED was initialized successfully, otherwise false on failure
98
99
* \sa status_led_init_with_context
@@ -104,7 +105,7 @@ bool status_led_init(void);
104
105
*
105
106
* Initialize the status LED(s) and the resources they need before use.
106
107
*
107
- * \note: You must call this function (or \ref status_led_init) before using any other pico_status_led functions.
108
+ * \note You must call this function (or \ref status_led_init) before using any other pico_status_led functions.
108
109
*
109
110
* \param context An \ref async_context used to communicate with the status LED (e.g. on Pico W or Pico 2 W)
110
111
* \return Returns true if the LED was initialized successfully, otherwise false on failure
@@ -122,19 +123,20 @@ static inline bool colored_status_led_supported(void) {
122
123
return PICO_COLORED_STATUS_LED_AVAILABLE ;
123
124
}
124
125
125
- /*! \brief Determine if the colored status LED is being used for the non-colored `status_led_` APIs
126
+ /*! \brief Determine if the colored status LED is being used for the single-color `status_led_` APIs
126
127
* \ingroup pico_status_led
127
- * \return true if the olored status LED is being used for the non-colored `status_led_` API
128
+ * \return true if the colored status LED is being used for the single-color `status_led_` API
128
129
* \sa PICO_STATUS_LED_VIA_COLORED_STATUS_LED
129
130
*/
130
131
static inline bool status_led_via_colored_status_led (void ) {
131
132
return PICO_STATUS_LED_VIA_COLORED_STATUS_LED ;
132
133
}
133
134
134
- /*! \brief Determine if the non-colored `status_led_` APIs are supported (i.e. if there is a regular LED, and its
135
+ /*! \brief Determine if the single-color `status_led_` APIs are supported (i.e. if there is a regular LED, and its
135
136
* use isn't disabled via \ref PICO_STATUS_LED_AVAILABLE being set to 0, or if the colored status LED is being used for
137
+ * the single-color `status_led_` APIs
136
138
* \ingroup pico_status_led
137
- * \return true if the non-colored status LED API is available and expected to produce visible results
139
+ * \return true if the single-color status LED API is available and expected to produce visible results
138
140
* \sa PICO_STATUS_LED_AVAILABLE
139
141
* \sa PICO_STATUS_LED_VIA_COLORED_STATUS_LED
140
142
*/
@@ -148,7 +150,7 @@ static inline bool status_led_supported(void) {
148
150
/*! \brief Set the colored status LED on or off
149
151
* \ingroup pico_status_led
150
152
*
151
- * \note: If your hardware does not support a colored status LED (\see PICO_DEFAULT_WS2812_PIN), this function does nothing and returns false.
153
+ * \note If your hardware does not support a colored status LED (PICO_DEFAULT_WS2812_PIN), this function does nothing and returns false.
152
154
*
153
155
* \param led_on true to turn the colored LED on. Pass false to turn the colored LED off
154
156
* \return true if the colored status LED could be set, otherwise false
@@ -158,7 +160,7 @@ bool colored_status_led_set_state(bool led_on);
158
160
/*! \brief Get the state of the colored status LED
159
161
* \ingroup pico_status_led
160
162
*
161
- * \note: If your hardware does not support a colored status LED (\see PICO_DEFAULT_WS2812_PIN), this function returns false.
163
+ * \note If your hardware does not support a colored status LED (PICO_DEFAULT_WS2812_PIN), this function returns false.
162
164
*
163
165
* \return true if the colored status LED is on, or false if the colored status LED is off
164
166
*/
@@ -167,17 +169,17 @@ bool colored_status_led_get_state(void);
167
169
/*! \brief Ensure the colored status LED is on, with the specified color
168
170
* \ingroup pico_status_led
169
171
*
170
- * \note: If your hardware does not support a colored status LED (\see PICO_DEFAULT_WS2812_PIN), this function does nothing and returns false.
172
+ * \note If your hardware does not support a colored status LED (PICO_DEFAULT_WS2812_PIN), this function does nothing and returns false.
171
173
*
172
174
* \param color The color to use for the colored status LED when it is on, in 0xWWRRGGBB format
173
- * \return true if the coloured status LED could be set, otherwise false on failure
175
+ * \return true if the colored status LED could be set, otherwise false on failure
174
176
*/
175
177
bool colored_status_led_set_on_with_color (uint32_t color );
176
178
177
179
/*! \brief Get the color used for the status LED value when it is on
178
180
* \ingroup pico_status_led
179
181
*
180
- * \note: If your hardware does not support a colored status LED (\see PICO_DEFAULT_WS2812_PIN), this function always returns 0x0.
182
+ * \note If your hardware does not support a colored status LED (PICO_DEFAULT_WS2812_PIN), this function always returns 0x0.
181
183
*
182
184
* \return The color used for the colored status LED when it is on, in 0xWWRRGGBB format
183
185
*/
@@ -186,7 +188,7 @@ uint32_t colored_status_led_get_on_color(void);
186
188
/*! \brief Set the status LED on or off
187
189
* \ingroup pico_status_led
188
190
*
189
- * \note: If your hardware does not support a status LED (\see PICO_DEFAULT_LED_PIN) , this function does nothing and returns false.
191
+ * \note If your hardware does not support a status LED, this function does nothing and returns false.
190
192
*
191
193
* \param led_on true to turn the LED on. Pass false to turn the LED off
192
194
* \return true if the status LED could be set, otherwise false
@@ -213,7 +215,7 @@ static inline bool status_led_set_state(bool led_on) {
213
215
/*! \brief Get the state of the status LED
214
216
* \ingroup pico_status_led
215
217
*
216
- * \note: If your hardware does not support a status LED (\see PICO_DEFAULT_LED_PIN) , this function always returns false.
218
+ * \note If your hardware does not support a status LED, this function always returns false.
217
219
*
218
220
* \return true if the status LED is on, or false if the status LED is off
219
221
*/
0 commit comments