VFD modular clock firmware

Dependencies:   DipCortex-EEprom RTC flw mbed

Committer:
Backstr?m
Date:
Tue Feb 24 23:01:40 2015 +0900
Revision:
12:dfb422107412
Parent:
0:f6e68b4ce169
Added tag v1.0.2 for changeset 34b344fdec98

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Backstrom 0:f6e68b4ce169 1 /*
Backstrom 0:f6e68b4ce169 2 * VFD Modular Clock - mbed
Backstrom 0:f6e68b4ce169 3 * (C) 2011-14 Akafugu Corporation
Backstrom 0:f6e68b4ce169 4 *
Backstrom 0:f6e68b4ce169 5 * This program is free software; you can redistribute it and/or modify it under the
Backstrom 0:f6e68b4ce169 6 * terms of the GNU General Public License as published by the Free Software
Backstrom 0:f6e68b4ce169 7 * Foundation; either version 2 of the License, or (at your option) any later
Backstrom 0:f6e68b4ce169 8 * version.
Backstrom 0:f6e68b4ce169 9 *
Backstrom 0:f6e68b4ce169 10 * This program is distributed in the hope that it will be useful, but WITHOUT ANY
Backstrom 0:f6e68b4ce169 11 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
Backstrom 0:f6e68b4ce169 12 * PARTICULAR PURPOSE. See the GNU General Public License for more details.
Backstrom 0:f6e68b4ce169 13 *
Backstrom 0:f6e68b4ce169 14 */
Backstrom 0:f6e68b4ce169 15
Backstrom 0:f6e68b4ce169 16 #ifndef BUTTON_H_
Backstrom 0:f6e68b4ce169 17 #define BUTTON_H_
Backstrom 0:f6e68b4ce169 18
Backstrom 0:f6e68b4ce169 19 #include <stdbool.h>
Backstrom 0:f6e68b4ce169 20
Backstrom 0:f6e68b4ce169 21 struct BUTTON_STATE
Backstrom 0:f6e68b4ce169 22 {
Backstrom 0:f6e68b4ce169 23 bool b1_keydown : 1;
Backstrom 0:f6e68b4ce169 24 bool b1_keyup : 1;
Backstrom 0:f6e68b4ce169 25 bool b1_repeat : 1;
Backstrom 0:f6e68b4ce169 26 bool b2_keydown : 1;
Backstrom 0:f6e68b4ce169 27 bool b2_keyup : 1;
Backstrom 0:f6e68b4ce169 28 bool b2_repeat : 1;
Backstrom 0:f6e68b4ce169 29 bool b3_keydown : 1;
Backstrom 0:f6e68b4ce169 30 bool b3_keyup : 1;
Backstrom 0:f6e68b4ce169 31 bool b3_repeat : 1;
Backstrom 0:f6e68b4ce169 32 bool both_held : 1;
Backstrom 0:f6e68b4ce169 33 bool none_held : 1;
Backstrom 0:f6e68b4ce169 34 };
Backstrom 0:f6e68b4ce169 35
Backstrom 0:f6e68b4ce169 36 void initialize_buttons();
Backstrom 0:f6e68b4ce169 37 void get_button_state(struct BUTTON_STATE* buttons);
Backstrom 0:f6e68b4ce169 38 void button_tick(void);
Backstrom 0:f6e68b4ce169 39
Backstrom 0:f6e68b4ce169 40 uint8_t get_keystatus();
Backstrom 0:f6e68b4ce169 41
Backstrom 0:f6e68b4ce169 42 #endif