Sensor Data Logger
v1.0
ESP32 Data Logger
Loading...
Searching...
No Matches
button.h
Go to the documentation of this file.
1
11
#ifndef _BUTTON_H_
12
#define _BUTTON_H_
13
14
#include "driver/gpio.h"
15
16
#define ESP_INTR_FLAG_DEFAULT 0
37
typedef
struct
button_t
38
{
39
gpio_num_t
pin
;
40
union
41
{
42
gpio_pullup_t
up
;
43
gpio_pulldown_t
down
;
44
}
pull_sel
;
45
void (*
func
)(
void
*arg);
46
}
button_t
;
47
55
void
button_enable
(
button_t
*
const
button);
56
63
int
read_button
(
button_t
*
const
button);
64
71
void
button_enable_irq
(
button_t
*
const
button);
72
78
extern
void
button_interrupt
(
void
*arg);
79
80
#endif
button_interrupt
void button_interrupt(void *arg)
buttonInterrupt will be an general routine for buttons interrupts.
button_enable_irq
void button_enable_irq(button_t *const button)
buttonInitIRQ will intialize button for interrupt routine
Definition:
button.c:67
button_enable
void button_enable(button_t *const button)
button_t Initialization for buttons
Definition:
button.c:24
read_button
int read_button(button_t *const button)
buttonRead will read the gpio pin
Definition:
button.c:56
button_t
Custom button_t structure.
Definition:
button.h:38
button_t::down
gpio_pulldown_t down
Definition:
button.h:43
button_t::pull_sel
union button_t::@0 pull_sel
button_t::pin
gpio_num_t pin
Definition:
button.h:39
button_t::func
void(* func)(void *arg)
Definition:
button.h:45
button_t::up
gpio_pullup_t up
Definition:
button.h:42
firmware
components
button
button.h
v1.0