nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
button_handler.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#ifndef _BUTTON_HANDLER_H_
8#define _BUTTON_HANDLER_H_
9
10#include <stdint.h>
11#include <zephyr/drivers/gpio.h>
12
13struct btn_config {
14 const char *btn_name;
15 uint8_t btn_pin;
16 uint32_t btn_cfg_mask;
17};
18
27
35int button_pressed(gpio_pin_t button_pin, bool *button_pressed);
36
37#endif /* _BUTTON_HANDLER_H_ */
int button_handler_init(void)
Initialize button handler, with buttons defined in button_assignments.h.
int button_pressed(gpio_pin_t button_pin, bool *button_pressed)
Check button state.
uint8_t btn_pin
Definition: button_handler.h:15
uint32_t btn_cfg_mask
Definition: button_handler.h:16
const char * btn_name
Definition: button_handler.h:14
Definition: button_handler.h:13