]>
Commit | Line | Data |
---|---|---|
1 | /* | |
2 | * unzap firmware | |
3 | * | |
4 | * (c) by Alexander Neumann <alexander@lochraster.org> | |
5 | * | |
6 | * This program is free software; you can redistribute it and/or modify | |
7 | * it under the terms of the GNU General Public License version 2 as | |
8 | * published by the Free Software Foundation. | |
9 | * | |
10 | * This program is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | * GNU General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU General Public License | |
16 | * along with this program; if not, write to the Free Software | |
17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
18 | * | |
19 | * For more information on the GPL, please go to: | |
20 | * http://www.gnu.org/copyleft/gpl.html | |
21 | */ | |
22 | ||
23 | #ifndef __UI_H | |
24 | #define __UI_H | |
25 | ||
26 | #include <stdint.h> | |
27 | #include <stdbool.h> | |
28 | ||
29 | /* helper macros */ | |
30 | #define LED1_ON() LED_PORT |= _BV(LED1_PIN) | |
31 | #define LED1_OFF() LED_PORT &= ~_BV(LED1_PIN) | |
32 | #define LED1_TOGGLE() LED_PORT ^= _BV(LED1_PIN) | |
33 | #define LED2_ON() LED_PORT |= _BV(LED2_PIN) | |
34 | #define LED2_OFF() LED_PORT &= ~_BV(LED2_PIN) | |
35 | #define LED2_TOGGLE() LED_PORT ^= _BV(LED2_PIN) | |
36 | ||
37 | /* initialize the button and led pins */ | |
38 | void ui_init(void); | |
39 | ||
40 | /* blink out a sequence (LSB first), every bit is 150ms long */ | |
41 | void ui_blink(uint8_t sequence1, uint8_t sequence2); | |
42 | ||
43 | /* check if the current blink sequency is done */ | |
44 | bool ui_blinking(void); | |
45 | ||
46 | /* poll for user actions */ | |
47 | void ui_poll(void); | |
48 | ||
49 | #endif |