Skip to content

Commit

Permalink
nrfx: align to changes in nrfx_config
Browse files Browse the repository at this point in the history
Non-secure targets for nRF53 and nRF91 need to define
peripherals with _NS.
Also, there is a special case for GPIOTE.

Signed-off-by: Marcin Szymczyk <[email protected]>
  • Loading branch information
masz-nordic committed Nov 26, 2024
1 parent 8dddeed commit 9e6813f
Show file tree
Hide file tree
Showing 2 changed files with 120 additions and 113 deletions.
132 changes: 68 additions & 64 deletions nrfx/templates/nrfx_config_nrf5340_application.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,70 +46,71 @@
* The following section provides configuration for the name translation.
* It must be modified to reflect the actual configuration set in NRF_SPU.
*/
#define NRF_CLOCK NRF_CLOCK_S
#define NRF_COMP NRF_COMP_S
#define NRF_DCNF NRF_DCNF_S
#define NRF_DPPIC NRF_DPPIC_S
#define NRF_EGU0 NRF_EGU0_S
#define NRF_EGU1 NRF_EGU1_S
#define NRF_EGU2 NRF_EGU2_S
#define NRF_EGU3 NRF_EGU3_S
#define NRF_EGU4 NRF_EGU4_S
#define NRF_EGU5 NRF_EGU5_S
#define NRF_FPU NRF_FPU_S
#define NRF_I2S0 NRF_I2S0_S
#define NRF_IPC NRF_IPC_S
#define NRF_KMU NRF_KMU_S
#define NRF_LPCOMP NRF_LPCOMP_S
#define NRF_MUTEX NRF_MUTEX_S
#define NRF_NFCT NRF_NFCT_S
#define NRF_NVMC NRF_NVMC_S
#define NRF_OSCILLATORS NRF_OSCILLATORS_S
#define NRF_P0 NRF_P0_S
#define NRF_P1 NRF_P1_S
#define NRF_PDM0 NRF_PDM0_S
#define NRF_POWER NRF_POWER_S
#define NRF_PWM0 NRF_PWM0_S
#define NRF_PWM1 NRF_PWM1_S
#define NRF_PWM2 NRF_PWM2_S
#define NRF_PWM3 NRF_PWM3_S
#define NRF_QDEC0 NRF_QDEC0_S
#define NRF_QDEC1 NRF_QDEC1_S
#define NRF_QSPI NRF_QSPI_S
#define NRF_REGULATORS NRF_REGULATORS_S
#define NRF_RESET NRF_RESET_S
#define NRF_RTC0 NRF_RTC0_S
#define NRF_RTC1 NRF_RTC1_S
#define NRF_SAADC NRF_SAADC_S
#define NRF_SPIM0 NRF_SPIM0_S
#define NRF_SPIM1 NRF_SPIM1_S
#define NRF_SPIM2 NRF_SPIM2_S
#define NRF_SPIM3 NRF_SPIM3_S
#define NRF_SPIM4 NRF_SPIM4_S
#define NRF_SPIS0 NRF_SPIS0_S
#define NRF_SPIS1 NRF_SPIS1_S
#define NRF_SPIS2 NRF_SPIS2_S
#define NRF_SPIS3 NRF_SPIS3_S
#define NRF_TIMER0 NRF_TIMER0_S
#define NRF_TIMER1 NRF_TIMER1_S
#define NRF_TIMER2 NRF_TIMER2_S
#define NRF_TWIM0 NRF_TWIM0_S
#define NRF_TWIM1 NRF_TWIM1_S
#define NRF_TWIM2 NRF_TWIM2_S
#define NRF_TWIM3 NRF_TWIM3_S
#define NRF_TWIS0 NRF_TWIS0_S
#define NRF_TWIS1 NRF_TWIS1_S
#define NRF_TWIS2 NRF_TWIS2_S
#define NRF_TWIS3 NRF_TWIS3_S
#define NRF_UARTE0 NRF_UARTE0_S
#define NRF_UARTE1 NRF_UARTE1_S
#define NRF_UARTE2 NRF_UARTE2_S
#define NRF_UARTE3 NRF_UARTE3_S
#define NRF_USBD NRF_USBD_S
#define NRF_USBREGULATOR NRF_USBREGULATOR_S
#define NRF_VMC NRF_VMC_S
#define NRF_WDT0 NRF_WDT0_S
#define NRF_WDT1 NRF_WDT1_S
#define NRF_CLOCK NRF_PERIPH(NRF_CLOCK)
#define NRF_COMP NRF_PERIPH(NRF_COMP)
#define NRF_CTRLAP NRF_PERIPH(NRF_CTRLAP)
#define NRF_DCNF NRF_PERIPH(NRF_DCNF)
#define NRF_DPPIC NRF_PERIPH(NRF_DPPIC)
#define NRF_EGU0 NRF_PERIPH(NRF_EGU0)
#define NRF_EGU1 NRF_PERIPH(NRF_EGU1)
#define NRF_EGU2 NRF_PERIPH(NRF_EGU2)
#define NRF_EGU3 NRF_PERIPH(NRF_EGU3)
#define NRF_EGU4 NRF_PERIPH(NRF_EGU4)
#define NRF_EGU5 NRF_PERIPH(NRF_EGU5)
#define NRF_FPU NRF_PERIPH(NRF_FPU)
#define NRF_I2S0 NRF_PERIPH(NRF_I2S0)
#define NRF_IPC NRF_PERIPH(NRF_IPC)
#define NRF_KMU NRF_PERIPH(NRF_KMU)
#define NRF_LPCOMP NRF_PERIPH(NRF_LPCOMP)
#define NRF_MUTEX NRF_PERIPH(NRF_MUTEX)
#define NRF_NFCT NRF_PERIPH(NRF_NFCT)
#define NRF_NVMC NRF_PERIPH(NRF_NVMC)
#define NRF_OSCILLATORS NRF_PERIPH(NRF_OSCILLATORS)
#define NRF_P0 NRF_PERIPH(NRF_P0)
#define NRF_P1 NRF_PERIPH(NRF_P1)
#define NRF_PDM0 NRF_PERIPH(NRF_PDM0)
#define NRF_POWER NRF_PERIPH(NRF_POWER)
#define NRF_PWM0 NRF_PERIPH(NRF_PWM0)
#define NRF_PWM1 NRF_PERIPH(NRF_PWM1)
#define NRF_PWM2 NRF_PERIPH(NRF_PWM2)
#define NRF_PWM3 NRF_PERIPH(NRF_PWM3)
#define NRF_QDEC0 NRF_PERIPH(NRF_QDEC0)
#define NRF_QDEC1 NRF_PERIPH(NRF_QDEC1)
#define NRF_QSPI NRF_PERIPH(NRF_QSPI)
#define NRF_REGULATORS NRF_PERIPH(NRF_REGULATORS)
#define NRF_RESET NRF_PERIPH(NRF_RESET)
#define NRF_RTC0 NRF_PERIPH(NRF_RTC0)
#define NRF_RTC1 NRF_PERIPH(NRF_RTC1)
#define NRF_SAADC NRF_PERIPH(NRF_SAADC)
#define NRF_SPIM0 NRF_PERIPH(NRF_SPIM0)
#define NRF_SPIM1 NRF_PERIPH(NRF_SPIM1)
#define NRF_SPIM2 NRF_PERIPH(NRF_SPIM2)
#define NRF_SPIM3 NRF_PERIPH(NRF_SPIM3)
#define NRF_SPIM4 NRF_PERIPH(NRF_SPIM4)
#define NRF_SPIS0 NRF_PERIPH(NRF_SPIS0)
#define NRF_SPIS1 NRF_PERIPH(NRF_SPIS1)
#define NRF_SPIS2 NRF_PERIPH(NRF_SPIS2)
#define NRF_SPIS3 NRF_PERIPH(NRF_SPIS3)
#define NRF_TIMER0 NRF_PERIPH(NRF_TIMER0)
#define NRF_TIMER1 NRF_PERIPH(NRF_TIMER1)
#define NRF_TIMER2 NRF_PERIPH(NRF_TIMER2)
#define NRF_TWIM0 NRF_PERIPH(NRF_TWIM0)
#define NRF_TWIM1 NRF_PERIPH(NRF_TWIM1)
#define NRF_TWIM2 NRF_PERIPH(NRF_TWIM2)
#define NRF_TWIM3 NRF_PERIPH(NRF_TWIM3)
#define NRF_TWIS0 NRF_PERIPH(NRF_TWIS0)
#define NRF_TWIS1 NRF_PERIPH(NRF_TWIS1)
#define NRF_TWIS2 NRF_PERIPH(NRF_TWIS2)
#define NRF_TWIS3 NRF_PERIPH(NRF_TWIS3)
#define NRF_UARTE0 NRF_PERIPH(NRF_UARTE0)
#define NRF_UARTE1 NRF_PERIPH(NRF_UARTE1)
#define NRF_UARTE2 NRF_PERIPH(NRF_UARTE2)
#define NRF_UARTE3 NRF_PERIPH(NRF_UARTE3)
#define NRF_USBD NRF_PERIPH(NRF_USBD)
#define NRF_USBREGULATOR NRF_PERIPH(NRF_USBREGULATOR)
#define NRF_VMC NRF_PERIPH(NRF_VMC)
#define NRF_WDT0 NRF_PERIPH(NRF_WDT0)
#define NRF_WDT1 NRF_PERIPH(NRF_WDT1)

