Sensor Data Logger v1.0
ESP32 Data Logger
Loading...
Searching...
No Matches
button.h File Reference

Hardware Application Layer for Buttons. More...

#include "driver/gpio.h"
Include dependency graph for button.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  button_t
 Custom button_t structure. More...
 

Macros

#define ESP_INTR_FLAG_DEFAULT   0
 

Typedefs

typedef struct button_t button_t
 

Functions

void button_enable (button_t *const button)
 button_t Initialization for buttons More...
 
int read_button (button_t *const button)
 buttonRead will read the gpio pin More...
 
void button_enable_irq (button_t *const button)
 buttonInitIRQ will intialize button for interrupt routine More...
 
void button_interrupt (void *arg)
 buttonInterrupt will be an general routine for buttons interrupts. More...
 

Detailed Description

Hardware Application Layer for Buttons.

Author
Jesus Minjares (https://github.com/jminjares4)
Version
0.1
Date
2022-08-09

Macro Definition Documentation

◆ ESP_INTR_FLAG_DEFAULT

#define ESP_INTR_FLAG_DEFAULT   0

default interrupt

Typedef Documentation

◆ button_t

typedef struct button_t button_t

Function Documentation

◆ button_enable()

void button_enable ( button_t *const  button)

button_t Initialization for buttons

Parameters
buttonpass a button_t by reference
Returns
None
Note
buttonInit() is use when the button or input will be read as high or low level for interrupt intitialization
See also
buttonInitIRQ()
Parameters
buttonpass a button_t by reference
Returns
None
Note
button_enable() is use when the button or input will be read as high or low level for interrupt intitialization
See also
button_enable_irq()

◆ button_enable_irq()

void button_enable_irq ( button_t *const  button)

buttonInitIRQ will intialize button for interrupt routine

Parameters
buttonpass a button_t by referene
Returns
None
Parameters
buttonpass a button_t by referene
Returns
None

◆ button_interrupt()

void button_interrupt ( void *  arg)

buttonInterrupt will be an general routine for buttons interrupts.

Parameters
arginterrupt argument

◆ read_button()

int read_button ( button_t *const  button)

buttonRead will read the gpio pin

Parameters
buttonpass a button_t by reference
Returns
int return either high or low || 0 or 1

buttonRead will read the gpio pin

Parameters
buttonpass a button_t by reference
Returns
int return either high or low || 0 or 1