Browse Source

update

only_u2
zhaohe 1 year ago
parent
commit
521ed921cf
  1. 45
      app/src/ads1293_simple_tester.c
  2. 7376
      bin2/app.hex
  3. 16
      bin2/bl_temp.hex
  4. 16
      bin2/settings.hex
  5. 7392
      bin2/whole.hex
  6. 16437
      stable/onlyu2_stable_v1.hex

45
app/src/ads1293_simple_tester.c

@ -19,7 +19,7 @@
ZDATACHANNEL_DEF(m_zhrs, 2 /*ÓÅÏȼ¶*/, 1 /*client num*/);
static const nrf_drv_spi_t spi = NRF_DRV_SPI_INSTANCE(ADS1293_SPI_INSTANCE); /**< SPI instance. */
static ads1293_t m_ads1293_0; // U2
static ads1293_t m_ads1293_1;
// static ads1293_t m_ads1293_1;
typedef struct {
uint8_t add;
uint8_t data;
@ -103,19 +103,19 @@ uint32_t get_ready_pin_state_get() { return nrf_gpio_pin_read(ADS1293_READY_PIN)
static adscfg_t m_prvads0cfg[] = //
{
{0x00, 0x00}, {0x01, 0x19}, {0x02, 0x11}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x0f}, {0x08, 0xff}, {0x09, 0x00}, {0x0a, 0x07}, {0x0b, 0x07}, {0x0c, 0x74}, {0x0d, 0x01}, {0x0e, 0x02}, {0x0f, 0x03}, {0x10, 0x04},
{0x11, 0x00}, {0x12, 0x05}, {0x13, 0x39}, {0x14, 0x36}, {0x15, 0x06}, {0x16, 0x00}, {0x17, 0x05}, {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, {0x1c, 0x00}, {0x1d, 0x00}, {0x21, 0x01}, {0x22, 0x20}, {0x23, 0x20}, {0x24, 0x02},
{0x25, 0x00}, {0x26, 0x00}, {0x27, 0x08}, {0x28, 0x08}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x33}, {0x2f, 0x30}, {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00},
{0x00, 0x00}, {0x01, 0x19}, {0x02, 0x2e}, {0x03, 0x16}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x08}, {0x07, 0x00}, {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x17}, {0x0b, 0x07}, {0x0c, 0x74}, {0x0d, 0x01}, {0x0e, 0x00}, {0x0f, 0x03}, {0x10, 0x05},
{0x11, 0x00}, {0x12, 0x05}, {0x13, 0x3f}, {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x05}, {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, {0x1c, 0x00}, {0x1d, 0x00}, {0x21, 0x01}, {0x22, 0x20}, {0x23, 0x20}, {0x24, 0x20},
{0x25, 0x00}, {0x26, 0x00}, {0x27, 0x08}, {0x28, 0x08}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x33}, {0x2f, 0x70}, {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00},
{0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, {0x40, 0xff}, {0x50, 0x00}, {0x60, 0x00}, {0x62, 0x00},
};
static adscfg_t m_prvads1cfg[] = //
{
{0x00, 0x00}, {0x01, 0x0c}, {0x02, 0x14}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x0f}, {0x08, 0xff}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x07}, {0x0c, 0x78}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, {0x10, 0x04},
{0x11, 0x00}, {0x12, 0x07}, {0x13, 0x3b}, {0x14, 0x24}, {0x15, 0x04}, {0x16, 0x00}, {0x17, 0x05}, {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, {0x1c, 0x00}, {0x1d, 0x00}, {0x21, 0x01}, {0x22, 0x20}, {0x23, 0x20}, {0x24, 0x02},
{0x25, 0x00}, {0x26, 0x00}, {0x27, 0x08}, {0x28, 0x40}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x33}, {0x2f, 0x30}, {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00},
{0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, {0x40, 0xff}, {0x50, 0x00}, {0x60, 0x00}, {0x62, 0x00},
};
// static adscfg_t m_prvads1cfg[] = //
// {
// {0x00, 0x00}, {0x01, 0x0c}, {0x02, 0x14}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x0f}, {0x08, 0xff}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x07}, {0x0c, 0x78}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, {0x10, 0x04},
// {0x11, 0x00}, {0x12, 0x07}, {0x13, 0x3b}, {0x14, 0x24}, {0x15, 0x04}, {0x16, 0x00}, {0x17, 0x05}, {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, {0x1c, 0x00}, {0x1d, 0x00}, {0x21, 0x01}, {0x22, 0x20}, {0x23, 0x20}, {0x24, 0x02},
// {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x08}, {0x28, 0x40}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x33}, {0x2f, 0x30}, {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00},
// {0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, {0x40, 0xff}, {0x50, 0x00}, {0x60, 0x00}, {0x62, 0x00},
// };
static void ads1293_init() {
/*******************************************************************************
@ -138,16 +138,16 @@ static void ads1293_init() {
m_ads1293_0.spi_tx_rx = ads1293_spi_tx_rx_0;
m_ads1293_0.id = 0;
m_ads1293_1.spi_tx_rx = ads1293_spi_tx_rx_1;
m_ads1293_1.id = 1;
// m_ads1293_1.spi_tx_rx = ads1293_spi_tx_rx_1;
// m_ads1293_1.id = 1;
ads1293_spi_init(&m_ads1293_0, ads1293_spi_tx_rx_0);
ads1293_spi_init(&m_ads1293_1, ads1293_spi_tx_rx_1);
// ads1293_spi_init(&m_ads1293_1, ads1293_spi_tx_rx_1);
uint8_t revid = ads1293_spi_readreg(&m_ads1293_0, TI_ADS1293_REVID_REG);
ZLOGI("ads1293_0 revid: %d\n", revid);
revid = ads1293_spi_readreg(&m_ads1293_1, TI_ADS1293_REVID_REG);
ZLOGI("ads1293_1 revid: %d\n", revid);
// revid = ads1293_spi_readreg(&m_ads1293_1, TI_ADS1293_REVID_REG);
// ZLOGI("ads1293_1 revid: %d\n", revid);
ads1293_spi_writereg(&m_ads1293_0, TI_ADS1293_CONFIG_REG, 0);
@ -170,7 +170,7 @@ static void ads1293_init() {
ads1293_spi_writereg_and_check(&m_ads1293_0, m_prvads0cfg[i].add, m_prvads0cfg[i].data);
}
}
#if 0
tryloadcfg_from_fatfs("1.cfg", m_prvads1cfg_cache, ZARRAY_SIZE(m_prvads1cfg_cache), &cfgsize);
if (cfgsize > 0) {
ZLOGI("load 1.cfg from fatfs\n");
@ -189,6 +189,7 @@ static void ads1293_init() {
ads1293_spi_writereg_and_check(&m_ads1293_1, m_prvads1cfg[i].add, m_prvads1cfg[i].data);
}
}
#endif
}
static void onServiceInitCB() {
@ -233,7 +234,7 @@ void send_ads1293_error_state(ads1293_error_t* e0, ads1293_error_t* e1) { //
void capture_error_state() {
ads1293_read_error(&m_ads1293_0, &error0);
ads1293_read_error(&m_ads1293_1, &error1);
// ads1293_read_error(&m_ads1293_1, &error1);
#if 0
error0.estatus =1;
@ -278,7 +279,7 @@ void trigger_capture() {
static uint32_t sample[6];
static uint8_t readystatus[2] = {0};
ads1293_read_ecgs(&m_ads1293_0, &sample[0]);
ads1293_read_ecgs(&m_ads1293_1, &sample[3]);
// ads1293_read_ecgs(&m_ads1293_1, &sample[3]);
// static int i = 0;
// static int j = 0;
@ -298,8 +299,8 @@ void trigger_capture() {
txpacket.frame[cache_data_size].h1 = 0xA2;
txpacket.frame[cache_data_size].h2 = 0x2;
txpacket.frame[cache_data_size].data[0].sample0 = sample[0];
txpacket.frame[cache_data_size].data[1].sample0 = sample[3];
txpacket.frame[cache_data_size].data[2].sample0 = sample[4];
txpacket.frame[cache_data_size].data[1].sample0 = sample[1];
txpacket.frame[cache_data_size].data[2].sample0 = sample[2];
txpacket.frame[cache_data_size].e1 = 0x2;
txpacket.frame[cache_data_size].e2 = 0xA2;
@ -326,7 +327,7 @@ void setup() {
SampleDataMgr_changeToExtMode();
ads1293_start_conversion(&m_ads1293_0);
ads1293_start_conversion(&m_ads1293_1);
// ads1293_start_conversion(&m_ads1293_1);
nrf_gpio_cfg_input(ADS1293_READY_PIN, NRF_GPIO_PIN_PULLUP);

7376
bin2/app.hex
File diff suppressed because it is too large
View File

16
bin2/bl_temp.hex

@ -2978,8 +2978,8 @@
:10DA000010D4070018D4070020D4070028D407003A
:10DA1000000000000090D0030000000000000000A3
:0CDA2000754F0700001000000000080017
:10E000001189F5BB020000000100000001000000C2
:10E0100000000000000000005CF200004B4111A86D
:10E000006B6EF81302000000010000000100000028
:10E01000000000000000000000E1000099D1B5718F
:10E0200001000000000000000000000000000000EF
:10E0300000000000000000000000000000000000E0
:10E0400000000000000000000000000000000000D0
@ -3015,12 +3015,12 @@
:10E2200000000000000000000000000000000000EE
:10E2300000000000000000000000000000000000DE
:10E2400000000000000000000000000000000000CE
:10E25000000000000000000000000000388FD9CF4F
:10E250000000000000000000000000003A4AA8A8EA
:10E2600000000000000000000000000000000000AE
:10E27000000000000000000000000000000000009E
:10E28000000000000000000000000000000000008E
:10E29000000000000000000000000000000000007E
:10E2A00000014B4111A80000000000000000000028
:10E2A000000199D1B57100000000000000000000DD
:10E2B000000000000000000000000000000000005E
:10E2C000000000000000000000000000000000004E
:10E2D000000000000000000000000000000000003E
@ -3029,8 +3029,8 @@
:10E30000000000000000000000000000000000000D
:10E3100000000000000000000000000000000000FD
:04E32000000000FFFA
:10F000001189F5BB020000000100000001000000B2
:10F0100000000000000000005CF200004B4111A85D
:10F000006B6EF81302000000010000000100000018
:10F01000000000000000000000E1000099D1B5717F
:10F0200001000000000000000000000000000000DF
:10F0300000000000000000000000000000000000D0
:10F0400000000000000000000000000000000000C0
@ -3066,12 +3066,12 @@
:10F2200000000000000000000000000000000000DE
:10F2300000000000000000000000000000000000CE
:10F2400000000000000000000000000000000000BE
:10F25000000000000000000000000000388FD9CF3F
:10F250000000000000000000000000003A4AA8A8DA
:10F26000000000000000000000000000000000009E
:10F27000000000000000000000000000000000008E
:10F28000000000000000000000000000000000007E
:10F29000000000000000000000000000000000006E
:10F2A00000014B4111A80000000000000000000018
:10F2A000000199D1B57100000000000000000000CD
:10F2B000000000000000000000000000000000004E
:10F2C000000000000000000000000000000000003E
:10F2D000000000000000000000000000000000002E

16
bin2/settings.hex

@ -1,6 +1,6 @@
:020000040007F3
:10E000001189F5BB020000000100000001000000C2
:10E0100000000000000000005CF200004B4111A86D
:10E000006B6EF81302000000010000000100000028
:10E01000000000000000000000E1000099D1B5718F
:10E0200001000000000000000000000000000000EF
:10E0300000000000000000000000000000000000E0
:10E0400000000000000000000000000000000000D0
@ -36,12 +36,12 @@
:10E2200000000000000000000000000000000000EE
:10E2300000000000000000000000000000000000DE
:10E2400000000000000000000000000000000000CE
:10E25000000000000000000000000000388FD9CF4F
:10E250000000000000000000000000003A4AA8A8EA
:10E2600000000000000000000000000000000000AE
:10E27000000000000000000000000000000000009E
:10E28000000000000000000000000000000000008E
:10E29000000000000000000000000000000000007E
:10E2A00000014B4111A80000000000000000000028
:10E2A000000199D1B57100000000000000000000DD
:10E2B000000000000000000000000000000000005E
:10E2C000000000000000000000000000000000004E
:10E2D000000000000000000000000000000000003E
@ -50,8 +50,8 @@
:10E30000000000000000000000000000000000000D
:10E3100000000000000000000000000000000000FD
:04E32000000000FFFA
:10F000001189F5BB020000000100000001000000B2
:10F0100000000000000000005CF200004B4111A85D
:10F000006B6EF81302000000010000000100000018
:10F01000000000000000000000E1000099D1B5717F
:10F0200001000000000000000000000000000000DF
:10F0300000000000000000000000000000000000D0
:10F0400000000000000000000000000000000000C0
@ -87,12 +87,12 @@
:10F2200000000000000000000000000000000000DE
:10F2300000000000000000000000000000000000CE
:10F2400000000000000000000000000000000000BE
:10F25000000000000000000000000000388FD9CF3F
:10F250000000000000000000000000003A4AA8A8DA
:10F26000000000000000000000000000000000009E
:10F27000000000000000000000000000000000008E
:10F28000000000000000000000000000000000007E
:10F29000000000000000000000000000000000006E
:10F2A00000014B4111A80000000000000000000018
:10F2A000000199D1B57100000000000000000000CD
:10F2B000000000000000000000000000000000004E
:10F2C000000000000000000000000000000000003E
:10F2D000000000000000000000000000000000002E

7392
bin2/whole.hex
File diff suppressed because it is too large
View File

16437
stable/onlyu2_stable_v1.hex
File diff suppressed because it is too large
View File

Loading…
Cancel
Save