Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Maple_alarm_clock.h@0:0be38b583cf7, 2011-09-25 (annotated)
- Committer:
- uehara00
- Date:
- Sun Sep 25 11:37:21 2011 +0000
- Revision:
- 0:0be38b583cf7
- Child:
- 1:aefa1992ce0f
Preliminary. Alarm functions are not yet implimented.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| uehara00 | 0:0be38b583cf7 | 1 | // MAPLE board[MARM01-BASE] |
| uehara00 | 0:0be38b583cf7 | 2 | // sample application - clock |
| uehara00 | 0:0be38b583cf7 | 3 | // |
| uehara00 | 0:0be38b583cf7 | 4 | #ifndef MAPLE_ALARM_CLOCK_H_ |
| uehara00 | 0:0be38b583cf7 | 5 | #define MAPLE_ALARM_CLOCK_H_ |
| uehara00 | 0:0be38b583cf7 | 6 | |
| uehara00 | 0:0be38b583cf7 | 7 | // constants |
| uehara00 | 0:0be38b583cf7 | 8 | #define ALARM_CLOCK_REFRESH_RATE 0.1 // 100ms |
| uehara00 | 0:0be38b583cf7 | 9 | |
| uehara00 | 0:0be38b583cf7 | 10 | #define DISPLAY_MODE_DATE_TIME 0 |
| uehara00 | 0:0be38b583cf7 | 11 | #define DISPLAY_MODE_DATE_TIME_ADJUST 1 |
| uehara00 | 0:0be38b583cf7 | 12 | |
| uehara00 | 0:0be38b583cf7 | 13 | #define CURSOR_DATE_TIME_CENTURY 0 |
| uehara00 | 0:0be38b583cf7 | 14 | #define CURSOR_DATE_TIME_YEAR 1 |
| uehara00 | 0:0be38b583cf7 | 15 | #define CURSOR_DATE_TIME_MONTH 2 |
| uehara00 | 0:0be38b583cf7 | 16 | #define CURSOR_DATE_TIME_DAY 3 |
| uehara00 | 0:0be38b583cf7 | 17 | #define CURSOR_DATE_TIME_HOUR 4 |
| uehara00 | 0:0be38b583cf7 | 18 | #define CURSOR_DATE_TIME_MINUTE 5 |
| uehara00 | 0:0be38b583cf7 | 19 | #define CURSOR_DATE_TIME_SECOND 6 |
| uehara00 | 0:0be38b583cf7 | 20 | |
| uehara00 | 0:0be38b583cf7 | 21 | #define BTN_A 0 |
| uehara00 | 0:0be38b583cf7 | 22 | #define BTN_B 1 |
| uehara00 | 0:0be38b583cf7 | 23 | #define BTN_LEFT 2 |
| uehara00 | 0:0be38b583cf7 | 24 | #define BTN_DOWN 3 |
| uehara00 | 0:0be38b583cf7 | 25 | #define BTN_RIGHT 4 |
| uehara00 | 0:0be38b583cf7 | 26 | #define BTN_UP 5 |
| uehara00 | 0:0be38b583cf7 | 27 | |
| uehara00 | 0:0be38b583cf7 | 28 | #define BTN_MASK_A 0x01 |
| uehara00 | 0:0be38b583cf7 | 29 | #define BTN_MASK_B 0x02 |
| uehara00 | 0:0be38b583cf7 | 30 | #define BTN_MASK_LEFT 0x04 |
| uehara00 | 0:0be38b583cf7 | 31 | #define BTN_MASK_DOWN 0x08 |
| uehara00 | 0:0be38b583cf7 | 32 | #define BTN_MASK_RIGHT 0x10 |
| uehara00 | 0:0be38b583cf7 | 33 | #define BTN_MASK_UP 0x20 |
| uehara00 | 0:0be38b583cf7 | 34 | |
| uehara00 | 0:0be38b583cf7 | 35 | #define BTN_ON 0 |
| uehara00 | 0:0be38b583cf7 | 36 | #define BTN_OFF 1 |
| uehara00 | 0:0be38b583cf7 | 37 | |
| uehara00 | 0:0be38b583cf7 | 38 | #define BTN_THRESHOLD 0 // 0 x 100ms |
| uehara00 | 0:0be38b583cf7 | 39 | #define BTN_REPEAT 10 // 1s |
| uehara00 | 0:0be38b583cf7 | 40 | #define BTN_REPEAT_FAST 40 // 4s |
| uehara00 | 0:0be38b583cf7 | 41 | #define BTN_REPEAT_PERIOD 3 // 300ms |
| uehara00 | 0:0be38b583cf7 | 42 | #define BTN_REPEAT_PERIOD_FAST 1 // 100ms |
| uehara00 | 0:0be38b583cf7 | 43 | |
| uehara00 | 0:0be38b583cf7 | 44 | #define BTN_IDLE 0 // button status not active |
| uehara00 | 0:0be38b583cf7 | 45 | #define BTN_BUSY 1 // button status active once and repeat |
| uehara00 | 0:0be38b583cf7 | 46 | #define BTN_FAST 2 // button status repeat fast |
| uehara00 | 0:0be38b583cf7 | 47 | |
| uehara00 | 0:0be38b583cf7 | 48 | // prototypes |
| uehara00 | 0:0be38b583cf7 | 49 | void alarm_clock_initialize(); |
| uehara00 | 0:0be38b583cf7 | 50 | void alarm_clock_refresh(); |
| uehara00 | 0:0be38b583cf7 | 51 | |
| uehara00 | 0:0be38b583cf7 | 52 | static void BTN_check(int count[], int status[]); |
| uehara00 | 0:0be38b583cf7 | 53 | static void BTN_A_action(); |
| uehara00 | 0:0be38b583cf7 | 54 | static void BTN_B_action(); |
| uehara00 | 0:0be38b583cf7 | 55 | static void BTN_LEFT_action(); |
| uehara00 | 0:0be38b583cf7 | 56 | static void BTN_DOWN_action(); |
| uehara00 | 0:0be38b583cf7 | 57 | static void BTN_RIGHT_action(); |
| uehara00 | 0:0be38b583cf7 | 58 | static void BTN_UP_action(); |
| uehara00 | 0:0be38b583cf7 | 59 | |
| uehara00 | 0:0be38b583cf7 | 60 | #endif |