Elevator v2.0
Elevator Documenation
Loading...
Searching...
No Matches
button.h File Reference

Hardware Application Layer for Buttons. More...

#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#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
 Custom Button structure to automate button setup. More...
 

Macros

#define ESP_INTR_FLAG_DEFAULT   0
 
#define PULL_SEL_EN   1
 

Typedefs

typedef struct Button Button
 

Functions

void buttonInit (Button *button)
 Button Initialization for buttons. More...
 
int buttonRead (Button *button)
 buttonRead will read the gpio pin More...
 
void buttonInitIRQ (Button *button)
 buttonInitIRQ will intialize button for interrupt routine More...
 
void buttonInterrupt (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
2021-11-27

Macro Definition Documentation

◆ ESP_INTR_FLAG_DEFAULT

#define ESP_INTR_FLAG_DEFAULT   0

◆ PULL_SEL_EN

#define PULL_SEL_EN   1

Typedef Documentation

◆ Button

typedef struct Button Button

Function Documentation

◆ buttonInit()

void buttonInit ( Button button)

Button Initialization for buttons.

Parameters
buttonpass a Button 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()

◆ buttonInitIRQ()

void buttonInitIRQ ( Button button)

buttonInitIRQ will intialize button for interrupt routine

Parameters
buttonpass a Button by referene
Returns
None
Parameters
buttonpass a Button by referene
Returns
None

◆ buttonInterrupt()

void buttonInterrupt ( void *  arg)

buttonInterrupt will be an general routine for buttons interrupts.

Parameters
arginterrupt argument

◆ buttonRead()

int buttonRead ( Button button)

buttonRead will read the gpio pin

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