22 lines
336 B
C
22 lines
336 B
C
#ifndef DIGITAL_IN_H
|
|
#define DIGITAL_IN_H
|
|
|
|
#include <stdint.h>
|
|
#include <zephyr/drivers/gpio.h>
|
|
|
|
struct Digital_in {
|
|
enum : uint8_t {
|
|
ENCODER_C1 = 0,
|
|
ENCODER_C2 = 1
|
|
};
|
|
|
|
const struct gpio_dt_spec *gpio;
|
|
|
|
explicit Digital_in(uint8_t pin_id);
|
|
|
|
void init();
|
|
bool is_hi();
|
|
bool is_lo();
|
|
};
|
|
|
|
#endif |