From 2c76f2653b478c09a8b38030fca9695c359dcefe Mon Sep 17 00:00:00 2001 From: zhaohe Date: Sat, 27 Jan 2024 10:26:12 +0800 Subject: [PATCH] update --- .vscode/settings.json | 3 +- app/src/basic/ssd1306/driver_ssd1306_basic.c | 76 ++++++++++++++---- app/src/basic/ssd1306/driver_ssd1306_basic.h | 14 ++-- app/src/basic/ssd1306/fontlib.c | 15 ++-- app/src/basic/ssd1306/fontlib.h | 11 +-- app/src/one_conduction/display_manager.c | 92 +++++++++++++++++----- app/src/one_conduction/display_manager.h | 14 ++-- app/src/one_conduction/font.h | 106 +++++++++++++++++++------- app/src/one_conduction/one_conduction_board.c | 24 +++--- app/src/one_conduction/one_conduction_board.h | 2 +- app/src/one_conduction/one_conduction_main.c | 8 +- 11 files changed, 261 insertions(+), 104 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index c7b552b..4439b0a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -82,5 +82,6 @@ "fontlib.h": "c", "font.h": "c", "display_manager.h": "c" - } + }, + "files.encoding": "gbk" } \ No newline at end of file diff --git a/app/src/basic/ssd1306/driver_ssd1306_basic.c b/app/src/basic/ssd1306/driver_ssd1306_basic.c index 507eae4..07b32ca 100644 --- a/app/src/basic/ssd1306/driver_ssd1306_basic.c +++ b/app/src/basic/ssd1306/driver_ssd1306_basic.c @@ -527,11 +527,11 @@ uint8_t ssd1306_basic_draw_one_chr(uint8_t xs, uint8_t ys, char *str, FontLibrar bool is_ascii = false; uint8_t charsize = 1; - is_ascii = utf8_is_ascii(str); + is_ascii = str_is_ascii(str); if (is_ascii) { charsize = 1; } else { - charsize = 3; // utf8 编码中文是3个字节 + charsize = 3; // utf8 编码中文?3个字? } FontLibrary_findchar(frontlib, str, &frontbuf); @@ -565,21 +565,21 @@ uint8_t ssd1306_basic_draw_str(uint8_t xs, uint8_t ys, uint8_t *xchange, uint8_t uint8_t x = xs; uint8_t y = ys; StrIterator_t iterator; - if (frontlib->fontCode == kutf8) { - utf8_iterator_start(&iterator, str); - char *nowchr = NULL; - while (true) { - utf8_iterator_next(&iterator, &nowchr); - if (!nowchr) { - break; - } - ssd1306_basic_draw_one_chr(x, y, nowchr, frontlib); - x += (uint8_t)(frontlib->widthPixel); /* x + font/2 */ - *xchange += frontlib->widthPixel; + *xchange = 0; + *ychange = 0; + str_iterator_start(&iterator, frontlib->fontCode, str); + char *nowchr = NULL; + while (true) { + str_iterator_next(&iterator, &nowchr); + if (!nowchr) { + break; } + ssd1306_basic_draw_one_chr(x, y, nowchr, frontlib); + x += (uint8_t)(frontlib->widthPixel); /* x + font/2 */ + *xchange = *xchange + frontlib->widthPixel; } - *ychange += frontlib->heightPixel; + *ychange = frontlib->heightPixel; return 0; } @@ -618,7 +618,7 @@ uint8_t ssd1306_basic_draw_battery_level(uint8_t xs, uint8_t ys, uint8_t *xchang int batteryInterBodyWidth = batteryBodyWidth - blank_width * 2 - border_width * 2; int batteryInterBodyHigh = batteryBodyHigh - border_width * 2 - blank_width * 2; /** - * @brief 画头部 + * @brief 画头? */ for (int yoff = 0; yoff < batteryHeaderHigh; yoff++) { for (int xoff = 0; xoff < batteryBodyWidth; xoff++) { @@ -660,7 +660,7 @@ uint8_t ssd1306_basic_draw_battery_level(uint8_t xs, uint8_t ys, uint8_t *xchang ys += blank_width; /** - * @brief 画身体 + * @brief 画身? */ for (int yoff = 0; yoff < batteryInterBodyHigh; yoff++) { for (int xoff = 0; xoff < batteryBodyWidth; xoff++) { @@ -716,3 +716,47 @@ uint8_t ssd1306_basic_draw_battery_level(uint8_t xs, uint8_t ys, uint8_t *xchang *xchange = batteryBodyWidth; *ychange = batteryBodyHigh + batteryHeaderHigh; } + +uint8_t ssd1306_basic_draw_progress(uint8_t xs, uint8_t ys, uint16_t width, uint16_t high, uint16_t markpos, uint16_t progress) { + /** + * @brief + * + * [==================> ] + */ + + /** + * @brief һ + */ + for (uint16_t i = 0; i < width; i++) { + ssd1306_gram_write_point(&gs_handle, xs + i, ys, 1); + } + ys += 1; + + /** + * @brief + */ + uint16_t progress_width = width * progress / 100.0; + uint16_t markpos_off = width * markpos / 100.0; + for (uint16_t yoff = 0; yoff < high - 2; yoff++) { + for (uint16_t i = 0; i < width; i++) { + if (i < progress_width) { + ssd1306_gram_write_point(&gs_handle, xs + i, ys + yoff, 1); + } else if (i == width - 1) { + ssd1306_gram_write_point(&gs_handle, xs + i, ys + yoff, 1); + } else if (i >= markpos_off && i < markpos_off + 1) { + ssd1306_gram_write_point(&gs_handle, xs + i, ys + yoff, 1); + } else { + ssd1306_gram_write_point(&gs_handle, xs + i, ys + yoff, 0); + } + } + } + + ys += high - 2; + /** + * @brief β + */ + for (uint16_t i = 0; i < width; i++) { + ssd1306_gram_write_point(&gs_handle, xs + i, ys, 1); + } + return 0; +} diff --git a/app/src/basic/ssd1306/driver_ssd1306_basic.h b/app/src/basic/ssd1306/driver_ssd1306_basic.h index f113f6f..dd17d09 100644 --- a/app/src/basic/ssd1306/driver_ssd1306_basic.h +++ b/app/src/basic/ssd1306/driver_ssd1306_basic.h @@ -151,7 +151,7 @@ uint8_t ssd1306_basic_write_point(uint8_t x, uint8_t y, uint8_t data); * - 1 read point failed * @note none */ -uint8_t ssd1306_basic_read_point(uint8_t x, uint8_t y, uint8_t* data); +uint8_t ssd1306_basic_read_point(uint8_t x, uint8_t y, uint8_t *data); /** * @brief basic example draw a string @@ -166,7 +166,7 @@ uint8_t ssd1306_basic_read_point(uint8_t x, uint8_t y, uint8_t* data); * - 1 write string failed * @note none */ -uint8_t ssd1306_basic_string(uint8_t x, uint8_t y, char* str, uint16_t len, uint8_t color, ssd1306_font_t font); +uint8_t ssd1306_basic_string(uint8_t x, uint8_t y, char *str, uint16_t len, uint8_t color, ssd1306_font_t font); /** * @brief basic example fill a rectangle * @param[in] left is the left coordinate x @@ -193,20 +193,22 @@ uint8_t ssd1306_basic_rect(uint8_t left, uint8_t top, uint8_t right, uint8_t bot * - 1 draw picture failed * @note none */ -uint8_t ssd1306_basic_picture(uint8_t left, uint8_t top, uint8_t right, uint8_t bottom, uint8_t* img); +uint8_t ssd1306_basic_picture(uint8_t left, uint8_t top, uint8_t right, uint8_t bottom, uint8_t *img); /******************************************************************************* * ADD_BY_ZHAOHE * *******************************************************************************/ -uint8_t ssd1306_basic_draw_screen(const char* img); +uint8_t ssd1306_basic_draw_screen(const char *img); uint8_t ssd1306_basic_gram_update(); -ssd1306_handle_t* ssd1306_handler(); +ssd1306_handle_t *ssd1306_handler(); uint8_t ssd1306_basic_line(uint8_t x, uint8_t y, uint8_t data); uint8_t ssd1306_basic_draw_str(uint8_t xs, uint8_t ys, uint8_t *xchange, uint8_t *ychange, const char *str, FontLibrary_t *frontlib); -uint8_t ssd1306_basic_draw_battery_level(uint8_t xs, uint8_t ys, uint8_t *xchange, uint8_t *ychange,int level, int width, int high); +uint8_t ssd1306_basic_draw_battery_level(uint8_t xs, uint8_t ys, uint8_t *xchange, uint8_t *ychange, int level, int width, int high); + +uint8_t ssd1306_basic_draw_progress(uint8_t xs, uint8_t ys, uint16_t width, uint16_t high, uint16_t markpos, uint16_t progress); /** * @} diff --git a/app/src/basic/ssd1306/fontlib.c b/app/src/basic/ssd1306/fontlib.c index 39c9e56..799aacb 100644 --- a/app/src/basic/ssd1306/fontlib.c +++ b/app/src/basic/ssd1306/fontlib.c @@ -3,12 +3,13 @@ static FontLibrary_t s_fontlibrary[10]; static uint8_t s_fontlibrarylen = 0; -uint8_t utf8_iterator_start(StrIterator_t *iterator, const char *chr) { +uint8_t str_iterator_start(StrIterator_t *iterator, FontCode_t code, const char *chr) { iterator->str = chr; iterator->nowoff = 0; + iterator->code = code; } -uint8_t utf8_iterator_isend(StrIterator_t *iterator) { return iterator->str[iterator->nowoff] == '\0'; } -void utf8_iterator_next(StrIterator_t *iterator, const char **nowchr) { +uint8_t str_iterator_isend(StrIterator_t *iterator) { return iterator->str[iterator->nowoff] == '\0'; } +void str_iterator_next(StrIterator_t *iterator, const char **nowchr) { *nowchr = iterator->str + iterator->nowoff; if (*nowchr[0] == '\0') { *nowchr = NULL; @@ -19,7 +20,11 @@ void utf8_iterator_next(StrIterator_t *iterator, const char **nowchr) { iterator->nowoff++; break; } else { - iterator->nowoff += 3; + if (iterator->code == kgbk) { + iterator->nowoff += 2; + } else if (iterator->code == kutf8) { + iterator->nowoff += 3; + } break; } } @@ -74,4 +79,4 @@ void FontLibrary_findchar(FontLibrary_t *lib, const char *chr, const uint8_t **f } } -bool utf8_is_ascii(uint8_t *chr) { return chr[0] < 0x80; } \ No newline at end of file +bool str_is_ascii(uint8_t *chr) { return chr[0] < 0x80; } diff --git a/app/src/basic/ssd1306/fontlib.h b/app/src/basic/ssd1306/fontlib.h index ca633f9..824e763 100644 --- a/app/src/basic/ssd1306/fontlib.h +++ b/app/src/basic/ssd1306/fontlib.h @@ -27,13 +27,14 @@ typedef struct { typedef struct { const char *str; - int nowoff; + int nowoff; + FontCode_t code; } StrIterator_t; -uint8_t utf8_iterator_start(StrIterator_t *iterator, const char *chr); -uint8_t utf8_iterator_isend(StrIterator_t *iterator); -void utf8_iterator_next(StrIterator_t *iterator, const char **nowchr); -bool utf8_is_ascii(uint8_t *chr); +uint8_t str_iterator_start(StrIterator_t *iterator, FontCode_t code, const char *chr); +uint8_t str_iterator_isend(StrIterator_t *iterator); +void str_iterator_next(StrIterator_t *iterator, const char **nowchr); +bool str_is_ascii(uint8_t *chr); void FontLibrary_regsiter(FontLibrary_t *lib); FontLibrary_t *FontLibrary_findlib(FontCode_t fontcode, uint8_t widthPixel, uint8_t heightPixel, bool isAscii); diff --git a/app/src/one_conduction/display_manager.c b/app/src/one_conduction/display_manager.c index ebae393..1105246 100644 --- a/app/src/one_conduction/display_manager.c +++ b/app/src/one_conduction/display_manager.c @@ -18,7 +18,7 @@ void dsp_mgr_init(void) { // fronlib16.asciifrontIndex = "0123456789Ero."; // fronlib16.asciifrontIndexLen = strlen(fronlib16.asciifrontIndex); // fronlib16.gbkfront = gbk16code; - // fronlib16.gbkfrontIndex = "米开机中测距录像错误电量充"; + // fronlib16.gbkfrontIndex = "׿в¼"; // fronlib16.gbkfrontIndexLen = strlen(fronlib16.gbkfrontIndex); // fronlib16.eachfrontlen = 32; } @@ -43,8 +43,8 @@ PageState_t* dsp_mgr_get_state(void) {} void dsp_mgr_change_to_poweroff() { /** * @brief - * 1. 关闭屏幕,关闭屏幕电源 - * 2. 卸载屏幕外设 + * 1. رĻ,رĻԴ + * 2. жĻ */ SingleLeadECG_screen_deinit(); } @@ -53,10 +53,10 @@ void dsp_mgr_poweron() { SingleLeadECG_screen_init(); } void dsp_mgr_change_to_welcome() { /** - * @brief 切换到欢迎界面 - * 1. 加载屏幕外设 - * 2. 打开屏幕电源 - * 3. 初始化开机页面 + * @brief лӭ + * 1. Ļ + * 2. ĻԴ + * 3. ʼҳ */ // ssd1306_basic_string(0, 0, "123456789123456789123", 21, 0, SSD1306_FONT_12); @@ -75,14 +75,17 @@ const char* fmt(const char* format, ...) { return buf; } +int compute_x_pos_by_center(int16_t x, int16_t width) { return x - width / 2; } +int compute_y_pos_by_center(int16_t y, int16_t height) { return y - height / 2; } + void dsp_mgr_change_to_main() { int16_t batterylevel = 80; int16_t hour = 12; int16_t min = 32; ssd1306_basic_clear(); - uint8_t x = 20; - uint8_t y = 32 - fontclocklib.heightPixel / 2; // 12*4 +12 + uint8_t x = compute_x_pos_by_center(64, fontclocklib.widthPixel); + uint8_t y = compute_y_pos_by_center(32, fontclocklib.heightPixel * 5 + 1); uint8_t xchange, ychange; ssd1306_basic_draw_str(x, y, &xchange, &ychange, fmt("%02d:%02d", hour, min), &fontclocklib); @@ -109,11 +112,51 @@ void dsp_mgr_change_to_chargingPage() { dsp_mgr_change_to_page(kPage_main); } void dsp_mgr_change_to_preparePage() { + ssd1306_basic_clear(); + uint8_t x = 0; + uint8_t y = 0; + uint8_t xchange, ychange; + + // ssd1306_basic_draw_str(&x, &y, "123", &fontclocklib); + ssd1306_basic_draw_str(x, y, &xchange, &ychange, "ooox", &font8x8_xo_lib); + y = y + font8x8_xo_lib.heightPixel; + x = x + font8x8_xo_lib.widthPixel; + ssd1306_basic_draw_str(x, y, &xchange, &ychange, "־ֹ", &font24x24_zh_lib); + ssd1306_basic_gram_update(); + dsp_mgr_change_to_page(kPage_preparePage); +} +void dsp_mgr_change_to_sampling() { // + ssd1306_basic_draw_progress(5, 5, 100, 8, 50, 30); + ssd1306_basic_gram_update(); + +} +void dsp_mgr_change_to_samplingError() { + /** + * @brief + * 30[X] + */ + ssd1306_basic_clear(); + uint8_t x = 20; + uint8_t y = 32 - font24x24_zh_lib.heightPixel / 2; // 12*4 +12 + uint8_t xchange, ychange; + + // ssd1306_basic_draw_str(&x, &y, "123", &fontclocklib); + + ssd1306_basic_draw_str(x, y, &xchange, &ychange, "", &font24x24_zh_lib); + x = x + xchange; + ssd1306_basic_draw_str(x, y, &xchange, &ychange, "30", &font12x24_asiic_lib); + x = x + xchange; + ssd1306_basic_draw_str(x, y, &xchange, &ychange, "", &font24x24_zh_lib); + x = x + xchange; + + ssd1306_basic_gram_update(); + dsp_mgr_change_to_page(kPage_samplingError); +} +void dsp_mgr_change_to_storaging() { /** * @brief - * - * 1.进度条 - * 2.提示信息 + * 1. + * 2.ʾϢ */ ssd1306_basic_clear(); uint8_t x = 0; @@ -121,14 +164,25 @@ void dsp_mgr_change_to_preparePage() { uint8_t xchange, ychange; // ssd1306_basic_draw_str(&x, &y, "123", &fontclocklib); - ssd1306_basic_draw_str(x, y, &xchange, &ychange, "ooox", &font8x8_xo_lib); + ssd1306_basic_draw_str(x, y, &xchange, &ychange, "ooo", &font8x8_xo_lib); y = y + font8x8_xo_lib.heightPixel; x = x + font8x8_xo_lib.widthPixel; - ssd1306_basic_draw_str(x, y, &xchange, &ychange, "保持静止", &font24x24_baochijingzhi_lib); + ssd1306_basic_draw_str(x, y, &xchange, &ychange, "ڴ洢", &font24x24_zh_lib); ssd1306_basic_gram_update(); - dsp_mgr_change_to_page(kPage_preparePage); + dsp_mgr_change_to_page(kPage_storaging); +} +void dsp_mgr_change_to_storagingSuc() { + /** + * @brief + * 1. + * 2.ʾϢ + */ + ssd1306_basic_clear(); + uint8_t x = 0; + uint8_t y = 0; + uint8_t xchange, ychange; + + ssd1306_basic_draw_str(x, y, &xchange, &ychange, "洢ɹ", &font24x24_zh_lib); + ssd1306_basic_gram_update(); + dsp_mgr_change_to_page(kPage_storagingSuc); } -void dsp_mgr_change_to_sampling() {} -void dsp_mgr_change_to_samplingError() {} -void dsp_mgr_change_to_storaging() {} -void dsp_mgr_change_to_storagingSuc() {} diff --git a/app/src/one_conduction/display_manager.h b/app/src/one_conduction/display_manager.h index 10acfcc..5a9f9eb 100644 --- a/app/src/one_conduction/display_manager.h +++ b/app/src/one_conduction/display_manager.h @@ -15,7 +15,7 @@ /** * @brief - * 页面流转 + * ҳת * * close <--------------------- * | @@ -40,14 +40,14 @@ typedef enum { typedef struct { /** - * @brief 页面状态 + * @brief ҳ״̬ */ - page_t page; // 当前页面 - page_t last_page; // 上一个页面 - uint32_t page_change_to_page_time; // 当前页面持续的时间 + page_t page; // ǰҳ + page_t last_page; // һҳ + uint32_t page_change_to_page_time; // ǰҳʱ - bool in_prompt; // 是否在提示状态 - char prompt[32]; // 提示内容 + bool in_prompt; // Ƿʾ״̬ + char prompt[32]; // ʾ /** * @brief diff --git a/app/src/one_conduction/font.h b/app/src/one_conduction/font.h index ae0fe1e..aceffbe 100644 --- a/app/src/one_conduction/font.h +++ b/app/src/one_conduction/font.h @@ -1,8 +1,8 @@ // https://www.23bei.com/tool-965.html -#pragma ocne + #include #if 0 -const char fontclocklib_code[] = { +const uint8_t fontclocklib_code[] = { 0x00, 0x00, 0x00, 0x00, 0x7F, 0x80, 0x01, 0xFF, 0xE0, 0x03, 0xFF, 0xF0, 0x07, 0x80, 0x78, 0x06, // 0x00, 0x18, 0x04, 0x00, 0x08, 0x06, 0x00, 0x18, 0x07, 0x80, 0x78, 0x03, 0xFF, 0xF0, 0x01, 0xFF, // 0xE0, 0x00, 0x7F, 0x80, // @@ -42,7 +42,7 @@ static FontLibrary_t fontclocklib = { .font = fontclocklib_code, .fontIndex = "0123456789:", .fontIndexLen = 12, - .fontCode = kutf8, + .fontCode = kgbk, .isAscii = true, .widthPixel = 24, .heightPixel = 24, @@ -63,7 +63,7 @@ static FontLibrary_t fontclocklib = { #if 0 //32*32 -const char fontclocklib_code[] = { +const uint8_t fontclocklib_code[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0xC0, 0x40, 0x40, 0xC0, 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xFE, 0xFF, 0x0F, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x07, 0xFF, 0xFE, 0xF0, 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x07, 0x06, 0x04, 0x04, 0x06, 0x07, 0x03, 0x01, 0x00, 0x00, /*"0",0*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -91,7 +91,7 @@ static FontLibrary_t fontclocklib = { .font = fontclocklib_code, .fontIndex = "0123456789:", .fontIndexLen = 12, - .fontCode = kutf8, + .fontCode = kgbk, .isAscii = true, .widthPixel = 16, .heightPixel = 32, @@ -99,7 +99,7 @@ static FontLibrary_t fontclocklib = { #endif // 24*24 -const char fontclocklib_code[] = { +const uint8_t fontclocklib_code[] = { 0x00, 0x00, 0x80, 0xC0, 0xE0, 0x60, 0x20, 0x60, 0xE0, 0xC0, 0x80, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0xFE, 0x00, 0x01, 0x07, 0x0F, 0x1E, 0x18, 0x10, 0x18, 0x1E, 0x0F, 0x07, 0x01, /*"0",0*/ 0x00, 0x00, 0x80, 0x80, 0x80, 0xC0, 0xE0, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x1F, 0x1F, 0x1F, 0x10, 0x10, 0x10, 0x00, /*"1",1*/ @@ -118,15 +118,15 @@ static FontLibrary_t fontclocklib = { .font = fontclocklib_code, .fontIndex = "0123456789:", .fontIndexLen = 12, - .fontCode = kutf8, + .fontCode = kgbk, .isAscii = true, .widthPixel = 12, .heightPixel = 24, }; -const char font8x8_xo_code[] = { - 0x00, 0x3C, 0x7E, 0x7E, 0x7E, 0x7E, 0x3C, 0x00, /*实心圆,代表完成*/ - 0x00, 0x3C, 0x42, 0x42, 0x42, 0x42, 0x3C, 0x00, /*空心圆,代表未完成*/ +const uint8_t font8x8_xo_code[] = { + 0x00, 0x3C, 0x7E, 0x7E, 0x7E, 0x7E, 0x3C, 0x00, /*ʵԲ,*/ + 0x00, 0x3C, 0x42, 0x42, 0x42, 0x42, 0x3C, 0x00, /*Բ,δ*/ }; @@ -134,30 +134,80 @@ static FontLibrary_t font8x8_xo_lib = { .font = font8x8_xo_code, .fontIndex = "ox", .fontIndexLen = 2, - .fontCode = kutf8, + .fontCode = kgbk, .isAscii = true, .widthPixel = 8, .heightPixel = 8, }; -const char font24x24_baochijingzhi_code[] = { - // 保(0) 持(1) 静(2) 止(3) 楷体 +const uint8_t font12x24_asiic_code[] = { + + 0x00, 0x00, 0xC0, 0xE0, 0x70, 0x30, 0x30, 0x60, 0xE0, 0xC0, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFE, 0x00, 0x00, 0x01, 0x07, 0x0E, 0x0C, 0x18, 0x18, 0x0C, 0x0F, 0x07, 0x00, 0x00, /*"0",0*/ + 0x00, 0x00, 0x00, 0x80, 0xC0, 0xE0, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x01, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, /*"1",1*/ + 0x00, 0x80, 0xE0, 0x60, 0x30, 0x30, 0x30, 0x70, 0xE0, 0xC0, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x80, 0xC0, 0xE0, 0x38, 0x1F, 0x07, 0x00, 0x00, 0x00, 0x08, 0x0E, 0x0F, 0x0B, 0x09, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, /*"2",2*/ + 0x00, 0x80, 0xC0, 0x60, 0x30, 0x30, 0x30, 0x30, 0xE0, 0xC0, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x18, 0x18, 0x38, 0x7F, 0xE7, 0x80, 0x00, 0x00, 0x03, 0x07, 0x0C, 0x18, 0x18, 0x18, 0x0C, 0x0E, 0x07, 0x01, 0x00, /*"3",3*/ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0x00, 0x00, 0x00, 0x80, 0xC0, 0xF0, 0xB8, 0x8E, 0x87, 0x81, 0xFF, 0xFF, 0x80, 0x80, 0x80, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x0F, 0x0F, 0x01, 0x01, 0x01, /*"4",4*/ + 0x00, 0x00, 0xE0, 0xE0, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x1C, 0x1F, 0x0D, 0x04, 0x04, 0x0C, 0x0C, 0x3C, 0xF8, 0xC0, 0x00, 0x01, 0x07, 0x0E, 0x08, 0x18, 0x18, 0x18, 0x0C, 0x0F, 0x07, 0x00, 0x00, /*"5",5*/ + 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xF0, 0x30, 0x10, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xF8, 0x1E, 0x0F, 0x0D, 0x0C, 0x0C, 0x18, 0xF8, 0xF0, 0x00, 0x00, 0x03, 0x07, 0x0C, 0x18, 0x18, 0x18, 0x18, 0x0C, 0x0F, 0x03, 0x00, /*"6",6*/ + 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0xA0, 0xE0, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xF8, 0x1E, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x0F, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*"7",7*/ + 0x00, 0x80, 0xE0, 0x60, 0x30, 0x30, 0x30, 0x20, 0xE0, 0xC0, 0x00, 0x00, 0x00, 0xE3, 0xFF, 0x3C, 0x18, 0x18, 0x18, 0x3C, 0x3F, 0xE7, 0xC0, 0x00, 0x00, 0x07, 0x0F, 0x0C, 0x18, 0x18, 0x18, 0x18, 0x0C, 0x07, 0x03, 0x00, /*"8",8*/ + 0x00, 0xC0, 0xE0, 0x60, 0x30, 0x30, 0x30, 0x60, 0xE0, 0xC0, 0x00, 0x00, 0x02, 0x1F, 0x3D, 0x30, 0x60, 0x60, 0xE0, 0xF0, 0x7F, 0x1F, 0x03, 0x00, 0x00, 0x00, 0x00, 0x10, 0x1C, 0x0F, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, /*"9",9*/ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x0C, 0x1C, 0xF0, 0xE0, 0xE0, 0x38, 0x1C, 0x04, 0x00, 0x00, 0x00, 0x10, 0x1C, 0x0E, 0x03, 0x01, 0x03, 0x07, 0x0E, 0x18, 0x10, 0x00, /*"x",10*/ + 0x00, 0x30, 0xF0, 0xE0, 0x00, 0x00, 0x00, 0x80, 0xE0, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x83, 0xEF, 0x7C, 0x7E, 0xE7, 0x81, 0x00, 0x00, 0x00, 0x10, 0x1C, 0x1F, 0x07, 0x01, 0x00, 0x00, 0x01, 0x0F, 0x1E, 0x18, 0x00, /*"X",11*/ + 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, /*"[",12*/ + 0x00, 0x0C, 0x0C, 0x0C, 0x0C, 0xFC, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x60, 0x60, 0x60, 0x7F, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, + /*"]",13*/}; + +static FontLibrary_t font12x24_asiic_lib = { + .font = font12x24_asiic_code, + .fontIndex = "0123456789xX[]", + .fontIndexLen = 15, + .fontCode = kgbk, + .isAscii = true, + .widthPixel = 12, + .heightPixel = 24, +}; + +const uint8_t font24x24_zh_code[] = { // 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xF8, 0x38, 0x10, 0x10, 0xF0, 0x90, 0x10, 0x10, 0x10, 0x88, 0xF8, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x0C, 0x06, 0xE7, 0x1C, 0x10, 0x10, 0x10, 0x10, 0x93, - 0x71, 0xFF, 0x39, 0x49, 0x89, 0x08, 0x08, 0x0C, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x04, 0x02, 0x01, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x03, 0x07, 0x06, 0x06, 0x04, 0x04, 0x00, /*"保",0*/ + 0x71, 0xFF, 0x39, 0x49, 0x89, 0x08, 0x08, 0x0C, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x04, 0x02, 0x01, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x03, 0x07, 0x06, 0x06, 0x04, 0x04, 0x00, /*"",0*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xFC, 0xFC, 0xC0, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0xC2, 0x63, 0x33, 0xFF, 0x0D, 0x09, 0x08, 0x48, - 0x48, 0x49, 0x48, 0x47, 0x4F, 0xFC, 0x24, 0x24, 0x26, 0x06, 0x04, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x08, 0x38, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x02, 0x20, 0x60, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*"持",1*/ + 0x48, 0x49, 0x48, 0x47, 0x4F, 0xFC, 0x24, 0x24, 0x26, 0x06, 0x04, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x08, 0x38, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x02, 0x20, 0x60, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*"",1*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0xFC, 0x20, 0xA0, 0x20, 0x00, 0x80, 0x60, 0x3C, 0x2C, 0xA0, 0x70, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x0C, 0x94, 0x75, 0x55, 0x57, 0x15, 0xF4, 0x02, 0x90, - 0x92, 0x92, 0x92, 0xFF, 0x92, 0x8A, 0x49, 0x3F, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x18, 0x0F, 0x02, 0x01, 0x09, 0x18, 0x0F, 0x00, 0x00, 0x00, 0x20, 0x60, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*"静",2*/ + 0x92, 0x92, 0x92, 0xFF, 0x92, 0x8A, 0x49, 0x3F, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x18, 0x0F, 0x02, 0x01, 0x09, 0x18, 0x0F, 0x00, 0x00, 0x00, 0x20, 0x60, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*"",2*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xF8, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xF8, 0x00, 0x00, 0x00, - 0xFF, 0x0F, 0x08, 0x08, 0x08, 0x0C, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x18, 0x08, 0x08, 0x08, 0x0F, 0x08, 0x08, 0x0C, 0x0F, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, /*"止",3*/ -}; - -static FontLibrary_t font24x24_baochijingzhi_lib = { - .font = font24x24_baochijingzhi_code, - .fontIndex = "保持静止", - .fontIndexLen = 12, - .fontCode = kutf8, - .isAscii = false, - .widthPixel = 24, - .heightPixel = 24, -}; + 0xFF, 0x0F, 0x08, 0x08, 0x08, 0x0C, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x18, 0x08, 0x08, 0x08, 0x0F, 0x08, 0x08, 0x0C, 0x0F, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, /*"ֹ",3*/ + 0x00, 0x00, 0x00, 0x00, 0x40, 0x60, 0x60, 0x60, 0x20, 0x20, 0x20, 0x20, 0xA0, 0xE0, 0x30, 0x30, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0x60, 0x30, 0x0D, 0xFF, + 0x03, 0x00, 0x00, 0x10, 0x20, 0x60, 0xE0, 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, /*"",4*/ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xE0, 0x20, 0x20, 0x10, 0x10, 0x10, 0xF8, 0xF8, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x70, 0x61, 0x87, 0x82, 0x06, 0xFE, + 0x12, 0x11, 0x11, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x04, 0x03, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x03, 0x02, 0x06, 0x0C, 0x0C, 0x18, 0x18, 0x18, 0x18, 0x18, 0x10, 0x00, 0x00, /*"",5*/ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0xE0, 0x30, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0xC4, 0x64, 0x1A, 0xFF, 0x12, 0x32, 0x00, 0x18, + 0x0F, 0x00, 0x00, 0x1F, 0x80, 0xE0, 0x3C, 0x08, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x40, 0x20, 0x30, 0x18, 0x0C, 0x06, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*"",6*/ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x20, 0x20, 0x38, 0xF8, 0x20, 0x20, 0x20, 0x60, 0x9C, 0x24, 0x10, 0x10, 0x10, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x67, 0x7E, 0x00, + 0x10, 0x8C, 0x9B, 0xB9, 0xE4, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x20, 0x20, 0x23, 0x3F, 0x11, 0x13, 0x1D, 0x11, 0x1D, 0x17, 0x10, 0x18, 0x1F, 0x11, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, /*"",7*/ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x10, 0x10, 0x10, 0x10, 0x10, 0xF0, 0x18, 0x18, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x0F, 0x04, 0x84, 0x64, 0x34, 0x1E, + 0x06, 0xFF, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x02, 0x01, 0x00, 0x00, 0x10, 0x20, 0x70, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*"",8*/ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x10, 0xF0, 0x70, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x0E, 0x08, 0x08, 0x08, 0x04, 0x04, 0x07, + 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x06, 0x08, 0x08, 0x18, 0x18, 0x18, 0x10, 0x18, 0x18, 0x18, 0x18, 0x08, 0x08, 0x0C, 0x0E, 0x07, 0x00, 0x00, 0x00, /*"",9*/ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0xC0, 0x00, 0x00, 0x40, 0x40, 0xC0, 0xE0, 0x5C, 0x2C, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x08, 0xF8, 0x08, 0x00, 0x40, 0x48, 0x4E, 0x4B, + 0x44, 0x45, 0xFF, 0x24, 0x24, 0x24, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x08, 0x0C, 0x04, 0x07, 0x04, 0x04, 0x08, 0x08, 0x08, 0x08, 0x10, 0x10, 0x17, 0x30, 0x30, 0x30, 0x30, 0x30, 0x10, 0x10, 0x00, 0x00, /*"",10*/ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x88, 0x98, 0xD0, 0xC0, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x82, 0xC2, 0x62, 0xFF, 0x11, 0x91, 0x80, 0x80, 0x90, + 0x92, 0xF4, 0xB0, 0x98, 0x97, 0x89, 0x48, 0x48, 0x48, 0x40, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x18, 0x3F, 0x0F, 0x00, 0x00, 0x20, 0x20, 0x13, 0x12, 0x0C, 0x06, 0x0F, 0x08, 0x18, 0x30, 0x20, 0x00, 0x00, 0x00, /*"",11*/ + 0x00, 0x00, 0x00, 0xE0, 0x40, 0x40, 0x80, 0x00, 0xF8, 0x88, 0x40, 0x20, 0x00, 0x80, 0x80, 0x40, 0x40, 0x20, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x80, 0x40, 0x25, 0x1A, 0xFF, 0x12, 0x12, 0x12, + 0x00, 0xE0, 0x3F, 0x08, 0x04, 0xFC, 0xFC, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x04, 0x02, 0x02, 0x02, 0x03, 0x02, 0x12, 0x08, 0x06, 0x01, 0x00, 0x00, 0x00, 0x7F, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, /*"",12*/ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x60, 0x60, 0xE0, 0x20, 0x20, 0x20, 0x20, 0xF0, 0x30, 0x30, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0xE8, 0x3F, 0x08, 0x08, + 0x04, 0x04, 0xFF, 0x04, 0x04, 0x04, 0x04, 0x04, 0x06, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x08, 0x04, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*"",13*/ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9C, 0xF8, 0x80, 0x80, 0x80, 0x80, 0xC0, 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x7F, 0x81, 0x89, 0x49, 0xC8, 0xFF, 0x4C, + 0x44, 0x44, 0x40, 0x3C, 0x0F, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0F, 0x18, 0x10, 0x10, 0x30, 0x30, 0x30, 0x10, 0x10, 0x1A, 0x1C, 0x00, 0x00, 0x00, /*"",14*/ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x78, 0xA8, 0xA8, 0xA8, 0xA8, 0x88, 0xE4, 0x7C, 0x18, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x04, 0x04, 0x14, 0xF4, 0x94, 0x14, 0x52, 0xF2, + 0xAA, 0xAA, 0x8A, 0xFA, 0x3A, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x20, 0x24, 0x25, 0x25, 0x25, 0x3F, 0x24, 0x24, 0x27, 0x30, 0x30, 0x30, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, + /*"",15*/}; +static FontLibrary_t font24x24_zh_lib = { + .font = font24x24_zh_code, + .fontIndex = "־ֹӶϿ", + .fontIndexLen = 21, + .fontCode = kgbk, + .isAscii = false, + .widthPixel = 24, + .heightPixel = 24, +}; \ No newline at end of file diff --git a/app/src/one_conduction/one_conduction_board.c b/app/src/one_conduction/one_conduction_board.c index 4d0dd6c..7c41ee9 100644 --- a/app/src/one_conduction/one_conduction_board.c +++ b/app/src/one_conduction/one_conduction_board.c @@ -32,14 +32,14 @@ #define ECG_NLOD_PIN 3 #define ECG_PLOD_PIN 28 #define ECG_ADC_PIN NRF_SAADC_INPUT_AIN0 -#define ECG_ADC_CHANNEL 0 // 不重复即可 +#define ECG_ADC_CHANNEL 0 // ظ #define BATTERY_ADC_PIN NRF_SAADC_INPUT_AIN3 -#define BATTERY_ADC_CHANNEL 1 // 不重复即可 +#define BATTERY_ADC_CHANNEL 1 // ظ -#define EEPROM_I2C_SCL_M 15 // I2C SCL引脚 -#define EEPROM_I2C_SDA_M 17 // I2C SDA引脚 -#define EEPROM_I2C_INSTANCE 1 // I2C使用的硬件控制器ID +#define EEPROM_I2C_SCL_M 15 // I2C SCL +#define EEPROM_I2C_SDA_M 17 // I2C SDA +#define EEPROM_I2C_INSTANCE 1 // I2CʹõӲID #define BEEP_PWM_INSTANCE 0 #define BEEP_PIN 1 @@ -53,12 +53,12 @@ *******************************************************************************/ void SingleLeadECG_adc_module_init() { nrf_drv_saadc_config_t adccfg = NRFX_SAADC_DEFAULT_CONFIG; - adccfg.resolution = NRF_SAADC_RESOLUTION_12BIT; // 4096 等于满采样率 + adccfg.resolution = NRF_SAADC_RESOLUTION_12BIT; // 4096 ZERROR_CHECK(nrf_drv_saadc_init(&adccfg, NULL)); } /******************************************************************************* - * 蜂鸣器 * + * * *******************************************************************************/ static nrf_drv_pwm_t m_beep_pwm0 = NRF_DRV_PWM_INSTANCE(BEEP_PWM_INSTANCE); static nrf_pwm_values_individual_t m_beep_pwm0_seq_values = {0}; @@ -80,7 +80,7 @@ static nrf_drv_pwm_config_t const m_beep_pwm0_config0 = { void SingleLeadECG_beep_init() { APP_ERROR_CHECK(nrfx_pwm_init(&m_beep_pwm0, &m_beep_pwm0_config0, NULL)); } void SingleLeadECG_beep_set_state(bool state) { if (state) { - m_beep_pwm0_seq_values.channel_0 = 23; // 设置占空比,数值最大不超过 top_value + m_beep_pwm0_seq_values.channel_0 = 23; // ռձȣֵ󲻳 top_value nrfx_pwm_simple_playback(&m_beep_pwm0, &m_beep_pwm0_seq, 1, NRF_DRV_PWM_FLAG_LOOP); } else { nrfx_pwm_stop(&m_beep_pwm0, true); @@ -98,9 +98,9 @@ void SingleLeadECG_screen_init() { znrf_gpio_cfg_output(SCREEN_A0PIN, NRF_GPIO_PIN_NOPULL); nrf_gpio_pin_set(SCREEN_POWER_PIN); - // 参考 - // OLED驱动程序 : https://iflytop1.feishu.cn/wiki/OQ4Iwv0DpiQDJvkjftjcQHJBnCg - // nRF5_SDK-使用手册: https://iflytop1.feishu.cn/wiki/ThaAwZEGVi2bspkfGU9cbl9Enqd + // ο + // OLED : https://iflytop1.feishu.cn/wiki/OQ4Iwv0DpiQDJvkjftjcQHJBnCg + // nRF5_SDK-ʹֲ: https://iflytop1.feishu.cn/wiki/ThaAwZEGVi2bspkfGU9cbl9Enqd nrf_drv_spi_config_t spi_config = NRF_DRV_SPI_DEFAULT_CONFIG; spi_config.ss_pin = SCREEN_CS_PIN; // NRF_DRV_SPI_PIN_NOT_USED spi_config.miso_pin = NRF_DRV_SPI_PIN_NOT_USED; @@ -233,7 +233,7 @@ static void assign_i2c_add(uint32_t add, bool wr, uint8_t *i2cadd, uint8_t *mema // bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 // 1 0 1 0 E2 A17 A16 RW(W=0) // - // PS: E2 参考原理图中的电平为0,所以bit3为0 + // PS: E2 οԭͼеĵƽΪ0bit3Ϊ0 // // MEM0 // bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 diff --git a/app/src/one_conduction/one_conduction_board.h b/app/src/one_conduction/one_conduction_board.h index 72e1749..bda3b8b 100644 --- a/app/src/one_conduction/one_conduction_board.h +++ b/app/src/one_conduction/one_conduction_board.h @@ -16,7 +16,7 @@ void SingleLeadECG_adc_module_init(); /******************************************************************************* - * 蜂鸣器 * + * * *******************************************************************************/ void SingleLeadECG_beep_init(); void SingleLeadECG_beep_set_state(bool state); diff --git a/app/src/one_conduction/one_conduction_main.c b/app/src/one_conduction/one_conduction_main.c index 451d2ec..22ca17b 100644 --- a/app/src/one_conduction/one_conduction_main.c +++ b/app/src/one_conduction/one_conduction_main.c @@ -3,7 +3,7 @@ #include "one_conduction_board.h" #include "znordic.h" -ZDATACHANNEL_DEF(m_zhrs, 2 /*回调事件优先级*/, 1 /*client num*/); +ZDATACHANNEL_DEF(m_zhrs, 2 /*ص¼??*/, 1 /*client num*/); /******************************************************************************* * TOOLS * @@ -19,7 +19,7 @@ static const char* hex2str(const uint8_t* data, int32_t len) { void zdatachannel_data_handler(zdatachannel_evt_t* p_evt) { /** - * @brief 接收到指令数据 + * @brief յָ?? */ if (p_evt->type == ZDATACHANNEL_EVT_RX_DATA) { ZLOGI("rx:%s", hex2str(p_evt->params.rx_data.p_data, p_evt->params.rx_data.length)); @@ -30,7 +30,7 @@ void zdatachannel_data_handler(zdatachannel_evt_t* p_evt) { *******************************************************************************/ void on_service_init(void) { /** - * @brief 数据通道初始化 + * @brief ͨʼ?? */ ZLOGI("init zdatachannel service"); zdatachannel_init_t zdatachannle_init; @@ -57,7 +57,7 @@ void one_conduction_main() { dsp_mgr_init(); dsp_mgr_poweron(); - dsp_mgr_change_to_preparePage(); + dsp_mgr_change_to_sampling(); znordic_loop(); }