25 lines
444 B
C++
25 lines
444 B
C++
#pragma once
|
|
|
|
|
|
#include <zephyr/drivers/gpio.h>
|
|
|
|
|
|
class Buttons {
|
|
public:
|
|
|
|
enum Buttons_e {
|
|
BUTTON1,
|
|
BUTTON2,
|
|
NR_BUTTONS,
|
|
};
|
|
|
|
Buttons();
|
|
~Buttons();
|
|
int buttons_init();
|
|
static void buttons_cb(const struct device *dev, struct gpio_callback *cb, uint32_t pins);
|
|
static void debounce_cb(struct k_work *work);
|
|
|
|
private:
|
|
static const struct gpio_dt_spec buttons[NR_BUTTONS];
|
|
static struct gpio_callback buttons_cb_data[NR_BUTTONS];
|
|
}; |