25 lines
505 B
C++
25 lines
505 B
C++
#ifndef RELAIS_H
|
|
#define RELAIS_H
|
|
|
|
#include "hardware/gpio.h"
|
|
#include "pico/stdlib.h"
|
|
|
|
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
|
|
|
|
class Relais {
|
|
public:
|
|
Relais(uint gpio, gpio_irq_callback_t callback);
|
|
void activate(bool active);
|
|
void on();
|
|
void off();
|
|
|
|
private:
|
|
uint gpio;
|
|
bool lastState;
|
|
gpio_irq_callback_t callback;
|
|
};
|
|
|
|
#endif
|