]> git.karo-electronics.de Git - oswald.git/blobdiff - ui/oswald.h
Oh boy... lots of changes, too many to describe
[oswald.git] / ui / oswald.h
index 9a341e38e2d1a9d9dc6a68f0308825bcf3b5bbcf..31ee5cd33a0aa71a3b6e6371d5850ae560022346 100644 (file)
@@ -1,5 +1,6 @@
 #ifndef _OSWALD_H
 #define _OSWALD_H
+#include <stdint.h>
 
 //#define DEBUG 1
 #ifdef DEBUG
@@ -30,20 +31,36 @@ typedef struct {
        u8t     minute;
        u8t     second;
        u8t     day;
+       u8t     wday; // day in week, 0=sunday, 1=monday,...
        u8t     month;
        u16t    year;
        boolean clk24hr;
        boolean day_first;
 } clock_state;
 
+#define WDAY_SUNDAY    (1 << 0)
+#define WDAY_MONDAY    (1 << 1)
+#define WDAY_TUESDAY   (1 << 2)
+#define WDAY_WEDNESDAY (1 << 3)
+#define WDAY_THURSDAY  (1 << 4)
+#define WDAY_FRIDAY    (1 << 5)
+#define WDAY_SATURDAY  (1 << 6)
+typedef struct {
+       u8t     hour;
+       u8t     minute;
+       u8t     wday; // bitfield 0 to 6, 1=sunday, 2=monday, 4=tuesday...
+} alarm_clk;
+
 typedef enum {
        IDLE_SCREEN = 0,
+       ALARM_SETUP_SCREEN,
+       STOP_WATCH_SCREEN,
        ACCEL_DISPLAY_SCREEN,
        MENU_TEST_SCREEN,
-       STOP_WATCH_SCREEN,
 //     APPLICATION_SCREEN,
        LAST_SCREEN,            // a marker for the last (not valid) screen)
        DATETIME_SETTING_SCREEN,
+       ALARM_SCREEN,
        SCREENS_END,
 } screen_number;
 
@@ -66,6 +83,8 @@ typedef enum {
 #define EVENT_AMBIENTLIGHT_UPDATE      (1<<7)          // ambient light sensor updates
 #define EVENT_POWER_CHANGE             (1<<8)          // power source status change
 #define EVENT_COMMS                    (1<<9)          // communication, like Bluetooth I/O
+#define EVENT_POWER_STATE              (1<<10)         // power source changed or similar
+
 
 typedef struct {
        u16t event_mask;                                // the event the screen wants to receive
@@ -85,5 +104,26 @@ typedef struct {
        u8t     z;
 } accel_data_t;
 
-#endif
+#define POWER_SOURCE_BATTERY   0
+#define POWER_SOURCE_EXTERNAL  1
+
+#define POWER_CHARGER_DONE     0
+#define POWER_CHARGER_PRECHARGE        1
+#define POWER_CHARGER_CHARGING 2
+#define POWER_CHARGER_UNK      3
+
+typedef struct {
+       u8t     source;
+       u8t     charge_state;
+       u8t     percent;
+       u16t    level;
+} power_state;
 
+typedef enum {
+       BLUETOOTH_OFF = 0,
+       BLUETOOTH_ON,
+       BLUETOOTH_CONNECTED,
+       BLUETOOTH_ILL
+} bluetooth_state;
+
+#endif