|
|
@ -38,6 +38,7 @@ |
|
|
|
#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; |
|
|
@ -389,8 +390,9 @@ void ThreeLeadECG_ecg_init() { |
|
|
|
// 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); } |