Browse Source

update

master
zhaohe 1 year ago
parent
commit
a0a1363892
  1. 6
      README.md
  2. 2
      app/config/sdk_config.h
  3. 48
      app/src/app_service/ecg_service/ecg_service.c

6
README.md

@ -27,10 +27,12 @@
屏幕:10ma
开机后,初始化外设后,如果关闭外设电源,功耗不降,反升
20240509功耗测量:
采集时候:9ma
停止采集:3ma
待机:190ua
外设的供电如果关闭之后,需要先将部分引脚的电平拉低,然后再将引脚设置成default状态.
...

2
app/config/sdk_config.h

@ -1,6 +1,6 @@
#pragma once
#define NRF_LOG_ENABLED 1
#define NRF_LOG_ENABLED 0
#define NRF_LOG_BACKEND_UART_ENABLED 1
#define NRF_LOG_BACKEND_UART_TX_PIN 41
// #define NRF_LOG_BACKEND_UART_TX_PIN 6

48
app/src/app_service/ecg_service/ecg_service.c

@ -247,7 +247,7 @@ static void ads1291_ready_pin_irq(nrfx_gpiote_pin_t pin, nrf_gpiote_polarity_t a
//
one_frame_t frame;
if (m_report_data_in_raw_mode_flag) {
frame.data = ecg_algo_get_data_after_high_pass_filter_data();
frame.data = capture_data.ch1data;
} else {
frame.data = ecg_algo_get_report_data();
}
@ -320,19 +320,6 @@ void ecg_service_load() {
}
ZASSERT(ads129x_ping());
static ads129x_regs_t regcache;
ads129x_readback_regs(&regcache);
ads129x_dump_regs(&regcache);
regcache.cfg1 = 0x02;
regcache.cfg2 = 0xE0;
regcache.loff = 0xF1;
regcache.ch1set = 0x00;
regcache.ch2set = 0x81;
regcache.rld_sens = 0x00;
regcache.loff_sens = 0x03;
ads129x_write_regs(&regcache);
}
void ecg_service_unload() {
/**
@ -367,17 +354,31 @@ void ecg_service_start_capture() { //
ecg_data_mgr_clear_buffer();
if (m_testmode_flag) {
static ads129x_regs_t regcache;
ads129x_readback_regs(&regcache);
ads129x_dump_regs(&regcache);
static ads129x_regs_t regcache;
ads129x_readback_regs(&regcache);
ads129x_dump_regs(&regcache);
// 0x52,0x02,0xe0,0xF1,0x00,0x81,0x20,0x03,0x00,0x02,0x07,0x0c
regcache.id = 0x52; // 00
regcache.cfg1 = 0x02; // 01
regcache.cfg2 = 0xE0; // 02
regcache.loff = 0xF1; // 03
regcache.ch1set = 0x00; // 04
regcache.ch2set = 0x81; // 05
regcache.rld_sens = 0x20; // 06
regcache.loff_sens = 0x03; // 07
regcache.loff_stat = 0x00; // 08
regcache.resp1 = 0x02; // 09
regcache.resp2 = 0x07; // 10
regcache.gpio = 0x0c; // 11
if (m_testmode_flag) {
regcache.cfg2 = ADS129X_SET_BITS(regcache.cfg2, ADS129X_INT_TEST, ADS129X_INT_TEST_ON);
regcache.cfg2 = ADS129X_SET_BITS(regcache.cfg2, ADS129X_INT_FREQ, ADS129X_INT_FREQ_AC);
regcache.ch1set = ADS129X_SET_BITS(regcache.ch1set, ADS129X_MUXx, ADS129X_CHx_INPUT_TEST);
ads129x_write_regs(&regcache);
}
ads129x_write_regs(&regcache);
ads129x_send_cmd(ADS129X_COMMAND_START); /* 发送开始数据转换(等效于拉高START引脚) */
ecg_service_captured_time = znordic_getpower_on_ms();
@ -410,4 +411,9 @@ void ecg_service_set_in_test_mode(bool testmode) {
void ecg_service_set_report_data_in_raw_mode(bool rawmode) { m_report_data_in_raw_mode_flag = rawmode; }
bool ecg_leadoff_detect() { return m_leadoffstate; }
bool ecg_leadoff_detect() {
if (m_testmode_flag) {
return false;
}
return m_leadoffstate;
}
Loading…
Cancel
Save