Browse Source

update

3lead_uart_test_ok_version
zhaohe 1 year ago
parent
commit
ba58017e38
  1. 2
      app/config/sdk_config.h
  2. 2
      app/main.c
  3. 13
      app/src/three_lead/three_lead_board.c
  4. 1
      app/src/three_lead/three_lead_board.h

2
app/config/sdk_config.h

@ -5682,7 +5682,7 @@
// <e> SPI2_ENABLED - Enable SPI2 instance
//==========================================================
#ifndef SPI2_ENABLED
#define SPI2_ENABLED 0
#define SPI2_ENABLED 1
#endif
// <q> SPI2_USE_EASY_DMA - Use EasyDMA

2
app/main.c

@ -321,7 +321,7 @@ void main() {
static void test_tx_timer_cb(void* p_context) {
static uint32_t data;
data++;
ZLOGI("tim cb %d", data);
ZLOGI("tim cb %d :%d", data,ThreeLeadECG_ready_pin_state_get());
// ThreeLeadECG_sdcard_connect2_ext_usb_sdcard_driver_ic_reset();
}

13
app/src/three_lead/three_lead_board.c

@ -33,11 +33,12 @@
#define SDCARD_USBDRIVER_IC_RESET_PIN 28
#define SDCARD_POWER_CTRL_PIN 30
#define ADS1293_SPI_SCK_PIN (32+9)
#define ADS1293_SPI_SCK_PIN (32 + 9)
#define ADS1293_SPI_MOSI_PIN 15
#define ADS1293_SPI_MISO_PIN 20
#define ADS1293_SPI_CS0_PIN 3
#define ADS1293_SPI_CS1_PIN 29
#define ADS1293_READY_PIN 31
/*******************************************************************************
* TOOLS *
@ -362,7 +363,7 @@ void ThreeLeadECG_sdcard_umount() {
* ecg *
*******************************************************************************/
static const nrf_drv_spi_t spi = NRF_DRV_SPI_INSTANCE(0); /**< SPI instance. */
static const nrf_drv_spi_t spi = NRF_DRV_SPI_INSTANCE(2); /**< SPI instance. */
static ads1293_t m_ads1293_0;
static ads1293_t m_ads1293_1;
@ -385,12 +386,13 @@ void ThreeLeadECG_ecg_init() {
spi_config.mosi_pin = ADS1293_SPI_MOSI_PIN;
spi_config.sck_pin = ADS1293_SPI_SCK_PIN;
spi_config.frequency = NRF_DRV_SPI_FREQ_1M;
spi_config.mode = NRF_DRV_SPI_MODE_3;
spi_config.mode = NRF_DRV_SPI_MODE_3;
// spi_config.mode =
ZERROR_CHECK(nrf_drv_spi_init(&spi, &spi_config, NULL, NULL));
znrf_gpio_cfg_output(ADS1293_SPI_CS0_PIN, NRF_GPIO_PIN_PULLUP);
znrf_gpio_cfg_output(ADS1293_SPI_CS1_PIN, NRF_GPIO_PIN_PULLUP);
znrf_gpio_cfg_output(ADS1293_SPI_CS0_PIN, NRF_GPIO_PIN_NOPULL);
znrf_gpio_cfg_output(ADS1293_SPI_CS1_PIN, NRF_GPIO_PIN_NOPULL);
nrf_gpio_cfg_input(ADS1293_READY_PIN, NRF_GPIO_PIN_PULLUP);
nrf_gpio_pin_set(ADS1293_SPI_CS0_PIN);
nrf_gpio_pin_set(ADS1293_SPI_CS1_PIN);
@ -406,3 +408,4 @@ void ThreeLeadECG_ecg_init() {
revid = ads1293_spi_readreg(&m_ads1293_1, TI_ADS1293_REVID_REG);
NRF_LOG_INFO("ads1293_1 revid: %d", revid);
}
bool ThreeLeadECG_ready_pin_state_get() { return nrf_gpio_pin_read(ADS1293_READY_PIN); }

1
app/src/three_lead/three_lead_board.h

@ -46,3 +46,4 @@ void ThreeLeadECG_sdcard_umount();
* ECG *
*******************************************************************************/
void ThreeLeadECG_ecg_init();
bool ThreeLeadECG_ready_pin_state_get();
Loading…
Cancel
Save