/*
* The following section provides the name translation for peripherals with
Expand All @@ -126,6 +127,9 @@
#define NRF_SPU NRF_SPU_S
#define NRF_TAD NRF_TAD_S
#define NRF_UICR NRF_UICR_S
#define NRF_GPIOTE NRF_GPIOTE0
#else
#define NRF_GPIOTE NRF_GPIOTE1
#endif

/* Fixups for the GPIOTE driver. */
Expand Down
101 changes: 52 additions & 49 deletions nrfx/templates/nrfx_config_nrf91.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,55 +46,55 @@
* The following section provides configuration for the name translation.
* It must be modified to reflect the actual configuration set in NRF_SPU.
*/
#define NRF_CLOCK NRF_CLOCK_S
#define NRF_DPPIC NRF_DPPIC_S
#define NRF_EGU0 NRF_EGU0_S
#define NRF_EGU1 NRF_EGU1_S
#define NRF_EGU2 NRF_EGU2_S
#define NRF_EGU3 NRF_EGU3_S
#define NRF_EGU4 NRF_EGU4_S
#define NRF_EGU5 NRF_EGU5_S
#define NRF_FPU NRF_FPU_S
#define NRF_I2S NRF_I2S_S
#define NRF_IPC NRF_IPC_S
#define NRF_KMU NRF_KMU_S
#define NRF_NVMC NRF_NVMC_S
#define NRF_P0 NRF_P0_S
#define NRF_PDM NRF_PDM_S
#define NRF_POWER NRF_POWER_S
#define NRF_PWM0 NRF_PWM0_S
#define NRF_PWM1 NRF_PWM1_S
#define NRF_PWM2 NRF_PWM2_S
#define NRF_PWM3 NRF_PWM3_S
#define NRF_REGULATORS NRF_REGULATORS_S
#define NRF_RTC0 NRF_RTC0_S
#define NRF_RTC1 NRF_RTC1_S
#define NRF_SAADC NRF_SAADC_S
#define NRF_SPIM0 NRF_SPIM0_S
#define NRF_SPIM1 NRF_SPIM1_S
#define NRF_SPIM2 NRF_SPIM2_S
#define NRF_SPIM3 NRF_SPIM3_S
#define NRF_SPIS0 NRF_SPIS0_S
#define NRF_SPIS1 NRF_SPIS1_S
#define NRF_SPIS2 NRF_SPIS2_S
#define NRF_SPIS3 NRF_SPIS3_S
#define NRF_TIMER0 NRF_TIMER0_S
#define NRF_TIMER1 NRF_TIMER1_S
#define NRF_TIMER2 NRF_TIMER2_S
#define NRF_TWIM0 NRF_TWIM0_S
#define NRF_TWIM1 NRF_TWIM1_S
#define NRF_TWIM2 NRF_TWIM2_S
#define NRF_TWIM3 NRF_TWIM3_S
#define NRF_TWIS0 NRF_TWIS0_S
#define NRF_TWIS1 NRF_TWIS1_S
#define NRF_TWIS2 NRF_TWIS2_S
#define NRF_TWIS3 NRF_TWIS3_S
#define NRF_UARTE0 NRF_UARTE0_S
#define NRF_UARTE1 NRF_UARTE1_S
#define NRF_UARTE2 NRF_UARTE2_S
#define NRF_UARTE3 NRF_UARTE3_S
#define NRF_VMC NRF_VMC_S
#define NRF_WDT NRF_WDT_S
#define NRF_CLOCK NRF_PERIPH(NRF_CLOCK)
#define NRF_DPPIC NRF_PERIPH(NRF_DPPIC)
#define NRF_EGU0 NRF_PERIPH(NRF_EGU0)
#define NRF_EGU1 NRF_PERIPH(NRF_EGU1)
#define NRF_EGU2 NRF_PERIPH(NRF_EGU2)
#define NRF_EGU3 NRF_PERIPH(NRF_EGU3)
#define NRF_EGU4 NRF_PERIPH(NRF_EGU4)
#define NRF_EGU5 NRF_PERIPH(NRF_EGU5)
#define NRF_FPU NRF_PERIPH(NRF_FPU)
#define NRF_I2S NRF_PERIPH(NRF_I2S)
#define NRF_IPC NRF_PERIPH(NRF_IPC)
#define NRF_KMU NRF_PERIPH(NRF_KMU)
#define NRF_NVMC NRF_PERIPH(NRF_NVMC)
#define NRF_P0 NRF_PERIPH(NRF_P0)
#define NRF_PDM NRF_PERIPH(NRF_PDM)
#define NRF_POWER NRF_PERIPH(NRF_POWER)
#define NRF_PWM0 NRF_PERIPH(NRF_PWM0)
#define NRF_PWM1 NRF_PERIPH(NRF_PWM1)
#define NRF_PWM2 NRF_PERIPH(NRF_PWM2)
#define NRF_PWM3 NRF_PERIPH(NRF_PWM3)
#define NRF_REGULATORS NRF_PERIPH(NRF_REGULATORS)
#define NRF_RTC0 NRF_PERIPH(NRF_RTC0)
#define NRF_RTC1 NRF_PERIPH(NRF_RTC1)
#define NRF_SAADC NRF_PERIPH(NRF_SAADC)
#define NRF_SPIM0 NRF_PERIPH(NRF_SPIM0)
#define NRF_SPIM1 NRF_PERIPH(NRF_SPIM1)
#define NRF_SPIM2 NRF_PERIPH(NRF_SPIM2)
#define NRF_SPIM3 NRF_PERIPH(NRF_SPIM3)
#define NRF_SPIS0 NRF_PERIPH(NRF_SPIS0)
#define NRF_SPIS1 NRF_PERIPH(NRF_SPIS1)
#define NRF_SPIS2 NRF_PERIPH(NRF_SPIS2)
#define NRF_SPIS3 NRF_PERIPH(NRF_SPIS3)
#define NRF_TIMER0 NRF_PERIPH(NRF_TIMER0)
#define NRF_TIMER1 NRF_PERIPH(NRF_TIMER1)
#define NRF_TIMER2 NRF_PERIPH(NRF_TIMER2)
#define NRF_TWIM0 NRF_PERIPH(NRF_TWIM0)
#define NRF_TWIM1 NRF_PERIPH(NRF_TWIM1)
#define NRF_TWIM2 NRF_PERIPH(NRF_TWIM2)
#define NRF_TWIM3 NRF_PERIPH(NRF_TWIM3)
#define NRF_TWIS0 NRF_PERIPH(NRF_TWIS0)
#define NRF_TWIS1 NRF_PERIPH(NRF_TWIS1)
#define NRF_TWIS2 NRF_PERIPH(NRF_TWIS2)
#define NRF_TWIS3 NRF_PERIPH(NRF_TWIS3)
#define NRF_UARTE0 NRF_PERIPH(NRF_UARTE0)
#define NRF_UARTE1 NRF_PERIPH(NRF_UARTE1)
#define NRF_UARTE2 NRF_PERIPH(NRF_UARTE2)
#define NRF_UARTE3 NRF_PERIPH(NRF_UARTE3)
#define NRF_VMC NRF_PERIPH(NRF_VMC)
#define NRF_WDT NRF_PERIPH(NRF_WDT)

/*
* The following section provides the name translation for peripherals with
Expand All @@ -109,6 +109,9 @@
#define NRF_SPU NRF_SPU_S
#define NRF_TAD NRF_TAD_S
#define NRF_UICR NRF_UICR_S
#define NRF_GPIOTE NRF_GPIOTE0
#else
#define NRF_GPIOTE NRF_GPIOTE1
#endif

/* Fixups for the GPIOTE driver. */
Expand Down

0 comments on commit 9e6813f

Please sign in to comment.