Safe Sprinkler
Master/slave irrigation system (ESP-NOW + LoRaWAN)
Loading...
Searching...
No Matches
include
general
switch.h
Go to the documentation of this file.
1
#ifndef SWITCH_H
2
#define SWITCH_H
3
4
#include "driver/gpio.h"
5
#include "esp_attr.h"
6
#include "esp_err.h"
7
8
typedef
enum
9
{
10
SWITCH_OFF
= 0,
11
SWITCH_ON
= 1,
12
}
switch_state_t
;
13
14
typedef
struct
15
{
16
gpio_num_t
pin
;
17
switch_state_t
state
;
18
int64_t
last_interrupt_time
;
19
}
on_off_switch_t
;
20
30
void
IRAM_ATTR
switch_isr_handler
(
void
* arg);
31
32
#endif
on_off_switch_t
Definition
switch.h:15
on_off_switch_t::pin
int pin
Definition
switch.h:16
on_off_switch_t::last_interrupt_time
int64_t last_interrupt_time
Definition
switch.h:18
on_off_switch_t::state
switch_state_t state
Definition
switch.h:17
switch_state_t
switch_state_t
Definition
switch.h:9
SWITCH_OFF
@ SWITCH_OFF
Definition
switch.h:10
SWITCH_ON
@ SWITCH_ON
Definition
switch.h:11
switch_isr_handler
void IRAM_ATTR switch_isr_handler(void *arg)
GPIO interrupt handler for an on/off switch.
Generated by
1.9.8