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
37typedef struct button_t
38{
39 gpio_num_t pin;
40 union
41 {
42 gpio_pullup_t up;
43 gpio_pulldown_t down;
45 void (*func)(void *arg);
47
55void button_enable(button_t * const button);
56
63int read_button(button_t * const button);
64
71void button_enable_irq(button_t * const button);
72
78extern void button_interrupt(void *arg);
79
80#endif
void button_interrupt(void *arg)
buttonInterrupt will be an general routine for buttons interrupts.
void button_enable_irq(button_t *const button)
buttonInitIRQ will intialize button for interrupt routine
Definition: button.c:67
void button_enable(button_t *const button)
button_t Initialization for buttons
Definition: button.c:24
int read_button(button_t *const button)
buttonRead will read the gpio pin
Definition: button.c:56
Custom button_t structure.
Definition: button.h:38
gpio_pulldown_t down
Definition: button.h:43
union button_t::@0 pull_sel
gpio_num_t pin
Definition: button.h:39
void(* func)(void *arg)
Definition: button.h:45
gpio_pullup_t up
Definition: button.h:42