Skip to content

Commit a9e166b

Browse files
masz-nordiccarlescufi
authored andcommitted
nrfx: align to changes in nrfx_config
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]>
1 parent c563b0e commit a9e166b

File tree

2 files changed

+129
-0
lines changed

2 files changed

+129
-0
lines changed

nrfx/templates/nrfx_config_nrf5340_application.h

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,77 @@
4646
* The following section provides configuration for the name translation.
4747
* It must be modified to reflect the actual configuration set in NRF_SPU.
4848
*/
49+
50+
#if defined(NRF_TRUSTZONE_NONSECURE)
51+
#define NRF_CLOCK NRF_CLOCK_NS
52+
#define NRF_COMP NRF_COMP_NS
53+
#define NRF_CTRLAP NRF_CTRLAP_NS
54+
#define NRF_DCNF NRF_DCNF_NS
55+
#define NRF_DPPIC NRF_DPPIC_NS
56+
#define NRF_EGU0 NRF_EGU0_NS
57+
#define NRF_EGU1 NRF_EGU1_NS
58+
#define NRF_EGU2 NRF_EGU2_NS
59+
#define NRF_EGU3 NRF_EGU3_NS
60+
#define NRF_EGU4 NRF_EGU4_NS
61+
#define NRF_EGU5 NRF_EGU5_NS
62+
#define NRF_FPU NRF_FPU_NS
63+
#define NRF_I2S0 NRF_I2S0_NS
64+
#define NRF_IPC NRF_IPC_NS
65+
#define NRF_KMU NRF_KMU_NS
66+
#define NRF_LPCOMP NRF_LPCOMP_NS
67+
#define NRF_MUTEX NRF_MUTEX_NS
68+
#define NRF_NFCT NRF_NFCT_NS
69+
#define NRF_NVMC NRF_NVMC_NS
70+
#define NRF_OSCILLATORS NRF_OSCILLATORS_NS
71+
#define NRF_P0 NRF_P0_NS
72+
#define NRF_P1 NRF_P1_NS
73+
#define NRF_PDM0 NRF_PDM0_NS
74+
#define NRF_POWER NRF_POWER_NS
75+
#define NRF_PWM0 NRF_PWM0_NS
76+
#define NRF_PWM1 NRF_PWM1_NS
77+
#define NRF_PWM2 NRF_PWM2_NS
78+
#define NRF_PWM3 NRF_PWM3_NS
79+
#define NRF_QDEC0 NRF_QDEC0_NS
80+
#define NRF_QDEC1 NRF_QDEC1_NS
81+
#define NRF_QSPI NRF_QSPI_NS
82+
#define NRF_REGULATORS NRF_REGULATORS_NS
83+
#define NRF_RESET NRF_RESET_NS
84+
#define NRF_RTC0 NRF_RTC0_NS
85+
#define NRF_RTC1 NRF_RTC1_NS
86+
#define NRF_SAADC NRF_SAADC_NS
87+
#define NRF_SPIM0 NRF_SPIM0_NS
88+
#define NRF_SPIM1 NRF_SPIM1_NS
89+
#define NRF_SPIM2 NRF_SPIM2_NS
90+
#define NRF_SPIM3 NRF_SPIM3_NS
91+
#define NRF_SPIM4 NRF_SPIM4_NS
92+
#define NRF_SPIS0 NRF_SPIS0_NS
93+
#define NRF_SPIS1 NRF_SPIS1_NS
94+
#define NRF_SPIS2 NRF_SPIS2_NS
95+
#define NRF_SPIS3 NRF_SPIS3_NS
96+
#define NRF_TIMER0 NRF_TIMER0_NS
97+
#define NRF_TIMER1 NRF_TIMER1_NS
98+
#define NRF_TIMER2 NRF_TIMER2_NS
99+
#define NRF_TWIM0 NRF_TWIM0_NS
100+
#define NRF_TWIM1 NRF_TWIM1_NS
101+
#define NRF_TWIM2 NRF_TWIM2_NS
102+
#define NRF_TWIM3 NRF_TWIM3_NS
103+
#define NRF_TWIS0 NRF_TWIS0_NS
104+
#define NRF_TWIS1 NRF_TWIS1_NS
105+
#define NRF_TWIS2 NRF_TWIS2_NS
106+
#define NRF_TWIS3 NRF_TWIS3_NS
107+
#define NRF_UARTE0 NRF_UARTE0_NS
108+
#define NRF_UARTE1 NRF_UARTE1_NS
109+
#define NRF_UARTE2 NRF_UARTE2_NS
110+
#define NRF_UARTE3 NRF_UARTE3_NS
111+
#define NRF_USBD NRF_USBD_NS
112+
#define NRF_USBREGULATOR NRF_USBREGULATOR_NS
113+
#define NRF_VMC NRF_VMC_NS
114+
#define NRF_WDT0 NRF_WDT0_NS
115+
#define NRF_WDT1 NRF_WDT1_NS
116+
#else
49117
#define NRF_CLOCK NRF_CLOCK_S
50118
#define NRF_COMP NRF_COMP_S
119+
#define NRF_CTRLAP NRF_CTRLAP_S
51120
#define NRF_DCNF NRF_DCNF_S
52121
#define NRF_DPPIC NRF_DPPIC_S
53122
#define NRF_EGU0 NRF_EGU0_S
@@ -110,6 +179,7 @@
110179
#define NRF_VMC NRF_VMC_S
111180
#define NRF_WDT0 NRF_WDT0_S
112181
#define NRF_WDT1 NRF_WDT1_S
182+
#endif
113183

