nrfxlib API 2.8.99
Loading...
Searching...
No Matches

◆ mpsl_fem_power_model_set()

int32_t mpsl_fem_power_model_set ( const mpsl_fem_power_model_t * p_model)

#include <mpsl/fem/include/mpsl_fem_power_model.h>

Sets Front-End Module power model.

This function sets up the control flow for handling the power model.

If nRF21540 Front-End Module is used, the value returned by mpsl_fem_nrf21540_power_model_builtin_get can be used as p_model. In that case, the built-in model provided by MPSL is used and the application is responsible for triggering the model's recalculation through mpsl_fem_nrf21540_power_model_builtin_update. If the model is not updated as external conditions change, it will output inaccurate data.

In all other cases, if p_model is not NULL, custom model provided by the application is used. In that case, the application is responsible for maintaining the model out of scope of MPSL. Calling mpsl_fem_nrf21540_power_model_builtin_update is then pointless.

If p_model equal NULL is passed to the function, the call is treated as a request to not use any model.

Note
This function must be called before mpsl_fem_nrf21540_gpio_spi_interface_config_set, mpsl_fem_nrf21540_gpio_interface_config_set or mpsl_fem_simple_gpio_interface_config_set, depending on which one is called to select appropriate Front-End Module driver.
Parameters
[in]p_modelPointer to the model to be used by MPSL.
Return values
-NRF_EINVALProvided pointer is invalid.
0The model has been initialized successfully.