Multiprotocol Service Layer library control
Methods in the Multiprotocol Service Layer (MPSL) library control library allow controlling the initialization and uninitialization of the Multiprotocol Service Layer library and all required interrupt handlers.
When MPSL is uninitialized, the application has full control over the
CONFIG_MPSL_DYNAMIC_INTERRUPTS Kconfig option enables dynamic interrupts for MPSL, and allows interrupts to be reconfigured.
- group mpsl_lib
Methods for initializing MPSL and required interrupt handlers.
Initialize MPSL and attach interrupt handlers.
This routine initializes MPSL (via
mpsl_init) after it has been uninitialized via mpsl_lib_uninit, and attaches all required interrupt handlers.
After successful execution of this method, any existing interrupt handlers will be detached from RADIO_IRQn, RTC0_IRQn, and TIMER0_IRQn.
- Return values
0 – MPSL enabled successfully.
-NRF_EPERM – Operation is not supported or MPSL is already initialized.
-NRF_EINVAL – Invalid parameters supplied to MPSL.
This method requires CONFIG_MPSL_DYNAMIC_INTERRUPTS to be enabled and MPSL to have been previously uninitialized via mpsl_lib_uninit.
Uninitialize MPSL and disable interrupt handlers.
This routine uninitializes MPSL (via
mpsl_uninit) and disables MPSL interrupts. Uninitializing MPSL stops clocks and scheduler. This will release all peripherals and reduce power usage, allowing the user to override any interrupt handlers used by MPSL.
After successful execution of this method, user-supplied interrupt handlers can be attached to RADIO_IRQn, RTC0_IRQn, and TIMER0_IRQn using
irq_connect_dynamic. Care must be taken when developing these handlers, as they will be executed as direct dynamic interrupts. See
ARM_IRQ_DIRECT_DYNAMIC_CONNECTfor additional documentation. These interrupts will trigger thread re-scheduling upon return.
- Return values
0 – MPSL disabled successfully.
-NRF_EPERM – Operation is not supported.
This method requires CONFIG_MPSL_DYNAMIC_INTERRUPTS to be enabled.
- int32_t mpsl_lib_init(void)