Skip to content

Commit 22b17d2

Browse files
committed
nrfx: samples: align to nrfx 4.0 API change
- align all samples to nrfx 4.0 API change - add support for the nRF54L15 DK to all existing samples except for the RNG sample. - add sample for the CRACEN driver. - divide existing loopback definitions in `common/nrfx_example.h` into individual header files for each board in `common/boards`. - move pin definitions from individual samples to board header files in `common/boards`. Signed-off-by: Michał Bainczyk <michal.bainczyk@nordicsemi.no>
1 parent 7858281 commit 22b17d2

File tree

188 files changed

+2333
-989
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

188 files changed

+2333
-989
lines changed

nrfx/samples/CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
# Changelog
22
All notable changes to this project are documented in this file.
33

4+
## [4.0.1] - 2025-11-21
5+
### Changed
6+
- Applied nrfx 4.0 changes to existing samples for all drivers.
7+
- Changed UARTE instance used for console on nRF54L15 DK to UARTE30 as this is the instance used in all other samples. The change was not applied to SPIM-SPIS examples due to conflicting pins.
8+
9+
## [3.14.0] - 2025-08-22
10+
### Added
11+
- Added support for the nRF54L15 DK to all existing samples except for the RNG sample.
12+
- Added sample for the CRACEN driver.
13+
14+
### Changed
15+
- Divided existing loopback definitions in `common/nrfx_example.h` into individual header files for each board in `common/boards`.
16+
- Moved pin definitions from individual samples to board header files in `common/boards`.
17+
418
## [3.8.0] - 2024-10-17
519
### Changed
620
- Aligned Kconfig definitions to DPPIC multi-instance support in the GPPI and SAADC driver samples.
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
#ifndef NRF52833DK_NRF52833_CONFIG_H__
2+
#define NRF52833DK_NRF52833_CONFIG_H__
3+
4+
#define LOOPBACK_PIN_1A 3
5+
#define LOOPBACK_PIN_1B 31
6+
#define LOOPBACK_PIN_2A 4
7+
#define LOOPBACK_PIN_2B 30
8+
#define LOOPBACK_PIN_3A 28
9+
#define LOOPBACK_PIN_3B 29
10+
#define LOOPBACK_PIN_4A 26
11+
#define LOOPBACK_PIN_4B 27
12+
13+
#define LED1_PIN 13
14+
#define LED2_PIN 14
15+
#define LED3_PIN 15
16+
#define LED4_PIN 16
17+
18+
/* EXAMPLE-SPECIFIC DEFINES: */
19+
20+
/* NRFX_EGU */
21+
/** @brief Symbol specifying EGU instance to be used in the nrfx_egu example. */
22+
#define EGU_INST_IDX 0
23+
24+
/* NRFX_GPPI */
25+
/** @brief Symbol specifying TIMER instance to be used in the nrfx_gppi examples. */
26+
#define GPPI_TIMER_INST_IDX 0
27+
28+
/** @brief Symbol specifying GPIOTE instance to be used in the nrfx_gppi examples. */
29+
#define GPPI_GPIOTE_INST_IDX 0
30+
31+
/** @brief Symbol specifying output pin associated with primary task in the nrfx_gppi examples. */
32+
#define GPPI_OUTPUT_PIN_PRIMARY LED1_PIN
33+
34+
/** @brief Symbol specifying output pin associated with fork task in the nrfx_gppi examples. */
35+
#define GPPI_OUTPUT_PIN_FORK LED2_PIN
36+
37+
/* NRFX_PWM */
38+
/** @brief Symbol specifying PWM instance to be used in the nrfx_pwm examples. */
39+
#define PWM_INST_IDX 0
40+
41+
/** @brief Symbol specifying a pin connected to LED to be used in the nrfx_pwm examples. */
42+
#define PWM_LED1_PIN LED1_PIN
43+
/** @brief Symbol specifying a pin connected to LED to be used in the nrfx_pwm examples. */
44+
#define PWM_LED2_PIN LED2_PIN
45+
/** @brief Symbol specifying a pin connected to LED to be used in the nrfx_pwm examples. */
46+
#define PWM_LED3_PIN LED3_PIN
47+
/** @brief Symbol specifying a pin connected to LED to be used in the nrfx_pwm examples. */
48+
#define PWM_LED4_PIN LED4_PIN
49+
50+
/* NRFX_SAADC */
51+
/** @brief Symbol specifying GPIOTE instance to be used in the nrfx_saadc examples. */
52+
#define SAADC_GPIOTE_INST_IDX 0
53+
54+
/** @brief Symbol specifying timer instance to be used in the nrfx_saadc examples. */
55+
#define SAADC_TIMER_INST_IDX 0
56+
/**
57+
* @brief Symbol specifying the maximum number of SAADC channels that can be used in the
58+
* nrfx_saadc examples.
59+
*/
60+
#define SAADC_MAX_CHANNELS 3
61+
62+
/** @brief Symbol specifying analog input to be observed by SAADC channel 0 in the nrfx_saadc examples. */
63+
#define SAADC_CH0_AIN NRFX_ANALOG_EXTERNAL_AIN1
64+
/** @brief Symbol specifying analog input to be observed by SAADC channel 1 in the nrfx_saadc examples. */
65+
#define SAADC_CH1_AIN NRFX_ANALOG_EXTERNAL_AIN2
66+
/** @brief Symbol specifying analog input to be observed by SAADC channel 2 in the nrfx_saadc examples. */
67+
#define SAADC_CH2_AIN NRFX_ANALOG_EXTERNAL_AIN4
68+
69+
/** @brief Symbol specifying GPIO pin connected to SAADC channel 0 in the nrfx_saadc examples. */
70+
#define SAADC_CH0_LOOPBACK_PIN LOOPBACK_PIN_1B
71+
/** @brief Symbol specifying GPIO pin connected to SAADC channel 1 in the nrfx_saadc examples. */
72+
#define SAADC_CH1_LOOPBACK_PIN LOOPBACK_PIN_2B
73+
/** @brief Symbol specifying GPIO pin connected to SAADC channel 2 in the nrfx_saadc examples. */
74+
#define SAADC_CH2_LOOPBACK_PIN LOOPBACK_PIN_3B
75+
76+
/* NRFX_SPIM */
77+
/** @brief Symbol specifying SPIM instance to be used in nrfx_spim examples. */
78+
#define SPIM_INST_IDX 1
79+
80+
/* NRFX_SPIM_SPIS */
81+
/** @brief Symbol specifying SPIM instance to be used in nrfx_spim_spis examples. */
82+
#define SPIM_SPIS_SPIM_INST_IDX 1
83+
/** @brief Symbol specifying SPIS instance to be used in nrfx_spim_spis examples. */
84+
#define SPIM_SPIS_SPIS_INST_IDX 2
85+
86+
/** @brief Symbol specifying master's pin number for MOSI in nrfx_spim_spis examples. */
87+
#define SPIM_SPIS_MOSI_PIN_MASTER LOOPBACK_PIN_1A
88+
/** @brief Symbol specifying slave's pin number for MOSI in nrfx_spim_spis examples. */
89+
#define SPIM_SPIS_MOSI_PIN_SLAVE LOOPBACK_PIN_1B
90+
/** @brief Symbol specifying master's pin number for MISO in nrfx_spim_spis examples. */
91+
#define SPIM_SPIS_MISO_PIN_MASTER LOOPBACK_PIN_2A
92+
/** @brief Symbol specifying slave's pin number for MISO in nrfx_spim_spis examples. */
93+
#define SPIM_SPIS_MISO_PIN_SLAVE LOOPBACK_PIN_2B
94+
/** @brief Symbol specifying master's pin number for SCK in nrfx_spim_spis examples. */
95+
#define SPIM_SPIS_SCK_PIN_MASTER LOOPBACK_PIN_3A
96+
/** @brief Symbol specifying slave's pin number for SCK in nrfx_spim_spis examples. */
97+
#define SPIM_SPIS_SCK_PIN_SLAVE LOOPBACK_PIN_3B
98+
/** @brief Symbol specifying master's pin number for SS in nrfx_spim_spis examples. */
99+
#define SPIM_SPIS_SS_PIN_MASTER LOOPBACK_PIN_4A
100+
/** @brief Symbol specifying slave's pin number for CSN in nrfx_spim_spis examples. */
101+
#define SPIM_SPIS_CSN_PIN_SLAVE LOOPBACK_PIN_4B
102+
103+
/* NRFX_TIMER */
104+
/** @brief Symbol specifying timer instance to be used in nrfx_timer/timer example. */
105+
#define TIMER_INST_IDX 0
106+
107+
/** @brief Symbol specifying timer instance to be used in timer mode (T) in nrfx_timer/counter example. */
108+
#define TIMER_T_INST_IDX 0
109+
/** @brief Symbol specifying timer instance to be used in counter mode (C) in nrfx_timer/counter example. */
110+
#define TIMER_C_INST_IDX 1
111+
112+
/* NRFX_TWIM_TWIS */
113+
/** @brief Symbol specifying TWIM instance to be used in nrfx_twim_twis examples. */
114+
#define TWIM_INST_IDX 0
115+
/** @brief Symbol specifying TWIS instance to be used in nrfx_twim_twis examples. */
116+
#define TWIS_INST_IDX 1
117+
118+
/** @brief Symbol specifying pin number of master SCL to be used in nrfx_twim_twis examples. */
119+
#define TWIM_TWIS_MASTER_SCL_PIN LOOPBACK_PIN_1A
120+
/** @brief Symbol specifying pin number of slave SCL to be used in nrfx_twim_twis examples. */
121+
#define TWIM_TWIS_SLAVE_SCL_PIN LOOPBACK_PIN_1B
122+
/** @brief Symbol specifying pin number of master SDA to be used in nrfx_twim_twis examples. */
123+
#define TWIM_TWIS_MASTER_SDA_PIN LOOPBACK_PIN_2A
124+
/** @brief Symbol specifying pin number of slave SDA to be used in nrfx_twim_twis examples. */
125+
#define TWIM_TWIS_SLAVE_SDA_PIN LOOPBACK_PIN_2B
126+
127+
/* NRFX_UARTE */
128+
/** @brief Symbol specifying UARTE instance to be used in nrfx_uarte examples. */
129+
#define UARTE_INST_IDX 1
130+
131+
/** @brief Symbol specifying TX pin number of UARTE to be used in nrfx_uarte examples. */
132+
#define UARTE_TX_PIN LOOPBACK_PIN_1A
133+
/** @brief Symbol specifying RX pin number of UARTE to be used in nrfx_uarte examples. */
134+
#define UARTE_RX_PIN LOOPBACK_PIN_1B
135+
136+
#endif // NRF52833DK_NRF52833_CONFIG_H__
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
#ifndef NRF52840DK_NRF52840_CONFIG_H__
2+
#define NRF52840DK_NRF52840_CONFIG_H__
3+
4+
#define LOOPBACK_PIN_1A 3
5+
#define LOOPBACK_PIN_1B 31
6+
#define LOOPBACK_PIN_2A 4
7+
#define LOOPBACK_PIN_2B 30
8+
#define LOOPBACK_PIN_3A 28
9+
#define LOOPBACK_PIN_3B 29
10+
#define LOOPBACK_PIN_4A 26
11+
#define LOOPBACK_PIN_4B 27
12+
13+
#define LED1_PIN 13
14+
#define LED2_PIN 14
15+
#define LED3_PIN 15
16+
#define LED4_PIN 16
17+
18+
/* EXAMPLE-SPECIFIC DEFINES: */
19+
20+
/* NRFX_EGU */
21+
/** @brief Symbol specifying EGU instance to be used in the nrfx_egu example. */
22+
#define EGU_INST_IDX 0
23+
24+
/* NRFX_GPPI */
25+
/** @brief Symbol specifying TIMER instance to be used in the nrfx_gppi examples. */
26+
#define GPPI_TIMER_INST_IDX 0
27+
28+
/** @brief Symbol specifying GPIOTE instance to be used in the nrfx_gppi examples. */
29+
#define GPPI_GPIOTE_INST_IDX 0
30+
31+
/** @brief Symbol specifying output pin associated with primary task in the nrfx_gppi examples. */
32+
#define GPPI_OUTPUT_PIN_PRIMARY LED1_PIN
33+
34+
/** @brief Symbol specifying output pin associated with fork task in the nrfx_gppi examples. */
35+
#define GPPI_OUTPUT_PIN_FORK LED2_PIN
36+
37+
/* NRFX_PWM */
38+
/** @brief Symbol specifying PWM instance to be used in the nrfx_pwm examples. */
39+
#define PWM_INST_IDX 0
40+
41+
/** @brief Symbol specifying a pin connected to LED to be used in the nrfx_pwm examples. */
42+
#define PWM_LED1_PIN LED1_PIN
43+
/** @brief Symbol specifying a pin connected to LED to be used in the nrfx_pwm examples. */
44+
#define PWM_LED2_PIN LED2_PIN
45+
/** @brief Symbol specifying a pin connected to LED to be used in the nrfx_pwm examples. */
46+
#define PWM_LED3_PIN LED3_PIN
47+
/** @brief Symbol specifying a pin connected to LED to be used in the nrfx_pwm examples. */
48+
#define PWM_LED4_PIN LED4_PIN
49+
50+
/* NRFX_SAADC */
51+
/** @brief Symbol specifying GPIOTE instance to be used in the nrfx_saadc examples. */
52+
#define SAADC_GPIOTE_INST_IDX 0
53+
54+
/** @brief Symbol specifying timer instance to be used in the nrfx_saadc examples. */
55+
#define SAADC_TIMER_INST_IDX 0
56+
/**
57+
* @brief Symbol specifying the maximum number of SAADC channels that can be used in the
58+
* nrfx_saadc examples.
59+
*/
60+
#define SAADC_MAX_CHANNELS 3
61+
62+
/** @brief Symbol specifying analog input to be observed by SAADC channel 0 in the nrfx_saadc examples. */
63+
#define SAADC_CH0_AIN NRFX_ANALOG_EXTERNAL_AIN1
64+
/** @brief Symbol specifying analog input to be observed by SAADC channel 1 in the nrfx_saadc examples. */
65+
#define SAADC_CH1_AIN NRFX_ANALOG_EXTERNAL_AIN2
66+
/** @brief Symbol specifying analog input to be observed by SAADC channel 2 in the nrfx_saadc examples. */
67+
#define SAADC_CH2_AIN NRFX_ANALOG_EXTERNAL_AIN4
68+
69+
/** @brief Symbol specifying GPIO pin connected to SAADC channel 0 in the nrfx_saadc examples. */
70+
#define SAADC_CH0_LOOPBACK_PIN LOOPBACK_PIN_1B
71+
/** @brief Symbol specifying GPIO pin connected to SAADC channel 1 in the nrfx_saadc examples. */
72+
#define SAADC_CH1_LOOPBACK_PIN LOOPBACK_PIN_2B
73+
/** @brief Symbol specifying GPIO pin connected to SAADC channel 2 in the nrfx_saadc examples. */
74+
#define SAADC_CH2_LOOPBACK_PIN LOOPBACK_PIN_3B
75+
76+
/* NRFX_SPIM */
77+
/** @brief Symbol specifying SPIM instance to be used in nrfx_spim examples. */
78+
#define SPIM_INST_IDX 1
79+
80+
/* NRFX_SPIM_SPIS */
81+
/** @brief Symbol specifying SPIM instance to be used in nrfx_spim_spis examples. */
82+
#define SPIM_SPIS_SPIM_INST_IDX 1
83+
/** @brief Symbol specifying SPIS instance to be used in nrfx_spim_spis examples. */
84+
#define SPIM_SPIS_SPIS_INST_IDX 2
85+
86+
/** @brief Symbol specifying master's pin number for MOSI in nrfx_spim_spis examples. */
87+
#define SPIM_SPIS_MOSI_PIN_MASTER LOOPBACK_PIN_1A
88+
/** @brief Symbol specifying slave's pin number for MOSI in nrfx_spim_spis examples. */
89+
#define SPIM_SPIS_MOSI_PIN_SLAVE LOOPBACK_PIN_1B
90+
/** @brief Symbol specifying master's pin number for MISO in nrfx_spim_spis examples. */
91+
#define SPIM_SPIS_MISO_PIN_MASTER LOOPBACK_PIN_2A
92+
/** @brief Symbol specifying slave's pin number for MISO in nrfx_spim_spis examples. */
93+
#define SPIM_SPIS_MISO_PIN_SLAVE LOOPBACK_PIN_2B
94+
/** @brief Symbol specifying master's pin number for SCK in nrfx_spim_spis examples. */
95+
#define SPIM_SPIS_SCK_PIN_MASTER LOOPBACK_PIN_3A
96+
/** @brief Symbol specifying slave's pin number for SCK in nrfx_spim_spis examples. */
97+
#define SPIM_SPIS_SCK_PIN_SLAVE LOOPBACK_PIN_3B
98+
/** @brief Symbol specifying master's pin number for SS in nrfx_spim_spis examples. */
99+
#define SPIM_SPIS_SS_PIN_MASTER LOOPBACK_PIN_4A
100+
/** @brief Symbol specifying slave's pin number for CSN in nrfx_spim_spis examples. */
101+
#define SPIM_SPIS_CSN_PIN_SLAVE LOOPBACK_PIN_4B
102+
103+
/* NRFX_TIMER */
104+
/** @brief Symbol specifying timer instance to be used in nrfx_timer/timer example. */
105+
#define TIMER_INST_IDX 0
106+
107+
/** @brief Symbol specifying timer instance to be used in timer mode (T) in nrfx_timer/counter example. */
108+
#define TIMER_T_INST_IDX 0
109+
/** @brief Symbol specifying timer instance to be used in counter mode (C) in nrfx_timer/counter example. */
110+
#define TIMER_C_INST_IDX 1
111+
112+
/* NRFX_TWIM_TWIS */
113+
/** @brief Symbol specifying TWIM instance to be used in nrfx_twim_twis examples. */
114+
#define TWIM_INST_IDX 0
115+
/** @brief Symbol specifying TWIS instance to be used in nrfx_twim_twis examples. */
116+
#define TWIS_INST_IDX 1
117+
118+
/** @brief Symbol specifying pin number of master SCL to be used in nrfx_twim_twis examples. */
119+
#define TWIM_TWIS_MASTER_SCL_PIN LOOPBACK_PIN_1A
120+
/** @brief Symbol specifying pin number of slave SCL to be used in nrfx_twim_twis examples. */
121+
#define TWIM_TWIS_SLAVE_SCL_PIN LOOPBACK_PIN_1B
122+
/** @brief Symbol specifying pin number of master SDA to be used in nrfx_twim_twis examples. */
123+
#define TWIM_TWIS_MASTER_SDA_PIN LOOPBACK_PIN_2A
124+
/** @brief Symbol specifying pin number of slave SDA to be used in nrfx_twim_twis examples. */
125+
#define TWIM_TWIS_SLAVE_SDA_PIN LOOPBACK_PIN_2B
126+
127+
/* NRFX_UARTE */
128+
/** @brief Symbol specifying UARTE instance to be used in nrfx_uarte examples. */
129+
#define UARTE_INST_IDX 1
130+
131+
/** @brief Symbol specifying TX pin number of UARTE to be used in nrfx_uarte examples. */
132+
#define UARTE_TX_PIN LOOPBACK_PIN_1A
133+
/** @brief Symbol specifying RX pin number of UARTE to be used in nrfx_uarte examples. */
134+
#define UARTE_RX_PIN LOOPBACK_PIN_1B
135+
136+
#endif // NRF52840DK_NRF52840_CONFIG_H__

0 commit comments

Comments
 (0)