22 lines
331 B
C
22 lines
331 B
C
|
|
||
|
#ifndef BUTTON_H_
|
||
|
#define BUTTON_H_
|
||
|
|
||
|
#include <avr/io.h>
|
||
|
|
||
|
/* button driver */
|
||
|
#define BUTTON_DDR DDRB
|
||
|
#define BUTTON_PORT PORTB
|
||
|
#define BUTTON_REG PINB
|
||
|
#define BUTTON_PIN 1
|
||
|
|
||
|
typedef enum {
|
||
|
BUTTON_RELEASED = 0,
|
||
|
BUTTON_PRESSED = 1
|
||
|
} button_state_t;
|
||
|
|
||
|
void button_init();
|
||
|
button_state_t button_is_pressed();
|
||
|
|
||
|
|
||
|
#endif // BUTTON_H_
|