update calendar ui
@@ -224,7 +224,7 @@ void UC8176_Sleep(void)
|
||||
UC8176_PowerOff();
|
||||
|
||||
EPD_WriteCommand(CMD_DSLP);
|
||||
EPD_WriteByte(0XA5);
|
||||
EPD_WriteByte(0xA5);
|
||||
}
|
||||
|
||||
// Declare driver and models
|
||||
|
||||
103
GUI/Calendar.c
@@ -9,67 +9,97 @@
|
||||
#else
|
||||
#define PAGE_HEIGHT 64
|
||||
#endif
|
||||
|
||||
#define GFX_printf_styled(gfx, fg, bg, font, ...) \
|
||||
GFX_setTextColor(gfx, fg, bg); \
|
||||
GFX_setFont(gfx, font); \
|
||||
GFX_printf(gfx, __VA_ARGS__);
|
||||
|
||||
static void DrawDateHeader(Adafruit_GFX *gfx, int16_t x, int16_t y, tm_t *tm, struct Lunar_Date *Lunar)
|
||||
{
|
||||
GFX_setCursor(gfx, x, y);
|
||||
GFX_setFont(gfx, u8g2_font_wqy12b_t_lunar);
|
||||
GFX_setTextColor(gfx, GFX_BLACK, GFX_WHITE);
|
||||
GFX_printf(gfx, "%d年%02d月%02d日 星期%s", tm->tm_year + YEAR0, tm->tm_mon + 1, tm->tm_mday, Lunar_DayString[tm->tm_wday]);
|
||||
GFX_printf_styled(gfx, GFX_RED, GFX_WHITE, u8g2_font_helvB18_tn, "%d", tm->tm_year + YEAR0);
|
||||
GFX_printf_styled(gfx, GFX_BLACK, GFX_WHITE, u8g2_font_wqy12_t_lunar, "年");
|
||||
GFX_printf_styled(gfx, GFX_RED, GFX_WHITE, u8g2_font_helvB18_tn, "%02d", tm->tm_mon + 1);
|
||||
GFX_printf_styled(gfx, GFX_BLACK, GFX_WHITE, u8g2_font_wqy12_t_lunar, "月");
|
||||
GFX_printf_styled(gfx, GFX_RED, GFX_WHITE, u8g2_font_helvB18_tn, "%02d", tm->tm_mday);
|
||||
GFX_printf_styled(gfx, GFX_BLACK, GFX_WHITE, u8g2_font_wqy12_t_lunar, "日 ");
|
||||
|
||||
GFX_setFont(gfx, u8g2_font_wqy9_t_lunar);
|
||||
GFX_printf(gfx, "星期%s", Lunar_DayString[tm->tm_wday]);
|
||||
|
||||
LUNAR_SolarToLunar(Lunar, tm->tm_year + YEAR0, tm->tm_mon + 1, tm->tm_mday);
|
||||
GFX_setFont(gfx, u8g2_font_wqy9_t_lunar);
|
||||
GFX_setCursor(gfx, x + 226, y);
|
||||
GFX_printf(gfx, "农历: %s%s%s %s%s[%s]年", Lunar_MonthLeapString[Lunar->IsLeap], Lunar_MonthString[Lunar->Month],
|
||||
|
||||
GFX_setCursor(gfx, x + 270, y);
|
||||
GFX_printf(gfx, "%s%s%s %s%s", Lunar_MonthLeapString[Lunar->IsLeap], Lunar_MonthString[Lunar->Month],
|
||||
Lunar_DateString[Lunar->Date], Lunar_StemStrig[LUNAR_GetStem(Lunar)],
|
||||
Lunar_BranchStrig[LUNAR_GetBranch(Lunar)], Lunar_ZodiacString[LUNAR_GetZodiac(Lunar)]);
|
||||
Lunar_BranchStrig[LUNAR_GetBranch(Lunar)]);
|
||||
GFX_setTextColor(gfx, GFX_RED, GFX_WHITE);
|
||||
GFX_printf(gfx, "%s", Lunar_ZodiacString[LUNAR_GetZodiac(Lunar)]);
|
||||
GFX_setTextColor(gfx, GFX_BLACK, GFX_WHITE);
|
||||
GFX_printf(gfx, "年");
|
||||
}
|
||||
|
||||
static void DrawWeekHeader(Adafruit_GFX *gfx, int16_t x, int16_t y)
|
||||
{
|
||||
GFX_fillRect(gfx, x, y, 380, 24, GFX_RED);
|
||||
GFX_fillRect(gfx, x + 50, y, 280, 24, GFX_BLACK);
|
||||
GFX_setFont(gfx, u8g2_font_wqy9_t_lunar);
|
||||
for (int i = 0; i < 7; i++) {
|
||||
if (i > 0 && i < 6)
|
||||
GFX_setTextColor(gfx, GFX_WHITE, GFX_BLACK);
|
||||
else
|
||||
GFX_setTextColor(gfx, GFX_WHITE, GFX_RED);
|
||||
GFX_fillRect(gfx, x, y, 380, 18, GFX_RED);
|
||||
for (int i = 0; i < 7; i++)
|
||||
{
|
||||
GFX_setCursor(gfx, x + 15 + i * 55, y + 14);
|
||||
GFX_setCursor(gfx, x + 15 + i * 55, y + 16);
|
||||
GFX_printf(gfx, "%s", Lunar_DayString[i]);
|
||||
}
|
||||
}
|
||||
|
||||
static void DrawMonthDay(Adafruit_GFX *gfx, int16_t x, int16_t y, tm_t *tm, struct Lunar_Date *Lunar, uint8_t day)
|
||||
static void DrawMonthDays(Adafruit_GFX *gfx, tm_t *tm, struct Lunar_Date *Lunar)
|
||||
{
|
||||
if (day == tm->tm_mday)
|
||||
{
|
||||
GFX_fillCircle(gfx, x + 10, y + 9, 20, GFX_RED);
|
||||
uint8_t firstDayWeek = get_first_day_week(tm->tm_year + YEAR0, tm->tm_mon + 1);
|
||||
uint8_t monthMaxDays = thisMonthMaxDays(tm->tm_year + YEAR0, tm->tm_mon + 1);
|
||||
uint8_t monthDayRows = 1 + (monthMaxDays - (7 - firstDayWeek) + 6) / 7;
|
||||
|
||||
for (uint8_t i = 0; i < monthMaxDays; i++) {
|
||||
uint8_t day = i + 1;
|
||||
|
||||
int16_t w = (firstDayWeek + i) % 7;
|
||||
bool weekend = (w == 0) || (w == 6);
|
||||
|
||||
int16_t x = 22 + w * 55;
|
||||
int16_t y = (monthDayRows > 5 ? 65 : 68) + (firstDayWeek + i) / 7 * (monthDayRows > 5 ? 39 : 48);
|
||||
|
||||
if (day == tm->tm_mday) {
|
||||
GFX_fillCircle(gfx, x + 10, y + (monthDayRows > 5 ? 10 : 12), 20, GFX_RED);
|
||||
GFX_setTextColor(gfx, GFX_WHITE, GFX_RED);
|
||||
}
|
||||
else
|
||||
{
|
||||
GFX_setTextColor(gfx, GFX_BLACK, GFX_WHITE);
|
||||
} else {
|
||||
GFX_setTextColor(gfx, weekend ? GFX_RED : GFX_BLACK, GFX_WHITE);
|
||||
}
|
||||
|
||||
GFX_setFont(gfx, u8g2_font_wqy12b_t_lunar);
|
||||
GFX_setCursor(gfx, x + 2, y + 4);
|
||||
GFX_setFont(gfx, u8g2_font_helvB14_tn);
|
||||
if (day < 10)
|
||||
GFX_setCursor(gfx, x + 6, y + 10);
|
||||
else
|
||||
GFX_setCursor(gfx, x + 2, y + 10);
|
||||
GFX_printf(gfx, "%d", day);
|
||||
|
||||
GFX_setFont(gfx, u8g2_font_wqy9_t_lunar);
|
||||
GFX_setCursor(gfx, x, y + 20);
|
||||
GFX_setCursor(gfx, x, y + 24);
|
||||
uint8_t JQdate;
|
||||
if (GetJieQi(tm->tm_year + YEAR0, tm->tm_mon + 1, day, &JQdate) && JQdate == day)
|
||||
{
|
||||
if (GetJieQi(tm->tm_year + YEAR0, tm->tm_mon + 1, day, &JQdate) && JQdate == day) {
|
||||
uint8_t JQ = (tm->tm_mon + 1 - 1) * 2;
|
||||
if (day >= 15)
|
||||
JQ++;
|
||||
if (day >= 15) JQ++;
|
||||
if (day != tm->tm_mday) GFX_setTextColor(gfx, GFX_RED, GFX_WHITE);
|
||||
GFX_printf(gfx, "%s", JieQiStr[JQ]);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
LUNAR_SolarToLunar(Lunar, tm->tm_year + YEAR0, tm->tm_mon + 1, day);
|
||||
if (Lunar->Date == 1)
|
||||
GFX_printf(gfx, "%s", Lunar_MonthString[Lunar->Month]);
|
||||
else
|
||||
GFX_printf(gfx, "%s", Lunar_DateString[Lunar->Date]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DrawCalendar(epd_driver_t *driver, uint32_t timestamp)
|
||||
@@ -79,10 +109,6 @@ void DrawCalendar(epd_driver_t *driver, uint32_t timestamp)
|
||||
|
||||
transformTime(timestamp, &tm);
|
||||
|
||||
uint8_t firstDayWeek = get_first_day_week(tm.tm_year + YEAR0, tm.tm_mon + 1);
|
||||
uint8_t monthMaxDays = thisMonthMaxDays(tm.tm_year + YEAR0, tm.tm_mon + 1);
|
||||
uint8_t monthDayRows = 1 + (monthMaxDays - (7 - firstDayWeek) + 6) / 7;
|
||||
|
||||
Adafruit_GFX gfx;
|
||||
|
||||
if (EPD_BWR_MODE)
|
||||
@@ -95,14 +121,9 @@ void DrawCalendar(epd_driver_t *driver, uint32_t timestamp)
|
||||
NRF_LOG_DEBUG("page %d\n", gfx.current_page);
|
||||
GFX_fillScreen(&gfx, GFX_WHITE);
|
||||
|
||||
DrawDateHeader(&gfx, 10, 22, &tm, &Lunar);
|
||||
DrawWeekHeader(&gfx, 10, 26);
|
||||
|
||||
for (uint8_t i = 0; i < monthMaxDays; i++) {
|
||||
int16_t x = 22 + (firstDayWeek + i) % 7 * 55;
|
||||
int16_t y = (monthDayRows > 5 ? 60 : 65) + (firstDayWeek + i) / 7 * (monthDayRows > 5 ? 42 : 50);
|
||||
DrawMonthDay(&gfx, x, y, &tm, &Lunar, i + 1);
|
||||
}
|
||||
DrawDateHeader(&gfx, 10, 26, &tm, &Lunar);
|
||||
DrawWeekHeader(&gfx, 10, 30);
|
||||
DrawMonthDays(&gfx, &tm, &Lunar);
|
||||
} while(GFX_nextPage(&gfx, driver->write_image));
|
||||
|
||||
GFX_end(&gfx);
|
||||
|
||||
200
GUI/fonts.c
@@ -3,11 +3,11 @@
|
||||
/*
|
||||
Fontname: -wenquanyi-wenquanyi bitmap song-medium-r-normal--12-120-75-75-P-119-ISO10646-1
|
||||
Copyright: (null)
|
||||
Glyphs: 96/30503
|
||||
Glyphs: 179/30503
|
||||
BBX Build Mode: 0
|
||||
*/
|
||||
const uint8_t u8g2_font_wqy9_t_lunar[3235] U8G2_FONT_SECTION("u8g2_font_wqy9_t_lunar") =
|
||||
"\266\0\3\2\4\4\3\4\5\13\15\0\376\10\376\12\377\1a\2\317\4\30 \5\0L\13!\7\221F"
|
||||
const uint8_t u8g2_font_wqy9_t_lunar[3155] U8G2_FONT_SECTION("u8g2_font_wqy9_t_lunar") =
|
||||
"\263\0\3\2\4\4\3\4\5\13\15\0\376\10\376\12\377\1a\2\317\4\30 \5\0L\13!\7\221F"
|
||||
"\213S\0\42\7\64}\213\310\24#\16\226\304\233\250eX\242^\206%j\1$\17\245<\253l\251("
|
||||
"\231\250%Je\213\0%\20\226<\233(\351\242%a\232DI\27-\1&\16\205D\253,\211\222\254"
|
||||
"\62%Q\244\4'\6\61\376\212\1(\13\263=\253$J\242nQ\26)\14\263=\213,\312\242.Q"
|
||||
@@ -49,87 +49,123 @@ const uint8_t u8g2_font_wqy9_t_lunar[3235] U8G2_FONT_SECTION("u8g2_font_wqy9_t_l
|
||||
"\16\7\1N\224\26\253<\236\341\234c\71\226\3\207\70\213\263\70\213\263h\70\10N\245\27\272=\316\34"
|
||||
"\13\207C\226#Y\70Hi\24J\231Y\212V\1QT\32\273<\276\34\33\324,\35.\245,\33\6"
|
||||
"\71\207\222r\322\26e\211\70\4Qk\30\253D\356\34\210r \312\201(\7\262\70K\213i\226\3I"
|
||||
"\16\5Qm\24\273<\316\34\314I\303Ag\314\342\260\34\345\210\16\5Q\234\33\273<\336x\70$Y"
|
||||
"\250ia\224\3QMJ\262$+%Q*jq\0Q\254\30\273<\276\34\33T-\214\222\34\312\21"
|
||||
"\333\24\315\71\240\203\71\30\2R\6\30\273<\276r\226\26\323,\7\222d\30\222\60\213\263\64\254F\242"
|
||||
"\6R\35\33\273<\236\34\214\206\203T+\25\243D\211\42E\213*Q[\251\30%\231\2SA\27\273"
|
||||
"<\336\34\313\261\34K\207\203\232c\71\226c\71\226c)\0SH\27\272=\256\34\32\206(\13\353P"
|
||||
"\70\34\322\34\312\241\34\312\241\20So\33\272=\276x\32\306LJ\62)\311\244$S\224l\351\226D"
|
||||
"Y\24j!\0S\206\32\273<\256\341\224c\345,N\206!\312JY\251\230da\22\245R\250\0V"
|
||||
"\333\30\251=\216\207(\211\244$\222\222HJ\42%\32f\35x\320\201\0X\354\30\273<~ \207\266"
|
||||
"A\307r\254\62\34\324\34\313\261\34\213\262\341\2Y\4\32\273<\256\60\15\323!I\243D\253\364\324\22"
|
||||
"\305Y\232Da&\306C\0Y\17\31\273<\216\7\65G\206\65L\247\64\31\322\60\34\206,\252\205\362"
|
||||
"\64\4Y'\30\273<\336\34\313\261t\70\250\71\226CI\216\324\201,-\351\200\0[P\30\273<\256"
|
||||
"a\310\241\34\312\241\34K\207\203\232c\71\226#u(\6[\305\31\273<\336tx\207\224aH\322\34"
|
||||
"\70\204Qq\30\302\250\70\14\321:[\322\33\273<\336tx\213\42e\30\222\60\312\206\203\30\305I\24"
|
||||
"m\212\250\203\32\0\134\17\30\273<\336\34\313\261\34\210\212Q\26e\245,\24\253\71R\207b\0]\362"
|
||||
"\26\252=\216\203\16\345P\71\32\6)\207rDGt$\31\16]\363\30\272=\216\203\24Gq\24G"
|
||||
"\303 \345P\16\345\210\216\350H\62\34^t\27\273<\256\34\33.a\65\36\6\255\234\205\303A\316\261"
|
||||
"\34\13\1^\232\33\273<\356x\70eq\62l\245l\70eQ\226\14[\224\204Q\26%\252\0^\377"
|
||||
"\30\273<\276\60\15\323\60\32\16Z\230\206i\230\206i\230\16k\30\1`\312\36\273<\256\60M\206A"
|
||||
"\321\201$\31\226R\226\224\6-L\243\244\226D%\245T\13\1b\12\31\273<\356$G\242l\70e"
|
||||
"q\26e\245,\24KI\230\264e\223\32b\14\33\273<\356$G\242l\70eq\26e\203\224U\302"
|
||||
"j&%Y\224H\242\0e\345\15\247>\216\203j\35\256\326\341\32e\366\34\273<~$\32\302(\32"
|
||||
"NaT\211\242!J\242\226\250\30\25\243!\314\221\11f\16\31\273<\356\341\224I\65)\32N\231T"
|
||||
"\223\242\341\224\245a-\211\324\4f\37\33\273<\256a\10\323p\30\302\64\34\206\60\212\207K\230\3\207"
|
||||
"\34H\207\203\0f%\32\273<\336x\70\244\71pP\343\341 \211\212\62%Y\62\244a:L\0f"
|
||||
"\221\33\273<\256a\10\323p\30\302\64\33\316I\66\34\304,\34\206H\11\323a\2g\10\31\271=\256"
|
||||
"a\210\322(\215\206!J\243\64\32\206(\215\322$L\344\4g\37 \273<\236(\32\16I\224D-"
|
||||
"C\64$Q\313\20U\242h\70$Q\16DIT\22%\1g*\27\273<\336\34\213\207s:\34\324"
|
||||
"\34\332\201\244\32\225\264LM\1kc\32\253<\216\7\65\307r \312\201h\320\242\34\210r \312\201"
|
||||
"(\35\16\2l\64\30\273<\336\34\313\261\312\220(iRN\252Q\61\252\265DIX\6n\5\36\273"
|
||||
"<\236\264\62\14\71\220E\311 %Y\232\14CTK\264%\312\222)+e\221\2n\341 \273<\236"
|
||||
"\60\11\223a\310\242$\212\206A\11\223\60\31\206(i\231\222NJ\242D-Q(r[\27\272=\336"
|
||||
"\70\212\243t\30\224\60\207\302\341\220\346P\16\345P\10r\327\35\273<\216\250\232Dq\64,\215\222\262"
|
||||
"DR\322)I\244h\311\342\244\226di\4s* \273<\216,\252T\206$\12\223(I\206!\312"
|
||||
"RiP*\232\244\14Z\224%\245A\312\12s\64 \273<\216\244\62D\305\244\62\14\321\22'\311\240"
|
||||
"\230*\265\60\31\206(\311\242\244\224D\225,u\62\26\271=\216\207,\323\262\341\240eZ\66\34\264b"
|
||||
"\216\344H\10u\63\26\271=\316\34\11\207C\226\15\7-\323\262\341\240\25s$\4vx\32\273<\236"
|
||||
"a\211\243\226(\11[\206$\312B\61\36\16i\222\3Y\266\12v}\20\270>\276\70\35\316\362p\210"
|
||||
"\315\303!\16w\345\33\273<\256\34\313\241A\31\244,\312J\303)+e\245JT\311\222A\307\0y"
|
||||
"\313\35\273<>)\33\323\60I\206\245\26%\332RT\242,\311\222\60K\302(\253\244\1y\315\33\273"
|
||||
"<>)\33\323hx\211Z\242H)%\312\60(a\32\246a\32f\0y\322\33\273<\276\332\230F"
|
||||
"IeHJ-Q\262\24\225(R\342,\15\63\65Q\1z\313\30\273<\336\34L\207CN\10\323\60"
|
||||
"\216r \312\201$\307\302\341 \177\212\27\273<\256\264\26\16\347\34\313\201C\16\344X:\34\324\34K"
|
||||
"\1\201J#\273<\236)\311\222(\311\222d\220\246$K\206A\251#\7)\251EI\62(Q\222%"
|
||||
"\211\62(\0\201\363\27\273<\236\341\232CYZ\33\316\71\226\3\207\34\310\261t\70\10\202\222\30\273<"
|
||||
"\276\332p\320\352H\16\206\303A\312\261\34\313\261\34\33\6\5\206N\34\273<\336A\216\207C\22\205\321"
|
||||
"\60hQ\232D\303\220\344X\64\204QI\21\7\206\307\32\273<\256\60-F\303\243\322\230\64%\203\62"
|
||||
"fqR\213\226l\212\206\0\206\360\36\273<\256\60\33\222A\13\223d\210\224\254\42Ia\64\14Z\224"
|
||||
"e\303 g\311p\11\214\67\32\273<\316(\16KY\224ia\24\207\341\60(J\230da:\254a"
|
||||
"\4\217\233\27\273<\336x\270\245\251\224\3I\70\34\324x\70\347X\216\245\0\217\260\34\273<\256\341\224"
|
||||
"c\311\260\345\330pJ\312I)K\42-\312JI\224db\0\221I\33\273<\216\7\61\311\221\352p"
|
||||
"\252D-Q\264M\71\20\15\247\34\210\206\13\0\225\360\33\273<\256h\30\242X\207\244A\22C\61\224"
|
||||
"\6I\14\305P\31\206D\7\6\226M\36\273<\216!\12\243hX\42)Q\245$\222\246\254\224\14\203"
|
||||
"\322\226$\303 gq\6\226\350\30\273<\216\7\65\307\342\341\224\225\222N\221\247J\247\254\224E\12\0"
|
||||
"\226\352\31\273<\236\341\234\16\217\241\242$J\216\16w,\33\6\35\213\206\13\0\227\34\35\273<\236\341"
|
||||
"\234\16OI\251\66$\203\22e\331\220I%%\31\222NY\66$\0\227\62\36\273<\236\341\234\16O"
|
||||
"Ii\220\206$J\244d\310\304HZ\16I-J\206hH\0\232l\30\273<\236a\320\261\64L\263"
|
||||
"\64L\207;\226c\303)\307rD\1\236!\35\273<~ \33\222AL\262$J\232\222nQ\61\32"
|
||||
"\226r\22\15\212\16\345\210\2\237 \36\272=\216!\31\222\34H\206dHr \31\356\240\244DIE"
|
||||
"\262$J\313\240L\1\237\231\32\273<\316(\7\262\70\36\16b\222#\245\60J\322H\315*\231I\32"
|
||||
"\2\0";
|
||||
"\16\5Qm\24\273<\316\34\314I\303Ag\314\342\260\34\345\210\16\5Q\254\30\273<\276\34\33T-"
|
||||
"\214\222\34\312\21\333\24\315\71\240\203\71\30\2R\6\30\273<\276r\226\26\323,\7\222d\30\222\60\213"
|
||||
"\263\64\254F\242\6R\35\33\273<\236\34\214\206\203T+\25\243D\211\42E\213*Q[\251\30%\231"
|
||||
"\2SA\27\273<\336\34\313\261\34K\207\203\232c\71\226c\71\226c)\0SH\27\272=\256\34\32"
|
||||
"\206(\13\353P\70\34\322\34\312\241\34\312\241\20So\33\272=\276x\32\306LJ\62)\311\244$S"
|
||||
"\224l\351\226DY\24j!\0V\333\30\251=\216\207(\211\244$\222\222HJ\42%\32f\35x\320"
|
||||
"\201\0X\354\30\273<~ \207\266A\307r\254\62\34\324\34\313\261\34\213\262\341\2Y\4\32\273<\256"
|
||||
"\60\15\323!I\243D\253\364\324\22\305Y\232Da&\306C\0Y\17\31\273<\216\7\65G\206\65L"
|
||||
"\247\64\31\322\60\34\206,\252\205\362\64\4Y'\30\273<\336\34\313\261t\70\250\71\226CI\216\324\201"
|
||||
",-\351\200\0[P\30\273<\256a\310\241\34\312\241\34K\207\203\232c\71\226#u(\6[\305\31"
|
||||
"\273<\336tx\207\224aH\322\34\70\204Qq\30\302\250\70\14\321:[\322\33\273<\336tx\213\42"
|
||||
"e\30\222\60\312\206\203\30\305I\24m\212\250\203\32\0\134\17\30\273<\336\34\313\261\34\210\212Q\26e"
|
||||
"\245,\24\253\71R\207b\0]\362\26\252=\216\203\16\345P\71\32\6)\207rDGt$\31\16]"
|
||||
"\363\30\272=\216\203\24Gq\24G\303 \345P\16\345\210\216\350H\62\34^t\27\273<\256\34\33."
|
||||
"a\65\36\6\255\234\205\303A\316\261\34\13\1^\232\33\273<\356x\70eq\62l\245l\70eQ\226"
|
||||
"\14[\224\204Q\26%\252\0^\377\30\273<\276\60\15\323\60\32\16Z\230\206i\230\206i\230\16k\30"
|
||||
"\1`\312\36\273<\256\60M\206A\321\201$\31\226R\226\224\6-L\243\244\226D%\245T\13\1b"
|
||||
"\12\31\273<\356$G\242l\70eq\26e\245,\24KI\230\264e\223\32b\14\33\273<\356$G"
|
||||
"\242l\70eq\26e\203\224U\302j&%Y\224H\242\0e\345\15\247>\216\203j\35\256\326\341\32"
|
||||
"e\366\34\273<~$\32\302(\32NaT\211\242!J\242\226\250\30\25\243!\314\221\11f\16\31\273"
|
||||
"<\356\341\224I\65)\32N\231T\223\242\341\224\245a-\211\324\4f\37\33\273<\256a\10\323p\30"
|
||||
"\302\64\34\206\60\212\207K\230\3\207\34H\207\203\0f%\32\273<\336x\70\244\71pP\343\341 \211"
|
||||
"\212\62%Y\62\244a:L\0f\221\33\273<\256a\10\323p\30\302\64\33\316I\66\34\304,\34\206"
|
||||
"H\11\323a\2g\10\31\271=\256a\210\322(\215\206!J\243\64\32\206(\215\322$L\344\4g\37"
|
||||
" \273<\236(\32\16I\224D-C\64$Q\313\20U\242h\70$Q\16DIT\22%\1g*"
|
||||
"\27\273<\336\34\213\207s:\34\324\34\332\201\244\32\225\264LM\1kc\32\253<\216\7\65\307r "
|
||||
"\312\201h\320\242\34\210r \312\201(\35\16\2l\64\30\273<\336\34\313\261\312\220(iRN\252Q"
|
||||
"\61\252\265DIX\6n\5\36\273<\236\264\62\14\71\220E\311 %Y\232\14CTK\264%\312\222"
|
||||
")+e\221\2n\341 \273<\236\60\11\223a\310\242$\212\206A\11\223\60\31\206(i\231\222NJ"
|
||||
"\242D-Q(r[\27\272=\336\70\212\243t\30\224\60\207\302\341\220\346P\16\345P\10r\327\35\273"
|
||||
"<\216\250\232Dq\64,\215\222\262DR\322)I\244h\311\342\244\226di\4s* \273<\216,"
|
||||
"\252T\206$\12\223(I\206!\312RiP*\232\244\14Z\224%\245A\312\12s\64 \273<\216\244"
|
||||
"\62D\305\244\62\14\321\22'\311\240\230*\265\60\31\206(\311\242\244\224D\225,u\62\26\271=\216\207"
|
||||
",\323\262\341\240eZ\66\34\264b\216\344H\10u\63\26\271=\316\34\11\207C\226\15\7-\323\262\341"
|
||||
"\240\25s$\4vx\32\273<\236a\211\243\226(\11[\206$\312B\61\36\16i\222\3Y\266\12v"
|
||||
"}\20\270>\276\70\35\316\362p\210\315\303!\16y\313\35\273<>)\33\323\60I\206\245\26%\332R"
|
||||
"T\242,\311\222\60K\302(\253\244\1y\315\33\273<>)\33\323hx\211Z\242H)%\312\60("
|
||||
"a\32\246a\32f\0y\322\33\273<\276\332\230FIeHJ-Q\262\24\225(R\342,\15\63\65"
|
||||
"Q\1z\313\30\273<\336\34L\207CN\10\323\60\216r \312\201$\307\302\341 \177\212\27\273<\256"
|
||||
"\264\26\16\347\34\313\201C\16\344X:\34\324\34K\1\201J#\273<\236)\311\222(\311\222d\220\246"
|
||||
"$K\206A\251#\7)\251EI\62(Q\222%\211\62(\0\201\363\27\273<\236\341\232CYZ\33"
|
||||
"\316\71\226\3\207\34\310\261t\70\10\202\222\30\273<\276\332p\320\352H\16\206\303A\312\261\34\313\261\34"
|
||||
"\33\6\5\206N\34\273<\336A\216\207C\22\205\321\60hQ\232D\303\220\344X\64\204QI\21\7\206"
|
||||
"\307\32\273<\256\60-F\303\243\322\230\64%\203\62fqR\213\226l\212\206\0\206\360\36\273<\256\60"
|
||||
"\33\222A\13\223d\210\224\254\42Ia\64\14Z\224e\303 g\311p\11\214\67\32\273<\316(\16K"
|
||||
"Y\224ia\24\207\341\60(J\230da:\254a\4\217\233\27\273<\336x\270\245\251\224\3I\70\34"
|
||||
"\324x\70\347X\216\245\0\217\260\34\273<\256\341\224c\311\260\345\330pJ\312I)K\42-\312JI"
|
||||
"\224db\0\221I\33\273<\216\7\61\311\221\352p\252D-Q\264M\71\20\15\247\34\210\206\13\0\225"
|
||||
"\360\33\273<\256h\30\242X\207\244A\22C\61\224\6I\14\305P\31\206D\7\6\226M\36\273<\216"
|
||||
"!\12\243hX\42)Q\245$\222\246\254\224\14\203\322\226$\303 gq\6\226\350\30\273<\216\7\65"
|
||||
"\307\342\341\224\225\222N\221\247J\247\254\224E\12\0\226\352\31\273<\236\341\234\16\217\241\242$J\216\16"
|
||||
"w,\33\6\35\213\206\13\0\227\34\35\273<\236\341\234\16OI\251\66$\203\22e\331\220I%%\31"
|
||||
"\222NY\66$\0\227\62\36\273<\236\341\234\16OIi\220\206$J\244d\310\304HZ\16I-J"
|
||||
"\206hH\0\232l\30\273<\236a\320\261\64L\263\64L\207;\226c\303)\307rD\1\236!\35\273"
|
||||
"<~ \33\222AL\262$J\232\222nQ\61\32\226r\22\15\212\16\345\210\2\237 \36\272=\216!"
|
||||
"\31\222\34H\206dHr \31\356\240\244DIE\262$J\313\240L\1\237\231\32\273<\316(\7\262"
|
||||
"\70\36\16b\222#\245\60J\322H\315*\231I\32\2\0";
|
||||
|
||||
/*
|
||||
Fontname: -wenquanyi-wenquanyi bitmap song-bold-r-normal--16-160-75-75-P-80-iso10646-1
|
||||
Fontname: -wenquanyi-wenquanyi bitmap song-medium-r-normal--16-160-75-75-P-80-iso10646-1
|
||||
Copyright: (null)
|
||||
Glyphs: 21/29889
|
||||
Glyphs: 21/41295
|
||||
BBX Build Mode: 0
|
||||
*/
|
||||
const uint8_t u8g2_font_wqy12b_t_lunar[491] U8G2_FONT_SECTION("u8g2_font_wqy12b_t_lunar") =
|
||||
"\25\0\4\3\5\5\3\4\6\20\20\0\376\13\375\14\374\0\0\0\0\0\253\60\16g\25S\231\221P\303"
|
||||
"o$\324\214\0\61\13f\25S\221\31!\322O\14\62\15g\25\323\250\220\241\221R\244W\7\63\21h"
|
||||
"\21\323(\221\221\23\223\222\241SF#R\2\64\25h\21\323\222\32\242\221\20Q!#!#q\20%"
|
||||
"\246\2\0\65\21h\21S\270\20Sf\62\42'&F#R\2\66\24h\21S\241\21\221\20\23\63\31"
|
||||
"\221\20b$!\42C\2\67\21h\21S\70\10\223\22\223\22\223\22S%&\4\70\23h\21S\241\21"
|
||||
"\321\33\32\21\11!F\22\42\62$\0\71\24h\21S\241\21\221\20b$!\62b\246BD\206\4\0"
|
||||
"\0\0\0\4\377\377N\0\10\60\320cx N\11\20\220\21\343\70\270\307\335A=\336\35\34\10N\214"
|
||||
"\15P\61c\71\250\307\237\36\34\10N\224\36\320\361\342\70\270\23\327\364\200PHPHPHPHN"
|
||||
"JNJNJ\346\340@\0Qm \360\361b\223\7\220\7\20\227\207;\70\220G'\42*#(%"
|
||||
"'&%'$)\42*\1V\333\37\256\365bx \242\204D\11\211\22\22%$J(dD(\204"
|
||||
"\16\4+I\17\16H\5^t\37\20\322\342\21\27\77\250\21\22\24\222\223\222<\240\222\221\224\221\224\21"
|
||||
";\70\20\24\327\31\0e\345\20\352\335b\70(\343\331\301\31\237\35\234\11f\37\36\316\365b\71\30\22"
|
||||
"\23:\30\22\23:\30T\42x@\42#&$x\60(,vpg\10&\15\332\342\71\230\21\223\21"
|
||||
"\223\21\223\21\223\71\230\21\223\21\223\21\223\71\230\21\223\21\23\221\23\221\223\20\63\224\0g\37.\17\322"
|
||||
"bQ)\42aq\60\242\205\210\26\42\42\26&*D\264\20\21\261\20\321\302D\205\310\201\211\224\204\214"
|
||||
"\210\10\215\204\220\210\221\12\0\0";
|
||||
const uint8_t u8g2_font_wqy12_t_lunar[484] U8G2_FONT_SECTION("u8g2_font_wqy12_t_lunar") =
|
||||
"\25\0\4\2\4\5\3\4\6\17\20\0\376\13\375\14\374\0\0\0\0\0\243\60\16\267\212\250l*R~"
|
||||
"\225\310d&\0\61\12\265\216\250DF\375\311@\62\16\267\212\250l*R\261T\237\15\6\1\63\22\267"
|
||||
"\212h\14\42\241\134,\225\331\225\211\42\203\10\0\64\23\270\212i\305T\211P$\323I(\62\30\250r"
|
||||
"%\0\65\20\267\212(\34\310\312\6\272\262\230(\62\210\0\66\23\267\212\250\14\42\251X\305D\223HY"
|
||||
"%\62\231\11\0\67\16\267\212(\34\304R\261\252XU\254\6\70\23\267\212\250l*R\252D&\263\251"
|
||||
"H\251\22\231\314\4\71\22\267\212\250l*RV\211\214d\21\253\212\14\42\0\0\0\0\4\377\377N\0"
|
||||
"\10\37\350\60\374\0N\11\21\317\210p\14\36\344\271\31\34\350y\62\370\0N\214\15\257\230\260\14\16\364"
|
||||
"\374\311\340\3N\224\34\357xp\14\36\344\342M\7\7\301T\60\25L\5S\271X.\226\213e\6\37"
|
||||
"Qm\34\377x\260\345\1y@<\17\33|O\225\211\206\202\261\134U\60\24\215d\23\0V\333\35\335"
|
||||
"z\60|\240\251\321\324hj\64\65\232\32I(#I\15\24\311\251v\360m\0^t\35\17i\360\304"
|
||||
"\343\203\3M*\230\312\305\222\203\203T(\31J\206b\203\17\343\235\1e\345\21\371n\60<\310y\67"
|
||||
"\70\320\371np\240\13f\37\36\355z\260\14\216r\241\301Q.\64\70\254\11\16\16\42\241X*\70\70"
|
||||
"\14\307\6\17\2g\10#\14m\360\14nr\231\134&\227\311e\6\67\271L.\223\313\14nr\231\134"
|
||||
"$\30\11&r\11e\2g\37:\16i\260d\222\231\310@\61\30$\62\221L$\23\311D\62\221\201"
|
||||
"d \311D\62\221L$\23\31H\62\221Ld \311D\62\203\213L*\22\212d\22\241D*\223P"
|
||||
"U\0\0";
|
||||
|
||||
|
||||
/*
|
||||
Fontname: -Adobe-Helvetica-Bold-R-Normal--20-140-100-100-P-105-ISO10646-1
|
||||
Copyright: Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved.
|
||||
Glyphs: 18/756
|
||||
BBX Build Mode: 0
|
||||
*/
|
||||
const uint8_t u8g2_font_helvB14_tn[287] U8G2_FONT_SECTION("u8g2_font_helvB14_tn") =
|
||||
"\22\0\3\3\4\4\2\5\5\11\21\0\375\16\374\16\374\0\0\0\0\1\2 \5\0\306\12*\17g\343"
|
||||
"\274\230$\42\251\315$\242X\4\0+\14\210\307=\261\332\341 \23\253\1,\11c\267\212\203\204\22\2"
|
||||
"-\7\65R\213\207\0.\7\63\303\212\203\0/\17\345\302:M#\231\322H&\32\311\324\0\60\17\331"
|
||||
"B\275\341i\262\346o\223\245\343\14\0\61\12\326C\275\321\341 \333\77\62\21\331B\255\332ef\33O"
|
||||
"\207\265\32u\371p \63\23\331B\255\332e\64\231\211\207\324\62\331f\242\334J\0\64\25\331B\335)"
|
||||
"\261f\223\214&#\321d\64\71\34\250\343\25\0\65\25\331B\215C\344\20\31\217O\207\310\210<\266\231"
|
||||
"\16%\23\0\66\24\331B-\323!\62+OF\207\10\311\330h\232\334J\0\67\20\331B\215\7\362t"
|
||||
"y:\236\216\247\343U\0\70\22\331B\255\332e\346\66\271\325&kn\223[\11\0\71\24\331B\255\332"
|
||||
"edl\64Q\16\241\311\270\66\71\204L\0:\11\243C\213\203\34z\20\0\0\0\4\377\377\0";
|
||||
|
||||
/*
|
||||
Fontname: -Adobe-Helvetica-Bold-R-Normal--25-180-100-100-P-138-ISO10646-1
|
||||
Copyright: Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved.
|
||||
Glyphs: 18/756
|
||||
BBX Build Mode: 0
|
||||
*/
|
||||
const uint8_t u8g2_font_helvB18_tn[389] U8G2_FONT_SECTION("u8g2_font_helvB18_tn") =
|
||||
"\22\0\4\3\4\5\3\5\5\15\26\0\375\23\373\23\373\0\0\0\0\1h \5\0\30-*\17x\312"
|
||||
"\365\210\311HH\34\214\320\210h\1+\16\314\32\177\211\352\352\340\301\224\250\256\0,\12c\334.\34H"
|
||||
"HP\0-\6\67h\61|.\7\63\14/\34\10/\22\67\13qi$\245HJ#)ER\212\244"
|
||||
"T\1\60\33,\11\373X\35\304\220\220\14\215\14M\214\371g\23C#C#l\16\242l\0\61\14'"
|
||||
"\15;\255\71\70 \332\377\3\62\33,\11\373T\35\310\314PLM\214\231M\16\16\322\61+\243c\70"
|
||||
"y\360`\0\63\36,\11\373T\35\310,\231\232\230\232\230\232\34\34\253\273\34\235\64\263\242\230!\71\30"
|
||||
"\262\1\64\33,\11\373\15\262k&\61\65\61%\62$\263\215\320\310\320\310\301\203\271\311M\0\65\35,"
|
||||
"\11{\34\214\34\214Lny\20t \63C\71:\71ifu\20Cr e\3\66 ,\11;U"
|
||||
"\35\210\320\214L\231Y\256 :\30)\241 \232\30s\66\61\64\302\346 \312\6\0\67\30,\11;|"
|
||||
"\60H\270rprprpr\220pr\220pr\16\0\70\42,\11;\221\35\4\215\314\14\215\14\215"
|
||||
"\14\215\14\315\214LY\35\304\14M\214y\66\61\64r\60d\3\71\37,\11\373\30\35\310\220P\20M"
|
||||
"\214yvDARq@S\61\71i\65ARr U\4:\12\343\14/\34\310C\36\10\0\0\0"
|
||||
"\4\377\377\0";
|
||||
|
||||
10
GUI/fonts.h
@@ -6,9 +6,6 @@
|
||||
/**
|
||||
* 文字列表:
|
||||
所有 ASCII 字符 (32-128)
|
||||
|
||||
未知
|
||||
农历
|
||||
正月二月三月四月五月六月七月八月九月十月
|
||||
冬月腊月
|
||||
闰
|
||||
@@ -25,13 +22,16 @@
|
||||
星期
|
||||
*/
|
||||
extern const uint8_t u8g2_font_wqy9_t_lunar[] U8G2_FONT_SECTION("u8g2_font_wqy9_t_lunar");
|
||||
|
||||
/**
|
||||
* 文字列表:
|
||||
0123456789
|
||||
年月日
|
||||
星期
|
||||
一二三四五六
|
||||
*/
|
||||
extern const uint8_t u8g2_font_wqy12b_t_lunar[] U8G2_FONT_SECTION("u8g2_font_wqy12b_t_lunar");
|
||||
extern const uint8_t u8g2_font_wqy12_t_lunar[] U8G2_FONT_SECTION("u8g2_font_wqy12_t_lunar");
|
||||
|
||||
// 以下字库来自 u8g2,用于显示数字
|
||||
extern const uint8_t u8g2_font_helvB14_tn[] U8G2_FONT_SECTION("u8g2_font_helvB14_tn");
|
||||
extern const uint8_t u8g2_font_helvB18_tn[] U8G2_FONT_SECTION("u8g2_font_helvB18_tn");
|
||||
#endif
|
||||
|
||||
16
README.md
@@ -4,7 +4,7 @@
|
||||
|
||||
支持 nRF51/nRF52 MCU 作为主控,驱动 IC 为 UC8176 的 4.2 寸黑白/黑白红墨水屏,同时还支持自定义墨水屏到 MCU 的引脚映射,支持睡眠唤醒(NFC / 无线充电器)。
|
||||
|
||||

|
||||

|
||||
|
||||
## 支持设备
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
线圈引脚:07
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
- 老五 4.2 寸价签,黑白红三色版本
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
LED引脚:03/04/05 (有三个 LED,任选一个使用)
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
## 上位机
|
||||
|
||||
@@ -45,29 +45,29 @@
|
||||
- 演示:https://www.bilibili.com/video/BV1KWAVe1EKs
|
||||
- 交流群: [1033086563](https://qm.qq.com/q/SckzhfDxuu) (点击链接加入群聊)
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
## 开发
|
||||
|
||||
> **注意:**
|
||||
> - 必须使用 [Keil 5.36](https://img.anfulai.cn/bbs/96992/MDK536.EXE) 或以下版本,nRF51 SDK 只支持 V5 版本的 ARM 编译器,从 5.37 版本开始 Keil 已经不再内置 V5 版本编译器
|
||||
> - 推荐使用 [Keil 5.36](https://img.anfulai.cn/bbs/96992/MDK536.EXE) 或以下版本, 从 Keil 5.37 版本开始已经不再内置 nRF5 SDK 所需的 V5 版本 ARM 编译器
|
||||
> - `sdk10` 分支为旧版 SDK 代码,蓝牙协议栈占用的空间小一些,用于支持 128K Flash 芯片
|
||||
|
||||
项目配置有几个 `Target`:
|
||||
|
||||
- `nRF51802_xxAA`: 用于编译 256K Flash 固件
|
||||
- `nRF51822_xxAA`: 用于编译 256K Flash 固件
|
||||
- `flash_softdevice`: 刷蓝牙协议栈用(只需刷一次)
|
||||
|
||||
烧录器可以使用 J-Link 或者 DAPLink(可使用 [RTTView](https://github.com/XIVN1987/RTTView) 查看 RTT 日志)。
|
||||
|
||||
**刷机流程:**
|
||||
|
||||
> 如不修改代码,强烈建议到 [Releases](https://github.com/tsl0922/EPD-nRF5/releases) 下载二进制固件,**不需要单独下载蓝牙协议栈**。
|
||||
> **注意:** 这是自己编译代码的刷机流程。如不改代码,强烈建议到 [Releases](https://github.com/tsl0922/EPD-nRF5/releases) 下载编译好的固件,**不需要单独下载蓝牙协议栈**,且有 [烧录教程](https://www.bilibili.com/opus/1042166787832021028) (没有 Keil 开发经验的,请不要给自己找麻烦去编译)
|
||||
|
||||
1. 全部擦除 (Keil 擦除后刷不了的话,使用烧录器的上位机软件擦除试试)
|
||||
2. 切换到 `flash_softdevice`,下载蓝牙协议栈,**不要编译直接下载**(只需刷一次)
|
||||
3. 切换到 `nRF51802_xxAA`,先编译再下载
|
||||
3. 切换到 `nRF51822_xxAA`,先编译再下载
|
||||
|
||||
## 附录
|
||||
|
||||
|
||||
BIN
docs/images/0.jpg
Normal file
|
After Width: | Height: | Size: 288 KiB |
|
Before Width: | Height: | Size: 319 KiB After Width: | Height: | Size: 319 KiB |
|
Before Width: | Height: | Size: 117 KiB After Width: | Height: | Size: 117 KiB |
BIN
docs/images/3.jpg
Normal file
|
After Width: | Height: | Size: 356 KiB |
|
Before Width: | Height: | Size: 278 KiB |
|
Before Width: | Height: | Size: 192 KiB |