123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305 |
- #ifndef SDK_VALIDATION_H
- #define SDK_VALIDATION_H
- #include "nrf_peripherals.h"
- #include "sdk_config.h"
- #ifdef __cplusplus
- extern "C" {
- #endif
- #if ((defined(SAADC_ENABLED)) && (SAADC_ENABLED > 0) && (!defined(SAADC_PRESENT)))
- #error "SAADC not present in selected MCU."
- #endif
- #if ((defined(ADC_ENABLED)) && (ADC_ENABLED > 0) && (!defined(ADC_PRESENT)))
- #error "SAADC not present in selected MCU."
- #endif
- #if ((defined(I2S_ENABLED)) && (I2S_ENABLED > 0) && (!defined(I2S_PRESENT)))
- #error "I2S not present in selected MCU."
- #endif
- #if ((defined(COMP_ENABLED)) && (COMP_ENABLED > 0) && (!defined(COMP_PRESENT)))
- #error "COMP not present in selected MCU."
- #endif
- #if ((defined(LPCOMP_ENABLED)) && (LPCOMP_ENABLED > 0) && (!defined(LPCOMP_PRESENT)))
- #error "LPCOMP not present in selected MCU."
- #endif
- #if ((defined(SPIS0_ENABLED)) && (SPIS0_ENABLED > 0) && (!defined(SPIS_PRESENT)))
- #error "SPIS0 instance not present in selected MCU."
- #endif
- #if ((defined(EGU_ENABLED)) && (EGU_ENABLED > 0) && (!defined(EGU_PRESENT)))
- #error "EGU instance not present in selected MCU."
- #endif
- #if ((defined(NFC_HAL_ENABLED)) && (NFC_HAL_ENABLED > 0) && (!defined(NFCT_PRESENT)))
- #error "NFC TAG not present in selected MCU."
- #endif
- #if ((defined(RTC2_ENABLED)) && (RTC2_ENABLED > 0) && (RTC_COUNT < 2))
- #error "RTC2 not present in selected MCU."
- #endif
- #if ((defined(TWIS0_ENABLED) || defined(TWIS1_ENABLED)) &&\
- ((TWIS0_ENABLED + TWIS1_ENABLED) > 0) &&\
- (!defined(TWIS_PRESENT)))
- #error "TWIS not present in selected MCU."
- #endif
- #if ((defined(SPIS2_ENABLED)) && (SPIS2_ENABLED > 0) && (SPIS_COUNT < 2))
- #error "SPI2/SPIS2 instance not present in selected MCU."
- #endif
- #if ((defined(TIMER3_ENABLED) || defined(TIMER4_ENABLED)) &&\
- ((TIMER3_ENABLED + TIMER4_ENABLED ) > 0) &&\
- (TIMER_COUNT < 5))
- #error "TIMER3 and TIMER4 not present in selected MCU."
- #endif
- #if !NRFX_CHECK(NRFX_PRS_ENABLED)
- #if ((defined(TWIM0_ENABLED) && defined(TWIS0_ENABLED)) &&\
- ((TWIM0_ENABLED + TWIS0_ENABLED) > 1))
- #error "Peripherals overlap. TWIM0, TWIS0 - only one of these can be enabled."
- #endif
- #if ((defined(TWIM0_ENABLED) && defined(SPIM0_ENABLED)) &&\
- ((TWIM0_ENABLED + SPIM0_ENABLED) > 1))
- #error "Peripherals overlap. TWIM0, SPIM0 - only one of these can be enabled."
- #endif
- #if ((defined(TWIM0_ENABLED) && defined(SPIS0_ENABLED)) &&\
- ((TWIM0_ENABLED + SPIS0_ENABLED) > 1))
- #error "Peripherals overlap. TWIM0, SPIS0 - only one of these can be enabled."
- #endif
- #if ((defined(TWIM0_ENABLED) && defined(SPI0_ENABLED)) &&\
- ((TWIM0_ENABLED + SPI0_ENABLED) > 1))
- #error "Peripherals overlap. TWIM0, SPI0 - only one of these can be enabled."
- #endif
- #if ((defined(TWIM0_ENABLED) && defined(TWI0_ENABLED)) &&\
- ((TWIM0_ENABLED + TWI0_ENABLED) > 1))
- #error "Peripherals overlap. TWIM0, TWI0 - only one of these can be enabled."
- #endif
- #if ((defined(TWIS0_ENABLED) && defined(SPIM0_ENABLED)) &&\
- ((TWIS0_ENABLED + SPIM0_ENABLED) > 1))
- #error "Peripherals overlap. TWIS0, SPIM0 - only one of these can be enabled."
- #endif
- #if ((defined(TWIS0_ENABLED) && defined(SPIS0_ENABLED)) &&\
- ((TWIS0_ENABLED + SPIS0_ENABLED) > 1))
- #error "Peripherals overlap. TWIS0, SPIS0 - only one of these can be enabled."
- #endif
- #if ((defined(TWIS0_ENABLED) && defined(SPI0_ENABLED)) &&\
- ((TWIS0_ENABLED + SPI0_ENABLED) > 1))
- #error "Peripherals overlap. TWIS0, SPI0 - only one of these can be enabled."
- #endif
- #if ((defined(TWIS0_ENABLED) && defined(TWI0_ENABLED)) &&\
- ((TWIS0_ENABLED + TWI0_ENABLED) > 1))
- #error "Peripherals overlap. TWIS0, TWI0 - only one of these can be enabled."
- #endif
- #if ((defined(SPIM0_ENABLED) && defined(SPIS0_ENABLED)) &&\
- ((SPIM0_ENABLED + SPIS0_ENABLED) > 1))
- #error "Peripherals overlap. SPIM0, SPIS0 - only one of these can be enabled."
- #endif
- #if ((defined(SPIM0_ENABLED) && defined(SPI0_ENABLED)) &&\
- ((SPIM0_ENABLED + SPI0_ENABLED) > 1))
- #error "Peripherals overlap. SPIM0, SPI0 - only one of these can be enabled."
- #endif
- #if ((defined(SPIM0_ENABLED) && defined(TWI0_ENABLED)) &&\
- ((SPIM0_ENABLED + TWI0_ENABLED) > 1))
- #error "Peripherals overlap. SPIM0, TWI0 - only one of these can be enabled."
- #endif
- #if ((defined(SPIS0_ENABLED) && defined(SPI0_ENABLED)) &&\
- ((SPIS0_ENABLED + SPI0_ENABLED) > 1))
- #error "Peripherals overlap. SPIS0, SPI0 - only one of these can be enabled."
- #endif
- #if ((defined(SPIS0_ENABLED) && defined(TWI0_ENABLED)) &&\
- ((SPIS0_ENABLED + TWI0_ENABLED) > 1))
- #error "Peripherals overlap. SPIS0, TWI0 - only one of these can be enabled."
- #endif
- #if ((defined(SPI0_ENABLED) && defined(TWI0_ENABLED)) &&\
- ((SPI0_ENABLED + TWI0_ENABLED) > 1))
- #error "Peripherals overlap. SPI0, TWI0 - only one of these can be enabled."
- #endif
- #if ((defined(TWIM1_ENABLED) && defined(TWIS1_ENABLED)) &&\
- ((TWIM1_ENABLED + TWIS1_ENABLED) > 1))
- #error "Peripherals overlap. TWIM1, TWIS1 - only one of these can be enabled."
- #endif
- #if ((defined(TWIM1_ENABLED) && defined(SPIM1_ENABLED)) &&\
- ((TWIM1_ENABLED + SPIM1_ENABLED) > 1))
- #error "Peripherals overlap. TWIM1, SPIM1 - only one of these can be enabled."
- #endif
- #if ((defined(TWIM1_ENABLED) && defined(SPIS1_ENABLED)) &&\
- ((TWIM1_ENABLED + SPIS1_ENABLED) > 1))
- #error "Peripherals overlap. TWIM1, SPIS1 - only one of these can be enabled."
- #endif
- #if ((defined(TWIM1_ENABLED) && defined(SPI1_ENABLED)) &&\
- ((TWIM1_ENABLED + SPI1_ENABLED) > 1))
- #error "Peripherals overlap. TWIM1, SPI1 - only one of these can be enabled."
- #endif
- #if ((defined(TWIM1_ENABLED) && defined(TWI1_ENABLED)) &&\
- ((TWIM1_ENABLED + TWI1_ENABLED) > 1))
- #error "Peripherals overlap. TWIM1, TWI1 - only one of these can be enabled."
- #endif
- #if ((defined(TWIS1_ENABLED) && defined(SPIM1_ENABLED)) &&\
- ((TWIS1_ENABLED + SPIM1_ENABLED) > 1))
- #error "Peripherals overlap. TWIS1, SPIM1 - only one of these can be enabled."
- #endif
- #if ((defined(TWIS1_ENABLED) && defined(SPIS1_ENABLED)) &&\
- ((TWIS1_ENABLED + SPIS1_ENABLED) > 1))
- #error "Peripherals overlap. TWIS1, SPIS1 - only one of these can be enabled."
- #endif
- #if ((defined(TWIS1_ENABLED) && defined(SPI1_ENABLED)) &&\
- ((TWIS1_ENABLED + SPI1_ENABLED) > 1))
- #error "Peripherals overlap. TWIS1, SPI1 - only one of these can be enabled."
- #endif
- #if ((defined(TWIS1_ENABLED) && defined(TWI1_ENABLED)) &&\
- ((TWIS1_ENABLED + TWI1_ENABLED) > 1))
- #error "Peripherals overlap. TWIS1, TWI1 - only one of these can be enabled."
- #endif
- #if ((defined(SPIM1_ENABLED) && defined(SPIS1_ENABLED)) &&\
- ((SPIM1_ENABLED + SPIS1_ENABLED) > 1))
- #error "Peripherals overlap. SPIM1, SPIS1 - only one of these can be enabled."
- #endif
- #if ((defined(SPIM1_ENABLED) && defined(SPI1_ENABLED)) &&\
- ((SPIM1_ENABLED + SPI1_ENABLED) > 1))
- #error "Peripherals overlap. SPIM1, SPI1 - only one of these can be enabled."
- #endif
- #if ((defined(SPIM1_ENABLED) && defined(TWI1_ENABLED)) &&\
- ((SPIM1_ENABLED + TWI1_ENABLED) > 1))
- #error "Peripherals overlap. SPIM1, TWI1 - only one of these can be enabled."
- #endif
- #if ((defined(SPIS1_ENABLED) && defined(SPI1_ENABLED)) &&\
- ((SPIS1_ENABLED + SPI1_ENABLED) > 1))
- #error "Peripherals overlap. SPIS1, SPI1 - only one of these can be enabled."
- #endif
- #if ((defined(SPIS1_ENABLED) && defined(TWI1_ENABLED)) &&\
- ((SPIS1_ENABLED + TWI1_ENABLED) > 1))
- #error "Peripherals overlap. SPIS1, TWI1 - only one of these can be enabled."
- #endif
- #if ((defined(SPI1_ENABLED) && defined(TWI1_ENABLED)) &&\
- ((SPI1_ENABLED + TWI1_ENABLED) > 1))
- #error "Peripherals overlap. SPI1, TWI1 - only one of these can be enabled."
- #endif
- #if ((defined(SPI2_ENABLED) && defined(SPIS2_ENABLED)) &&\
- ((SPI2_ENABLED + SPIS2_ENABLED) > 1))
- #error "Peripherals overlap. SPI2, SPIS2 - only one of these can be enabled."
- #endif
- #if ((defined(SPIM2_ENABLED) && defined(SPIS2_ENABLED)) &&\
- ((SPI2_ENABLED + SPIS2_ENABLED) > 1))
- #error "Peripherals overlap. SPIM2, SPIS2 - only one of these can be enabled."
- #endif
- #if ((defined(SPIM2_ENABLED) && defined(SPI2_ENABLED)) &&\
- ((SPI2_ENABLED + SPIS2_ENABLED) > 1))
- #error "Peripherals overlap. SPIM2, SPI2 - only one of these can be enabled."
- #endif
- #endif
- #ifdef NFCT_PRESENT
- #if ((defined(NFC_HAL_ENABLED) && defined(NRF_CLOCK_ENABLED)) &&\
- ((NFC_HAL_ENABLED) && (!NRF_CLOCK_ENABLED)))
- #error "NFC_HAL requires CLOCK to work. NFC_HAL can not be enabled without CLOCK."
- #endif
- #if ((defined(NFC_HAL_ENABLED) && defined(TIMER4_ENABLED)) &&\
- ((NFC_HAL_ENABLED + TIMER4_ENABLED) > 1))
- #error "TIMER4 is used by NFC_HAL. NFC_HAL, TIMER4 - only one of these can be enabled."
- #endif
- #endif
- #ifdef LPCOMP_PRESENT
- #if ((defined(COMP_ENABLED) && defined(LPCOMP_ENABLED)) && \
- (!NRFX_CHECK(NRFX_PRS_ENABLED)) && \
- ((COMP_ENABLED + LPCOMP_ENABLED) > 1))
- #error "Peripherals overlap. COMP, LPCOMP - only one of these can be enabled."
- #endif
- #endif
- #ifdef __cplusplus
- }
- #endif
- #endif
|