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外设的地址一样。

所以同一时间只能用一个


  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值