Elevator v2.0
Elevator Documenation
Loading...
Searching...
No Matches
Button Struct Reference

Custom Button structure to automate button setup. More...

#include <button.h>

Collaboration diagram for Button:
Collaboration graph

Data Fields

gpio_num_t gpio
 
union {
   gpio_pullup_t   up
 
   gpio_pulldown_t   down
 
pull_sel
 
void(* func )(void *arg)
 

Detailed Description

Custom Button structure to automate button setup.

This structure allows the user to select its gpio pin, and set for pullup or pulldown base on configuration and lastly if the button will be read as input or interrupt.

Example

typedef struct{
gpio_num_t gpio; // gpio number
union{
gpio_pullup_t up; //pullup
gpio_pulldown_t down; //pulldown
}pull_sel; //select configuration
void (*func)(void *arg); //gpio interrupt routine
Custom Button structure to automate button setup.
Definition: button.h:42
gpio_num_t gpio
Definition: button.h:43
gpio_pulldown_t down
Definition: button.h:47
union Button::@0 pull_sel
void(* func)(void *arg)
Definition: button.h:49
gpio_pullup_t up
Definition: button.h:46

Field Documentation

◆ down

gpio_pulldown_t Button::down

◆ func

void(* Button::func) (void *arg)

gpio interrupt routine

◆ gpio

gpio_num_t Button::gpio

gpio number

◆ 

union { ... } Button::pull_sel

gpio configuration for pullup or pulldown

◆ up

gpio_pullup_t Button::up

The documentation for this struct was generated from the following file: