nrf51822 --- TWI0和SPI0 TWI1 SPI1

#ifndef NRF_DRV_CONFIG_VALIDATION_H
#define NRF_DRV_CONFIG_VALIDATION_H

#ifdef NRF52

#if (TWI0_ENABLED+SPI0_ENABLED+SPIS0_ENABLED+TWIS0_ENABLED)>1
#error "TWI0, SPI0, SPIS0 or TWIS0 cannot be enabled together. Instances overlaps."
#endif

#if (TWI1_ENABLED+SPI1_ENABLED+SPIS1_ENABLED+TWIS1_ENABLED)>1
#error "TWI1, SPI1, SPIS1 or TWIS1 cannot be enabled together. Instances overlaps."
#endif

#if (SPI2_ENABLED+SPIS2_ENABLED)>1
#error "SPI2 and SPIS2 cannot be enabled together. Instances overlaps."
#endif

#else //NRF51

#if (TWIS0_ENABLED + TWIS1_ENABLED) > 0
#error "TWIS not present in NRF51."
#endif

#if SPIS0_ENABLED > 0
#error "SPIS0 instance not present in NRF51."
#endif 

#if SPI2_ENABLED + SPIS2_ENABLED > 0
#error "SPI2/SPIS2 instance not present in NRF51."
#endif 

#if (TIMER3_ENABLED + TIMER4_ENABLED) > 0
#error "TIMER3 and TIMER4 not present in NRF51"
#endif

#if (TWI0_ENABLED+SPI0_ENABLED)>1
#error "TWI0, SPI0 or TWIS0 cannot be enabled together. Peripherals overlaps."
#endif

#if (TWI1_ENABLED+SPI1_ENABLED)>1
#error "TWI1, SPI1 or TWIS1 cannot be enabled together. Peripherals overlaps."
#endif

#if SAADC_ENABLED > 0
#error "SAADC not present in NRF51."
#endif

#endif //NRF51

#endif //NRF_DRV_CONFIG_VALIDATION_H




 参考手册  《nRF51_Series_Reference_manual v3.0.pdf》

 TWI0 SPI0外设的地址一样

 TWI1 SPI1外设的地址一样。

所以同一时间只能用一个


©️2020 CSDN 皮肤主题: 大白 设计师: CSDN官方博客 返回首页
实付0元
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值