1: #ifndef __WATCH_DISPLAY
2: #ifndef __WATCH_DISPLAY
3: #define __WATCH_DISPLAY
4: #include "ble_cts_date_time.h"
5: #include "Fonts_Graphic.h"
6: #include "SSD1306.h"
7:
8: //rename the font name (for message, date,calendar,time..)
9: // typedef FONT_INFO microsoftSansSerif_8ptFontInfo Font_Message;
10: // typedef FONT_INFO consolas_16ptFontInfo Font_NotiNum;
11: // typedef FONT_INFO date_16ptFontInfo Font_other;
12: // typedef FONT_INFO consolas_32ptFontInfo Font_Time;
13: //define the data struct for ble watch
14: //
15:
16: //define the macro
17: //define the font rename.
18: #define FONT_MESSAGE 0//microsoftSansSerif_8ptFontInfo
19: #define FONT_NOTINUM 1//consolas_16ptFontInfo
20: #define FONT_OTHER 2//date_16ptFontInfo
21: #define FONT_TIME 3//consolas_32ptFontInfo
22:
23: //define the origin point
24: #define ORIGIN_POINTX 0
25: #define ORIGIN_POINTY 0
26: #define ORIGIN (ORIGIN_POINTX,ORIGIN_POINTY)
27:
28: #define MSINGLE_POINTX 65
29: #define MSINGLE_POINTY 0
30: #define MAIN_SINGLE (MSINGLE_POINTX,MSINGLE_POINTY)
31:
32: #define MBATTERY_POINTX 105
33: #define MBATTERY_POINTY 0
34: #define MAIN_BATTERY (MBATTERY_POINTX,MBATTERY_POINTY)
35:
36: #define MHOUR_POINTX 0
37: #define MHOUR_POINTY 3
38: #define MAIN_HOUR (MBATTERY_POINTX,MBATTERY_POINTY)
39:
40: #define MMINUTE_POINTX 53
41: #define MMINUTE_POINTY 3
42: #define MAIN_MINUTE (MMINUTE_POINTX,MMINUTE_POINTY)
43:
44: #define MAMPM_POINTX 100
45: #define MAMPM_POINTY 4
46: #define MAIN_MAMPM (MAMPM_POINTX,MAMPM_POINTY)
47:
48: #define MDATE_POINTX 0
49: #define MDATE_POINTY 6
50: #define MAIN_DATE (MDATE_POINTX,MDATE_POINTY)
51:
52: #define SINGLE_POINTX 2
53: #define SINGLE_POINTY 0
54: #define ET_SINGLE (SSINGLE_POINTX,SSINGLE_POINTY)
55:
56: #define BATTERY_POINTX 103
57: #define BATTERY_POINTY 0
58: #define ET_BATTERY (MBATTERY_POINTX,MBATTERY_POINTY)
59:
60: #define HOUR_POINTX 35
61: #define HOUR_POINTY 0
62: #define ET_HOUR (SHOUR_POINTX_POINTX,SHOUR_POINTX_POINTY)
63:
64: #define MINUTE_POINTX 70
65: #define MINUTE_POINTY 0
66: #define ET_MINUTE (SMINUTE_POINTX,SMINUTE_POINTY)
67:
68: #define SSETITEM_POINTX 55
69: #define SSETITEM_POINTY 3
70: #define SET_ITEM (SMINUTE_POINTX,SMINUTE_POINTY)
71:
72: #define SSELECT_POINTX 0
73: #define SSELECT_POINTY 3
74: #define SELECT_ITEM (SSELECT_POINTX,SSELECT_POINTY)
75:
76: #define PAIR_POINTX 15
77: #define PAIR_POINTY 2
78: #define PAIR_FRAM (PAIR_POINTX,PAIR_POINTY)
79:
80:
81: #define DIRECT_POINTX 90
82: #define DIRECT_POINTY 7
83: #define DIRECT_ITEM (SSELECT_POINTX,SSELECT_POINTY)
84:
85:
86: #define ALARM_HOUR_POINTX 41
87: #define ALARM_HOUR_POINTY 6
88: #define ALARM_HOUR (ALARM_HOUR_POINTX,ALARM_HOUR_POINTY)
89:
90: #define ALARM_MINUTE_POINTX 70
91: #define ALARM_MINUTE_POINTY 6
92: #define ALARM_MINUTE (ALARM_MINUTE_POINTX,ALARM_MINUTE_POINTY)
93:
94: #define NOTI_MAIL_POINTX 9
95: #define NOTI_MAIL_POINTY 6
96: #define NOTI_MAIL (NOTI_MAIL_POINTX,NOTI_MAIL_POINTY)
97:
98: #define NOTI_CALL_POINTX 54
99: #define NOTI_CALL_POINTY 6
100: #define NOTI_CALL (NOTI_CALL_POINTX,NOTI_CALL_POINTY)
101:
102: #define NOTI_SMS_POINTX 95
103: #define NOTI_SMS_POINTY 6
104: #define NOTI_SMS (NOTI_SMS_POINTX,NOTI_SMS_POINTY)
105:
106: #define ALARM_POINTX 55
107: #define ALARM_POINTY 3
108: #define ALARM_ICON (SMINUTE_POINTX,SMINUTE_POINTY)
109:
110: #define ANCS_ITEM1_X 0
111: #define ANCS_ITEM1_Y 3
112: #define ANCS_ITEM2_X 0
113: #define ANCS_ITEM2_Y 5
114: #define ANCS_ITEM3_X 0
115: #define ANCS_ITEM3_Y 5
116:
117: #define ADDBOOK_TITLE_X 50
118: #define ADDBOOK_TITLE_Y 0
119:
120: #define ADDBOOK_CONTENT_X 0
121: #define ADDBOOK_CONTENT_Y 3
122:
123: #define PERIOD_VALUE 12
124: #define WRITE_BUFFER 0
125: #define WRITE_LCD 1
126:
127: extern const FONT_INFO *pFontInfo;// = &consolas_16ptFontInfo;
128: //function for watch
129: uint32_t DispalyInt(void );
130: void Switch_Page(uint8_t index, const ble_cts_date_time_t a_sTime,unsigned char toSubMode);
131: void SetDisplayInvert(uint8_t isTurnOn);
132: //draw the single
133: //need assign the x/y point and the rf single.
134: void DrawSingle(uint8_t x, uint8_t y, int value);
135: void UpdateRSSIStatus(unsigned char WorkMode, unsigned char SubMode,int value);
136: //draw the battery
137: //need assign the x/y point and the barry value.
138: void UpdateBatteryStatus(unsigned char WorkMode, unsigned char SubMode,int value);
139: void DrawBattery(uint8_t x, uint8_t y, int value);
140:
141: void SetFont(uint8_t font_type);
142: //draw information display
143: void SetCurrent_period(const ble_cts_date_time_t a_sTime);
144: void SetCurrent_time(const ble_cts_date_time_t a_sTime);
145: void SetCalendar(const ble_cts_date_time_t a_sTime);
146: void SetSmall_time(const ble_cts_date_time_t a_sTime);
147: void DrawSettinnItem(uint8_t index);
148: void ClearSettinnItem(uint8_t index);
149: void DrawDirectBar(uint8_t index);
150: void SetNotiNum(int8_t index);
151: int8_t GetNotiNum(void);
152: void DisplayAncsData(uint8_t select,int8_t);
153: void ShowAlarm_time(const ble_cts_date_time_t a_sTime);
154: void ShowAlarmIcon(void);
155: void ClearAlarmIcon(void);
156:
157:
158: //work mode
159: uint8_t isEntryIdle(void);
160: void m_oled_goto_idle(void);
161: void m_oled_go(void);
162: #endif
163: #define __WATCH_DISPLAY
164: #include "ble_cts_date_time.h"
165: #include "Fonts_Graphic.h"
166: #include "SSD1306.h"
167:
168: //rename the font name (for message, date,calendar,time..)
169: // typedef FONT_INFO microsoftSansSerif_8ptFontInfo Font_Message;
170: // typedef FONT_INFO consolas_16ptFontInfo Font_NotiNum;
171: // typedef FONT_INFO date_16ptFontInfo Font_other;
172: // typedef FONT_INFO consolas_32ptFontInfo Font_Time;
173: //define the data struct for ble watch
174: //
175:
176: //define the macro
177: //define the font rename.
178: #define FONT_MESSAGE 0//microsoftSansSerif_8ptFontInfo
179: #define FONT_NOTINUM 1//consolas_16ptFontInfo
180: #define FONT_OTHER 2//date_16ptFontInfo
181: #define FONT_TIME 3//consolas_32ptFontInfo
182:
183: //define the origin point
184: #define ORIGIN_POINTX 0
185: #define ORIGIN_POINTY 0
186: #define ORIGIN (ORIGIN_POINTX,ORIGIN_POINTY)
187:
188: #define MSINGLE_POINTX 65
189: #define MSINGLE_POINTY 0
190: #define MAIN_SINGLE (MSINGLE_POINTX,MSINGLE_POINTY)
191:
192: #define MBATTERY_POINTX 105
193: #define MBATTERY_POINTY 0
194: #define MAIN_BATTERY (MBATTERY_POINTX,MBATTERY_POINTY)
195:
196: // #define MHOUR_POINTX 1
197: // #define MHOUR_POINTY 3
198: // #define MAIN_HOUR (MBATTERY_POINTX,MBATTERY_POINTY)
199:
200: // #define MMINUTE_POINTX 55
201: // #define MMINUTE_POINTY 3
202: // #define MAIN_MINUTE (MMINUTE_POINTX,MMINUTE_POINTY)
203:
204: #define MAMPM_POINTX 100
205: #define MAMPM_POINTY 4
206: #define MAIN_MAMPM (MAMPM_POINTX,MAMPM_POINTY)
207:
208: #define MDATE_POINTX 0
209: #define MDATE_POINTY 6
210: #define MAIN_DATE (MDATE_POINTX,MDATE_POINTY)
211:
212: #define SINGLE_POINTX 2
213: #define SINGLE_POINTY 0
214: #define ET_SINGLE (SSINGLE_POINTX,SSINGLE_POINTY)
215:
216: #define BATTERY_POINTX 103
217: #define BATTERY_POINTY 0
218: #define ET_BATTERY (MBATTERY_POINTX,MBATTERY_POINTY)
219:
220: #define ANCS_NOTI_POINTX 90
221: #define ANCS_NOTI_POINTY 0
222: #define ANCS_NOTI (MBATTERY_POINTX,MBATTERY_POINTY)
223:
224: // #define HOUR_POINTX 38
225: // #define HOUR_POINTY 0
226: // #define ET_HOUR (SHOUR_POINTX_POINTX,SHOUR_POINTX_POINTY)
227:
228: #define MINUTE_POINTX 70
229: #define MINUTE_POINTY 0
230: #define ET_MINUTE (SMINUTE_POINTX,SMINUTE_POINTY)
231:
232: #define SSETITEM_POINTX 55
233: #define SSETITEM_POINTY 3
234: #define SET_ITEM (SMINUTE_POINTX,SMINUTE_POINTY)
235:
236: #define SSELECT_POINTX 0
237: #define SSELECT_POINTY 3
238: #define SELECT_ITEM (SSELECT_POINTX,SSELECT_POINTY)
239:
240: #define PAIR_POINTX 15
241: #define PAIR_POINTY 2
242: #define PAIR_FRAM (PAIR_POINTX,PAIR_POINTY)
243:
244:
245: #define DIRECT_POINTX 90
246: #define DIRECT_POINTY 7
247: #define DIRECT_ITEM (SSELECT_POINTX,SSELECT_POINTY)
248:
249:
250: #define ALARM_HOUR_POINTX 41
251: #define ALARM_HOUR_POINTY 6
252: #define ALARM_HOUR (ALARM_HOUR_POINTX,ALARM_HOUR_POINTY)
253:
254: #define ALARM_MINUTE_POINTX 70
255: #define ALARM_MINUTE_POINTY 6
256: #define ALARM_MINUTE (ALARM_MINUTE_POINTX,ALARM_MINUTE_POINTY)
257:
258: #define NOTI_MAIL_POINTX 9
259: #define NOTI_MAIL_POINTY 6
260: #define NOTI_MAIL (NOTI_MAIL_POINTX,NOTI_MAIL_POINTY)
261:
262: #define NOTI_CALL_POINTX 54
263: #define NOTI_CALL_POINTY 6
264: #define NOTI_CALL (NOTI_CALL_POINTX,NOTI_CALL_POINTY)
265:
266: #define NOTI_SMS_POINTX 95
267: #define NOTI_SMS_POINTY 6
268: #define NOTI_SMS (NOTI_SMS_POINTX,NOTI_SMS_POINTY)
269:
270: #define ALARM_POINTX 55
271: #define ALARM_POINTY 3
272: #define ALARM_ICON (SMINUTE_POINTX,SMINUTE_POINTY)
273:
274: #define SPORT_POINTX 5
275: #define SPORT_POINTY 4
276: #define SPORT_FRAM (SPORT_POINTX,SPORT_POINTX)
277:
278:
279: #define ANCS_ITEM1_X 0
280: #define ANCS_ITEM1_Y 3
281: #define ANCS_ITEM2_X 0
282: #define ANCS_ITEM2_Y 5
283: #define ANCS_ITEM3_X 0
284: #define ANCS_ITEM3_Y 5
285:
286: #define GPS_DIS_POINTX 40
287: #define GPS_DIS_POINTY 3
288:
289: #define FILENAME_POINTX 38
290: #define FILENAME_POINTY 6
291:
292: #define ACC_COUNT_POINTX 38
293: #define ACC_COUNT_POINTY 6
294:
295: #define MUSIC_CONTROL_POINTX 100
296: #define MUSIC_CONTROL_POINTY 4
297:
298: #define PERIOD_VALUE 12
299: #define WRITE_BUFFER 0
300: #define WRITE_LCD 1
301:
302: #define TURN_ON 1
303: #define TURN_OFF 0
304:
305: extern const FONT_INFO *pFontInfo;// = &consolas_16ptFontInfo;
306: //function for watch
307: uint32_t DispalyInt(void );
308: void Switch_Page(uint8_t index, const ble_cts_date_time_t a_sTime,unsigned char toSubMode);
309: void SetDisplayInvert(uint8_t isTurnOn);
310: //draw the single
311: //need assign the x/y point and the rf single.
312: void DrawSingle(uint8_t x, uint8_t y, int value);
313: void UpdateRSSIStatus(unsigned char WorkMode, unsigned char SubMode,int value);
314: //draw the battery
315: //need assign the x/y point and the barry value.
316: void UpdateBatteryStatus(unsigned char WorkMode, unsigned char SubMode,int value);
317: void DrawBattery(uint8_t x, uint8_t y, int value);
318:
319: void SetFont(uint8_t font_type);
320: //draw information display
321: void SetCurrent_period(const ble_cts_date_time_t a_sTime);
322: void SetCurrent_time(const ble_cts_date_time_t a_sTime);
323: void SetCalendar(const ble_cts_date_time_t a_sTime);
324: void SetSmall_time(const ble_cts_date_time_t a_sTime);
325: void DrawSettinnItem(uint8_t index);
326: void ClearSettinnItem(uint8_t index);
327: void DrawDirectBar(uint8_t index);
328: void SetNotiNum(int8_t index);
329: int8_t GetNotiNum(void);
330: void DisplayAncsData(uint8_t select,int8_t);
331: void ShowAlarm_time(const ble_cts_date_time_t a_sTime);
332: void ShowAlarmIcon(void);
333: void ClearAlarmIcon(void);
334: void ClearNotiIcon(void);
335: void DrawNotiIcon(void);
336: void ClearNotiIcon(void);
337: void ClearSingle(uint8_t x, uint8_t y);
338: void DisplayAddressBook(uint8_t *);
339: uint8_t* GetAddressBookData(uint8_t select, int8_t index);
340: void ShowGPS_Distance(const uint16_t dis);
341: void ShowFileName(const uint8_t* filename);
342: void ShowAcc_Count(const uint16_t dis);
343: //work mode
344: uint8_t isEntryIdle(void);
345: void m_oled_goto_idle(void);
346: void m_oled_go(void);
347: void DrawMusicControl(uint8_t isTurnOn);
348: void DrawSportControl(uint8_t isTurnOn);
349:
350: #endif