|
|
@ -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(®cache); |
|
|
|
ads129x_dump_regs(®cache); |
|
|
|
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(®cache); |
|
|
|
} |
|
|
|
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(®cache); |
|
|
|
ads129x_dump_regs(®cache); |
|
|
|
static ads129x_regs_t regcache; |
|
|
|
ads129x_readback_regs(®cache); |
|
|
|
ads129x_dump_regs(®cache); |
|
|
|
// 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(®cache); |
|
|
|
} |
|
|
|
ads129x_write_regs(®cache); |
|
|
|
|
|
|
|
|
|
|
|
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; |
|
|
|
} |