Simple LED.
More...
|
| gui_handle_p | gui_led_create (gui_id_t id, float x, float y, float width, float height, gui_handle_p parent, gui_widget_evt_fn evt_fn, uint16_t flags) |
| | Create new led widget. More...
|
| |
| uint8_t | gui_led_setcolor (gui_handle_p h, gui_led_color_t index, gui_color_t color) |
| | Set color to specific part of widget. More...
|
| |
| uint8_t | gui_led_settype (gui_handle_p h, gui_led_type_t type) |
| | Set led type. More...
|
| |
| uint8_t | gui_led_toggle (gui_handle_p h) |
| | Toggle LED state. More...
|
| |
| uint8_t | gui_led_set (gui_handle_p h, uint8_t state) |
| | Set LED value either on (turn on) or off (turn off) More...
|
| |
| uint8_t | gui_led_ison (gui_handle_p h) |
| | Check if led is ON. More...
|
| |
Simple LED.
Led widget is very simple widget used for indication purposes. It can only have ON or OFF status.
Widget is supported in different shapes, defined by gui_led_type_t enumeration.
LED widgets from left: 1. circle ON, circle OFF, rectangle ON, rectangle OFF
Example code of image above:
◆ gui_led_color_t
List of available colors for LED.
| Enumerator |
|---|
| GUI_LED_COLOR_ON | Color index for LED on status
|
| GUI_LED_COLOR_OFF | Color index for LED off status
|
| GUI_LED_COLOR_ON_BORDER | Color index for LED border on status
|
| GUI_LED_COLOR_OFF_BORDER | Color index for LED border off status
|
◆ gui_led_type_t
List of available LED types.
| Enumerator |
|---|
| GUI_LED_TYPE_RECT | Led is rectangular
|
| GUI_LED_TYPE_CIRCLE | Led is circle
|
◆ gui_led_create()
| gui_handle_p gui_led_create |
( |
gui_id_t |
id, |
|
|
float |
x, |
|
|
float |
y, |
|
|
float |
width, |
|
|
float |
height, |
|
|
gui_handle_p |
parent, |
|
|
gui_widget_evt_fn |
evt_fn, |
|
|
uint16_t |
flags |
|
) |
| |
Create new led widget.
- Parameters
-
| [in] | id | Widget unique ID to use for identity for callback processing |
| [in] | x | Widget X position relative to parent widget |
| [in] | y | Widget Y position relative to parent widget |
| [in] | width | Widget width in units of pixels |
| [in] | height | Widget height in units of pixels |
| [in] | parent | Parent widget handle. Set to NULL to use current active parent widget |
| [in] | evt_fn | Custom widget callback function. Set to NULL to use default callback |
| [in] | flags | flags for widget creation |
- Returns
- Widget handle on success,
NULL otherwise
◆ gui_led_ison()
| uint8_t gui_led_ison |
( |
gui_handle_p |
h | ) |
|
Check if led is ON.
- Parameters
-
- Returns
1 on success, 0 otherwise
< Indicates LED is on
< Indicates LED is on
◆ gui_led_set()
| uint8_t gui_led_set |
( |
gui_handle_p |
h, |
|
|
uint8_t |
state |
|
) |
| |
Set LED value either on (turn on) or off (turn off)
- Parameters
-
| [in] | h | Widget handle |
| [in] | state | LED state, either 1 or 0 according to selected state |
- Returns
1 on success, 0 otherwise
◆ gui_led_setcolor()
Set color to specific part of widget.
- Parameters
-
| [in] | h | Widget handle |
| [in] | index | Color index |
| [in] | color | Color value |
- Returns
1 on success, 0 otherwise
◆ gui_led_settype()
Set led type.
- Parameters
-
| [in] | h | Widget handle |
| [in] | type | New type for LED |
- Returns
1 on success, 0 otherwise
◆ gui_led_toggle()
| uint8_t gui_led_toggle |
( |
gui_handle_p |
h | ) |
|
Toggle LED state.
- Parameters
-
- Returns
1 on success, 0 otherwise