114184
/*
115185
* The following section provides the name translation for peripherals with
@@ -126,6 +196,9 @@
126196
#define NRF_SPU NRF_SPU_S
127197
#define NRF_TAD NRF_TAD_S
128198
#define NRF_UICR NRF_UICR_S
199+
#define NRF_GPIOTE NRF_GPIOTE0
200+
#else
201+
#define NRF_GPIOTE NRF_GPIOTE1
129202
#endif
130203

131204
/* Fixups for the GPIOTE driver. */

nrfx/templates/nrfx_config_nrf91.h

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,58 @@
4646
* The following section provides configuration for the name translation.
4747
* It must be modified to reflect the actual configuration set in NRF_SPU.
4848
*/
49+
50+
#if defined(NRF_TRUSTZONE_NONSECURE)
51+
#define NRF_CLOCK NRF_CLOCK_NS
52+
#define NRF_DPPIC NRF_DPPIC_NS
53+
#define NRF_EGU0 NRF_EGU0_NS
54+
#define NRF_EGU1 NRF_EGU1_NS
55+
#define NRF_EGU2 NRF_EGU2_NS
56+
#define NRF_EGU3 NRF_EGU3_NS
57+
#define NRF_EGU4 NRF_EGU4_NS
58+
#define NRF_EGU5 NRF_EGU5_NS
59+
#define NRF_FPU NRF_FPU_NS
60+
#define NRF_I2S NRF_I2S_NS
61+
#define NRF_IPC NRF_IPC_NS
62+
#define NRF_KMU NRF_KMU_NS
63+
#define NRF_NVMC NRF_NVMC_NS
64+
#define NRF_P0 NRF_P0_NS
65+
#define NRF_PDM NRF_PDM_NS
66+
#define NRF_POWER NRF_POWER_NS
67+
#define NRF_PWM0 NRF_PWM0_NS
68+
#define NRF_PWM1 NRF_PWM1_NS
69+
#define NRF_PWM2 NRF_PWM2_NS
70+
#define NRF_PWM3 NRF_PWM3_NS
71+
#define NRF_REGULATORS NRF_REGULATORS_NS
72+
#define NRF_RTC0 NRF_RTC0_NS
73+
#define NRF_RTC1 NRF_RTC1_NS
74+
#define NRF_SAADC NRF_SAADC_NS
75+
#define NRF_SPIM0 NRF_SPIM0_NS
76+
#define NRF_SPIM1 NRF_SPIM1_NS
77+
#define NRF_SPIM2 NRF_SPIM2_NS
78+
#define NRF_SPIM3 NRF_SPIM3_NS
79+
#define NRF_SPIS0 NRF_SPIS0_NS
80+
#define NRF_SPIS1 NRF_SPIS1_NS
81+
#define NRF_SPIS2 NRF_SPIS2_NS
82+
#define NRF_SPIS3 NRF_SPIS3_NS
83+
#define NRF_TIMER0 NRF_TIMER0_NS
84+
#define NRF_TIMER1 NRF_TIMER1_NS
85+
#define NRF_TIMER2 NRF_TIMER2_NS
86+
#define NRF_TWIM0 NRF_TWIM0_NS
87+
#define NRF_TWIM1 NRF_TWIM1_NS
88+
#define NRF_TWIM2 NRF_TWIM2_NS
89+
#define NRF_TWIM3 NRF_TWIM3_NS
90+
#define NRF_TWIS0 NRF_TWIS0_NS
91+
#define NRF_TWIS1 NRF_TWIS1_NS
92+
#define NRF_TWIS2 NRF_TWIS2_NS
93+
#define NRF_TWIS3 NRF_TWIS3_NS
94+
#define NRF_UARTE0 NRF_UARTE0_NS
95+
#define NRF_UARTE1 NRF_UARTE1_NS
96+
#define NRF_UARTE2 NRF_UARTE2_NS
97+
#define NRF_UARTE3 NRF_UARTE3_NS
98+
#define NRF_VMC NRF_VMC_NS
99+
#define NRF_WDT NRF_WDT_NS
100+
#else
49101
#define NRF_CLOCK NRF_CLOCK_S
50102
#define NRF_DPPIC NRF_DPPIC_S
51103
#define NRF_EGU0 NRF_EGU0_S
@@ -95,6 +147,7 @@
95147
#define NRF_UARTE3 NRF_UARTE3_S
96148
#define NRF_VMC NRF_VMC_S
97149
#define NRF_WDT NRF_WDT_S
150+
#endif
98151

99152
/*
100153
* The following section provides the name translation for peripherals with
@@ -109,6 +162,9 @@
109162
#define NRF_SPU NRF_SPU_S
110163
#define NRF_TAD NRF_TAD_S
111164
#define NRF_UICR NRF_UICR_S
165+
#define NRF_GPIOTE NRF_GPIOTE0
166+
#else
167+
#define NRF_GPIOTE NRF_GPIOTE1
112168
#endif
113169

114170
/* Fixups for the GPIOTE driver. */

0 commit comments

Comments
 (0)