Browse Source

update

3lead_uart_test_ok_version
zhaohe 1 year ago
parent
commit
2c76f2653b
  1. 3
      .vscode/settings.json
  2. 76
      app/src/basic/ssd1306/driver_ssd1306_basic.c
  3. 14
      app/src/basic/ssd1306/driver_ssd1306_basic.h
  4. 15
      app/src/basic/ssd1306/fontlib.c
  5. 11
      app/src/basic/ssd1306/fontlib.h
  6. 92
      app/src/one_conduction/display_manager.c
  7. 14
      app/src/one_conduction/display_manager.h
  8. 106
      app/src/one_conduction/font.h
  9. 24
      app/src/one_conduction/one_conduction_board.c
  10. 2
      app/src/one_conduction/one_conduction_board.h
  11. 8
      app/src/one_conduction/one_conduction_main.c

3
.vscode/settings.json

@ -82,5 +82,6 @@
"fontlib.h": "c",
"font.h": "c",
"display_manager.h": "c"
}
},
"files.encoding": "gbk"
}

76
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;
}

14
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);
/**
* @}

15
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; }
bool str_is_ascii(uint8_t *chr) { return chr[0] < 0x80; }

11
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);

92
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() {}

14
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

106
app/src/one_conduction/font.h

@ -1,8 +1,8 @@
// https://www.23bei.com/tool-965.html
#pragma ocne
#include <stdint.h>
#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,
};

24
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 0it3涓0
// PS: E2 0bit3为0
//
// MEM0
// bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8

2
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);

8
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();
}
Loading…
Cancel
Save