mirror of
https://github.com/WeActStudio/WeActStudio.EpaperModule.git
synced 2026-08-16 13:13:45 +02:00
add EPD 2.9 inch module support
This commit is contained in:
@@ -26,9 +26,9 @@ void jump_to_app(uint32_t addr);
|
||||
// define for White Black Red Epaper Module
|
||||
#define EPD_BWR
|
||||
|
||||
uint8_t image_bw[4000];
|
||||
uint8_t image_bw[EPD_W_BUFF_SIZE * EPD_H];
|
||||
#ifdef EPD_BWR
|
||||
uint8_t image_red[4000];
|
||||
uint8_t image_red[EPD_W_BUFF_SIZE * EPD_H];
|
||||
#endif
|
||||
|
||||
/*!
|
||||
@@ -66,15 +66,15 @@ int main(void)
|
||||
uint32_t tick1, tick2;
|
||||
tick1 = tick2 = get_tick();
|
||||
|
||||
printf("\r\nWeAct Studio Core Board\r\n");
|
||||
printf("weactstudio.taobao.com\r\n");
|
||||
printf("weactstudio.aliexpress.com\r\n");
|
||||
printf("wwww.weact-tc.cn\r\n\r\n");
|
||||
printf("SystemClk:%d\r\n", SystemCoreClock);
|
||||
printf("CK_AHB is %d\r\n", rcu_clock_freq_get(CK_AHB));
|
||||
printf("CK_APB1 is %d\r\n", rcu_clock_freq_get(CK_APB1));
|
||||
printf("CK_APB2 is %d\r\n", rcu_clock_freq_get(CK_APB2));
|
||||
|
||||
printf("\r\nWeAct Studio Core Board\r\n");
|
||||
printf("weactstudio.taobao.com\r\n");
|
||||
printf("weactstudio.aliexpress.com\r\n");
|
||||
printf("wwww.weact-tc.cn\r\n\r\n");
|
||||
printf("SystemClk:%d\r\n", SystemCoreClock);
|
||||
printf("CK_AHB is %d\r\n", rcu_clock_freq_get(CK_AHB));
|
||||
printf("CK_APB1 is %d\r\n", rcu_clock_freq_get(CK_APB1));
|
||||
printf("CK_APB2 is %d\r\n", rcu_clock_freq_get(CK_APB2));
|
||||
|
||||
printf("Epaper Module Test\r\n");
|
||||
|
||||
epd_io_init();
|
||||
@@ -88,11 +88,10 @@ int main(void)
|
||||
|
||||
epd_paint_selectimage(image_bw);
|
||||
epd_paint_clear(EPD_COLOR_WHITE);
|
||||
epd_paint_showPicture(0, 0, 250, 122, gImage_2, EPD_COLOR_BLACK);
|
||||
|
||||
epd_paint_selectimage(image_red);
|
||||
epd_paint_clear(EPD_COLOR_WHITE);
|
||||
epd_paint_showPicture(0, 0, 250, 122, gImage_3, EPD_COLOR_WHITE);
|
||||
epd_paint_showPicture((EPD_H - 250) / 2, (EPD_W - 122) / 2, 250, 122, gImage_4, EPD_COLOR_WHITE);
|
||||
|
||||
epd_display(image_bw, image_red);
|
||||
|
||||
@@ -100,9 +99,15 @@ int main(void)
|
||||
|
||||
epd_paint_selectimage(image_bw);
|
||||
epd_paint_clear(EPD_COLOR_WHITE);
|
||||
#ifdef EPD_213
|
||||
epd_paint_showString(10, 0, (uint8_t *)&"2.13 Epaper Module", EPD_FONT_SIZE24x12, EPD_COLOR_BLACK);
|
||||
epd_paint_showString(10, 29, (uint8_t *)&"Designed By WeAct Studio", EPD_FONT_SIZE16x8, EPD_COLOR_BLACK);
|
||||
epd_paint_showString(10, 50, (uint8_t *)&"with 250 x 122 resolution", EPD_FONT_SIZE16x8, EPD_COLOR_BLACK);
|
||||
#endif
|
||||
#ifdef EPD_29
|
||||
epd_paint_showString(10, 0, (uint8_t *)&"2.9 Epaper Module", EPD_FONT_SIZE24x12, EPD_COLOR_BLACK);
|
||||
epd_paint_showString(10, 50, (uint8_t *)&"with 296 x 128 resolution", EPD_FONT_SIZE16x8, EPD_COLOR_BLACK);
|
||||
#endif
|
||||
epd_paint_showString(10, 29, (uint8_t *)&"Designed By WeAct Studio", EPD_FONT_SIZE16x8, EPD_COLOR_BLACK);
|
||||
|
||||
epd_paint_selectimage(image_red);
|
||||
epd_paint_clear(EPD_COLOR_WHITE);
|
||||
@@ -113,7 +118,7 @@ int main(void)
|
||||
#if 0
|
||||
epd_paint_showString(10,100,(uint8_t *)&"GD32F303CCT6 Example",EPD_FONT_SIZE16x8,EPD_COLOR_RED);
|
||||
#else
|
||||
epd_paint_drawRectangle(10, 103, 240, 116, EPD_COLOR_RED, 1);
|
||||
epd_paint_drawRectangle(10, 103, EPD_H - 10, 116, EPD_COLOR_RED, 1);
|
||||
#endif
|
||||
|
||||
epd_display(image_bw, image_red);
|
||||
@@ -122,7 +127,7 @@ int main(void)
|
||||
|
||||
epd_paint_selectimage(image_bw);
|
||||
epd_paint_clear(EPD_COLOR_WHITE);
|
||||
epd_paint_showPicture(0, 0, 250, 122, gImage_1, EPD_COLOR_WHITE);
|
||||
epd_paint_showPicture((EPD_H - 250) / 2, (EPD_W - 122) / 2, 250, 122, gImage_4, EPD_COLOR_WHITE);
|
||||
|
||||
epd_displayBW(image_bw);
|
||||
|
||||
@@ -130,9 +135,15 @@ int main(void)
|
||||
|
||||
epd_paint_selectimage(image_bw);
|
||||
epd_paint_clear(EPD_COLOR_WHITE);
|
||||
#ifdef EPD_213
|
||||
epd_paint_showString(10, 0, (uint8_t *)&"2.13 Epaper Module", EPD_FONT_SIZE24x12, EPD_COLOR_BLACK);
|
||||
epd_paint_showString(10, 29, (uint8_t *)&"Designed By WeAct Studio", EPD_FONT_SIZE16x8, EPD_COLOR_BLACK);
|
||||
epd_paint_showString(10, 50, (uint8_t *)&"with 250 x 122 resolution", EPD_FONT_SIZE16x8, EPD_COLOR_BLACK);
|
||||
#endif
|
||||
#ifdef EPD_29
|
||||
epd_paint_showString(10, 0, (uint8_t *)&"2.9 Epaper Module", EPD_FONT_SIZE24x12, EPD_COLOR_BLACK);
|
||||
epd_paint_showString(10, 50, (uint8_t *)&"with 296 x 128 resolution", EPD_FONT_SIZE16x8, EPD_COLOR_BLACK);
|
||||
#endif
|
||||
epd_paint_showString(10, 29, (uint8_t *)&"Designed By WeAct Studio", EPD_FONT_SIZE16x8, EPD_COLOR_BLACK);
|
||||
|
||||
sprintf((char *)&text, ">> Hello World.");
|
||||
epd_paint_showString(10, 71, text, EPD_FONT_SIZE24x12, EPD_COLOR_BLACK);
|
||||
@@ -140,7 +151,7 @@ int main(void)
|
||||
#if 0
|
||||
epd_paint_showString(10,100,(uint8_t *)&"GD32F303CCT6 Example",EPD_FONT_SIZE16x8,EPD_COLOR_BLACK);
|
||||
#else
|
||||
epd_paint_drawRectangle(10, 103, 240, 116, EPD_COLOR_BLACK, 1);
|
||||
epd_paint_drawRectangle(10, 103, EPD_H - 10, 116, EPD_COLOR_BLACK, 1);
|
||||
#endif
|
||||
epd_displayBW(image_bw);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user