Skip to content

Commit 9b3b433

Browse files
committed
mpsl: align to nrfx 4.0
MDK should not be included directly, but via nrfx.h Signed-off-by: Marcin Szymczyk <[email protected]>
1 parent 9e4f84a commit 9b3b433

File tree

4 files changed

+37
-29
lines changed

4 files changed

+37
-29
lines changed

mpsl/include/mpsl.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ extern "C" {
2222

2323
#include <stdint.h>
2424
#include <stdbool.h>
25-
#include "nrf.h"
26-
#include "nrf_peripherals.h"
25+
#include "nrfx.h"
2726
#include "nrf_errno.h"
2827
#include "mpsl_clock.h"
2928
#include "mpsl_hwres.h"

mpsl/include/mpsl_clock.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ extern "C" {
2323

2424
#include <stdint.h>
2525
#include <stdbool.h>
26-
#include "nrf.h"
27-
#include "nrf_errno.h"
26+
#include "nrfx.h"
2827
#if !defined (NRF54H_SERIES) && !defined (NRF92_SERIES)
2928
#include "hal/nrf_clock.h"
3029
#endif /* !NRF54H20_XXAA && !NRF92H20_XXAA */

mpsl/include/mpsl_hwres.h

Lines changed: 34 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,45 +22,56 @@
2222

2323
#include <stdbool.h>
2424
#include <stdint.h>
25-
#include "nrf.h"
26-
#include "nrf_peripherals.h"
2725

2826
#ifdef __cplusplus
2927
extern "C" {
3028
#endif
3129

3230
/* Reserved (D)PPI, PPIB and IPCT resources for the supported platforms. */
31+
/* This corresponds to the PPI channels 19, 30, and 31. */
32+
#define MPSL_NRF52_PPI_CHANNELS_USED_MASK (0xc0080000)
33+
/* This corresponds to the DPPI channels 0, 1, and 2. */
34+
#define MPSL_NRF53_DPPIC_CHANNELS_USED_MASK (0x00000007)
35+
#define MPSL_NRF54L_DPPIC10_CHANNELS_USED_MASK (0x00000001)
36+
#define MPSL_NRF54L_DPPIC20_CHANNELS_USED_MASK (0x00000001)
37+
#define MPSL_NRF54L_PPIB11_CHANNELS_USED_MASK (0x00000001)
38+
#define MPSL_NRF54L_PPIB21_CHANNELS_USED_MASK (0x00000001)
39+
#define MPSL_NRF54H_DPPIC020_CHANNELS_USED_MASK (0x00000001)
40+
#define MPSL_NRF54H_IPCT130_CHANNELS_USED_MASK (0x00000001)
41+
42+
#if !defined(__ZEPHYR__)
43+
#include "nrfx.h"
44+
3345
#if defined(NRF52_SERIES)
34-
#define MPSL_RESERVED_PPI_CHANNELS ((1UL << 19) | (1UL << 30) | (1UL << 31))
35-
/* This corresponds to the PPI channels 19, 30, and 31. */
36-
#define MPSL_PPI_CHANNELS_USED_MASK (0xc0080000)
46+
#define MPSL_RESERVED_PPI_CHANNELS ((1UL << 19) | (1UL << 30) | (1UL << 31))
47+
#define MPSL_PPI_CHANNELS_USED_MASK MPSL_NRF52_PPI_CHANNELS_USED_MASK
3748
#elif defined(NRF53_SERIES)
38-
#define MPSL_RESERVED_PPI_CHANNELS ((1UL << 0) | (1UL << 1) | (1UL << 2))
39-
/* This corresponds to the DPPI channels 0, 1, and 2. */
40-
#define MPSL_DPPIC_CHANNELS_USED_MASK (0x00000007)
41-
#elif defined(LUMOS_XXAA)
42-
#define MPSL_RESERVED_PPI_CHANNELS (1UL << 0)
43-
#define MPSL_DPPIC10_CHANNELS_USED_MASK (0x00000001)
44-
#define MPSL_DPPIC20_CHANNELS_USED_MASK (0x00000001)
45-
#define MPSL_PPIB11_CHANNELS_USED_MASK (0x00000001)
46-
#define MPSL_PPIB21_CHANNELS_USED_MASK (0x00000001)
49+
#define MPSL_RESERVED_PPI_CHANNELS ((1UL << 0) | (1UL << 1) | (1UL << 2))
50+
#define MPSL_DPPIC_CHANNELS_USED_MASK MPSL_NRF53_DPPIC_CHANNELS_USED_MASK
51+
#elif defined(NRF54L_SERIES)
52+
#define MPSL_RESERVED_PPI_CHANNELS (1UL << 0)
53+
#define MPSL_DPPIC10_CHANNELS_USED_MASK MPSL_NRF54L_DPPIC10_CHANNELS_USED_MASK
54+
#define MPSL_DPPIC20_CHANNELS_USED_MASK MPSL_NRF54L_DPPIC20_CHANNELS_USED_MASK
55+
#define MPSL_PPIB11_CHANNELS_USED_MASK MPSL_NRF54L_PPIB11_CHANNELS_USED_MASK
56+
#define MPSL_PPIB21_CHANNELS_USED_MASK MPSL_NRF54L_PPIB21_CHANNELS_USED_MASK
4757
#elif defined(NRF54H_SERIES) || defined(GRTC_PRESENT)
48-
#define MPSL_RESERVED_PPI_CHANNELS (1UL << 0)
49-
#define MPSL_DPPIC020_CHANNELS_USED_MASK (0x00000001)
50-
#define MPSL_IPCT130_CHANNELS_USED_MASK (0x00000001)
58+
#define MPSL_RESERVED_PPI_CHANNELS (1UL << 0)
59+
#define MPSL_DPPIC020_CHANNELS_USED_MASK MPSL_NRF54H_DPPIC020_CHANNELS_USED_MASK
60+
#define MPSL_IPCT130_CHANNELS_USED_MASK MPSL_NRF54H_IPCT130_CHANNELS_USED_MASK
5161
#else
52-
#error Unknown NRF series.
62+
#error Unknown NRF series.
5363
#endif
5464

5565
/* Defines which timer is being used by the MPSL implementation */
5666
#if defined(NRF52_SERIES)
57-
#define MPSL_TIMER0 NRF_TIMER0
67+
#define MPSL_TIMER0 NRF_TIMER0
5868
#elif defined(NRF53_SERIES)
59-
#define MPSL_TIMER0 NRF_TIMER0_NS
60-
#elif defined(LUMOS_XXAA)
61-
#define MPSL_TIMER0 NRF_TIMER10
69+
#define MPSL_TIMER0 NRF_TIMER0_NS
70+
#elif defined(NRF54L_SERIES)
71+
#define MPSL_TIMER0 NRF_TIMER10
6272
#else
63-
#define MPSL_TIMER0 NRF_TIMER020
73+
#define MPSL_TIMER0 NRF_TIMER020
74+
#endif
6475
#endif
6576

6677
#if defined(DPPI_PRESENT) || defined(DOXYGEN)

mpsl/include/mpsl_timeslot.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ extern "C" {
2525
#endif
2626

2727
#include <stdint.h>
28-
#include "nrf.h"
29-
#include "nrf_peripherals.h"
28+
#include "nrfx.h"
3029
#include "nrf_errno.h"
3130

3231
/** @brief The shortest allowed timeslot event in microseconds. */

0 commit comments

Comments
 (0)