PiPower  ac0ff3c (Mon Feb 11 21:44:30 2019 -0500)
Data Structures | Typedefs | Functions
/home/travis/build/larsks/pipower/button.h File Reference

Simple debouncing routine from https://hackaday.com/2015/12/10/embed-with-elliot-debounce-your-noisy-buttons-part-ii/ More...

#include <stdint.h>
#include "bool.h"

Go to the source code of this file.

Data Structures

struct  Button
 

Typedefs

typedef struct Button Button
 

Functions

void button_new (Button *button, uint8_t pin, uint8_t poll_freq)
 Create a new Button object. More...
 
void button_destroy (Button *)
 
void button_update (Button *)
 Push current button state onto history. More...
 
bool button_is_pressed (Button *)
 Return true if button has been pressed. More...
 
bool button_is_released (Button *)
 Return true if button has been released. More...
 
bool button_is_up (Button *)
 Return true if button is up.
 
bool button_is_down (Button *)
 Return true if button is down.
 

Detailed Description

Simple debouncing routine from https://hackaday.com/2015/12/10/embed-with-elliot-debounce-your-noisy-buttons-part-ii/

Function Documentation

bool button_is_pressed ( Button button)

Return true if button has been pressed.

bool button_is_released ( Button button)

Return true if button has been released.

void button_new ( Button button,
uint8_t  pin,
uint8_t  poll_freq 
)

Create a new Button object.

void button_update ( Button button)

Push current button state onto history.