nrfxlib API 3.3.99
Loading...
Searching...
No Matches

◆ mpsl_init()

int32_t mpsl_init ( mpsl_clock_lfclk_cfg_t const * p_clock_config,
IRQn_Type low_prio_irq,
mpsl_assert_handler_t p_assert_handler )

#include <mpsl/include/mpsl.h>

MPSL initialization.

Parameters
[in]p_clock_configClock configuration. If NULL the LF clock will be configured as an RC source with rc_ctiv = MPSL_RECOMMENDED_RC_CTIV, .rc_temp_ctiv = MPSL_RECOMMENDED_RC_TEMP_CTIV, and .accuracy_ppm = MPSL_DEFAULT_CLOCK_ACCURACY_PPM. The parameter is not used when external clock driver is registered mpsl_clock_ctrl_source_register().
[in]low_prio_irqIRQ to pend when low priority processing should be executed. The application shall call mpsl_low_priority_process after this IRQ has occurred.
[in]p_assert_handlerPointer to MPSL assert handler.
Note
If CONFIG_SYSTEM_CLOCK_NO_WAIT is set to 0, never modify the SEVONPEND flag in the SCR register, while this function is executing. Doing so might lead to a deadlock.
For nRF54h SoC series the function always waits for LFCLK to be ready. The LFCLK is handled by system controller so response must arrive from other domain. That shall be done in non-blocking context. To do not change requirements for other MPSL APIs delayed wait for LFCLK is not allowed for the nRF54h SoC series.
If only Front End Module functionality is needed, Initialization API of MPSL FEM can be called instead.
Return values
0MPSL is successfully initialized.
-NRF_EPERMMPSL is already initialized.
-NRF_EINVALInvalid parameters supplied.