gbmanager/src/relais.h

25 lines
505 B
C
Raw Normal View History

2022-05-31 13:53:19 +02:00
#ifndef RELAIS_H
#define RELAIS_H
#include "hardware/gpio.h"
2022-05-31 14:28:15 +02:00
#include "pico/stdlib.h"
2022-05-31 13:53:19 +02:00
extern const uint BUTTON_1_PIN; // declared in gbmanager.cpp
extern const uint BUTTON_2_PIN; // declared in gbmanager.cpp
extern const uint BUTTON_3_PIN; // declared in gbmanager.cpp
2022-05-31 13:53:19 +02:00
class Relais {
2022-05-31 14:28:15 +02:00
public:
Relais(uint gpio, gpio_irq_callback_t callback);
2022-05-31 13:53:19 +02:00
void activate(bool active);
void on();
void off();
2022-05-31 14:28:15 +02:00
private:
2022-05-31 13:53:19 +02:00
uint gpio;
bool lastState;
gpio_irq_callback_t callback;
2022-05-31 13:53:19 +02:00
};
#endif