PiPower
ac0ff3c (Mon Feb 11 21:44:30 2019 -0500)
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
/home/travis/build/larsks/pipower/input.h
Go to the documentation of this file.
1
4
#ifndef _input_h
5
#define _input_h
6
7
#include <stdint.h>
8
#include "
bool.h
"
9
10
#ifdef __cplusplus
11
extern
"C"
{
12
#endif
13
14
typedef
struct
Input
{
15
uint8_t
pin
;
16
bool
state
,
17
last_state
;
18
}
Input
;
19
20
void
input_new
(
Input
*input,
int
pin
,
bool
pullup);
21
extern
void
input_delete(
Input
*);
22
extern
void
input_update
(
Input
*);
23
extern
bool
input_went_high
(
Input
*);
24
extern
bool
input_went_low
(
Input
*);
25
extern
bool
input_is_high
(
Input
*);
26
extern
bool
input_is_low
(
Input
*);
27
28
#ifdef __cplusplus
29
}
30
#endif
31
32
#endif
input_update
void input_update(Input *)
Read the state of the pin.
Definition:
input.c:31
input_went_high
bool input_went_high(Input *)
Return true if the pin state has gone high.
Definition:
input.c:40
Input
Definition:
input.h:14
Input::last_state
bool last_state
Pin state last time we checked.
Definition:
input.h:16
Input::state
bool state
Current pin state.
Definition:
input.h:16
input_is_high
bool input_is_high(Input *)
Return true if the pin is high.
Definition:
input.c:58
input_new
void input_new(Input *input, int pin, bool pullup)
Create a new Input object.
Definition:
input.c:13
input_went_low
bool input_went_low(Input *)
Return true if the pin state has gone low.
Definition:
input.c:51
bool.h
a simple replacement for stdbool.h.
input_is_low
bool input_is_low(Input *)
Return true if the pin is low.
Definition:
input.c:63
Input::pin
uint8_t pin
Pin associated with this input.
Definition:
input.h:15
Generated by
1.8.11