nRF Connect SDK API 2.8.99
|
Module for handling buttons and LEDs on Nordic DKs. More...
#include <zephyr/types.h>
#include <zephyr/sys/slist.h>
Go to the source code of this file.
Data Structures | |
struct | button_handler |
Macros | |
#define | DK_NO_LEDS_MSK (0) |
#define | DK_LED1 0 |
#define | DK_LED2 1 |
#define | DK_LED3 2 |
#define | DK_LED4 3 |
#define | DK_LED1_MSK BIT(DK_LED1) |
#define | DK_LED2_MSK BIT(DK_LED2) |
#define | DK_LED3_MSK BIT(DK_LED3) |
#define | DK_LED4_MSK BIT(DK_LED4) |
#define | DK_ALL_LEDS_MSK |
#define | DK_NO_BTNS_MSK (0) |
#define | DK_BTN1 0 |
#define | DK_BTN2 1 |
#define | DK_BTN3 2 |
#define | DK_BTN4 3 |
#define | DK_BTN1_MSK BIT(DK_BTN1) |
#define | DK_BTN2_MSK BIT(DK_BTN2) |
#define | DK_BTN3_MSK BIT(DK_BTN3) |
#define | DK_BTN4_MSK BIT(DK_BTN4) |
#define | DK_ALL_BTNS_MSK |
Typedefs | |
typedef void(* | button_handler_t) (uint32_t button_state, uint32_t has_changed) |
Callback that is executed when a button state change is detected. | |
Functions | |
int | dk_leds_init (void) |
Initialize the library to control the LEDs. | |
int | dk_buttons_init (button_handler_t button_handler) |
Initialize the library to read the button state. | |
void | dk_button_handler_add (struct button_handler *handler) |
Add a dynamic button handler callback. | |
int | dk_button_handler_remove (struct button_handler *handler) |
Remove a dynamic button handler callback. | |
void | dk_read_buttons (uint32_t *button_state, uint32_t *has_changed) |
Read current button states. | |
uint32_t | dk_get_buttons (void) |
Get current button state from internal variable. | |
int | dk_set_leds (uint32_t leds) |
Set value of LED pins as specified in one bitmask. | |
int | dk_set_leds_state (uint32_t leds_on_mask, uint32_t leds_off_mask) |
Set value of LED pins as specified in two bitmasks. | |
int | dk_set_led (uint8_t led_idx, uint32_t val) |
Set a single LED value. | |
int | dk_set_led_on (uint8_t led_idx) |
Turn a single LED on. | |
int | dk_set_led_off (uint8_t led_idx) |
Turn a single LED off. | |
Module for handling buttons and LEDs on Nordic DKs.