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.
Diff: Maple_alarm_clock.h
- Revision:
- 0:0be38b583cf7
- Child:
- 1:aefa1992ce0f
diff -r 000000000000 -r 0be38b583cf7 Maple_alarm_clock.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Maple_alarm_clock.h Sun Sep 25 11:37:21 2011 +0000 @@ -0,0 +1,60 @@ +// MAPLE board[MARM01-BASE] +// sample application - clock +// +#ifndef MAPLE_ALARM_CLOCK_H_ +#define MAPLE_ALARM_CLOCK_H_ + +// constants +#define ALARM_CLOCK_REFRESH_RATE 0.1 // 100ms + +#define DISPLAY_MODE_DATE_TIME 0 +#define DISPLAY_MODE_DATE_TIME_ADJUST 1 + +#define CURSOR_DATE_TIME_CENTURY 0 +#define CURSOR_DATE_TIME_YEAR 1 +#define CURSOR_DATE_TIME_MONTH 2 +#define CURSOR_DATE_TIME_DAY 3 +#define CURSOR_DATE_TIME_HOUR 4 +#define CURSOR_DATE_TIME_MINUTE 5 +#define CURSOR_DATE_TIME_SECOND 6 + +#define BTN_A 0 +#define BTN_B 1 +#define BTN_LEFT 2 +#define BTN_DOWN 3 +#define BTN_RIGHT 4 +#define BTN_UP 5 + +#define BTN_MASK_A 0x01 +#define BTN_MASK_B 0x02 +#define BTN_MASK_LEFT 0x04 +#define BTN_MASK_DOWN 0x08 +#define BTN_MASK_RIGHT 0x10 +#define BTN_MASK_UP 0x20 + +#define BTN_ON 0 +#define BTN_OFF 1 + +#define BTN_THRESHOLD 0 // 0 x 100ms +#define BTN_REPEAT 10 // 1s +#define BTN_REPEAT_FAST 40 // 4s +#define BTN_REPEAT_PERIOD 3 // 300ms +#define BTN_REPEAT_PERIOD_FAST 1 // 100ms + +#define BTN_IDLE 0 // button status not active +#define BTN_BUSY 1 // button status active once and repeat +#define BTN_FAST 2 // button status repeat fast + +// prototypes +void alarm_clock_initialize(); +void alarm_clock_refresh(); + +static void BTN_check(int count[], int status[]); +static void BTN_A_action(); +static void BTN_B_action(); +static void BTN_LEFT_action(); +static void BTN_DOWN_action(); +static void BTN_RIGHT_action(); +static void BTN_UP_action(); + +#endif