nrfxlib API 2.7.99
Loading...
Searching...
No Matches

◆ mpsl_fem_pa_configuration_set()

int32_t mpsl_fem_pa_configuration_set ( const mpsl_fem_event_t *const  p_activate_event,
const mpsl_fem_event_t *const  p_deactivate_event 
)

#include <mpsl/fem/include/protocol/mpsl_fem_protocol_api.h>

Sets up PA using the provided events for the upcoming radio transmission.

Multiple configurations can be provided by repeating calls to this function (that is, you can set the activate and the deactivate events in multiple calls, and the configuration is preserved between calls).

The order of calls of this function and its lna counterpart must match the order of radio operations. I.e. if you want to listen first and then send the frame, you need first to issue mpsl_fem_lna_configuration_set and only after mpsl_fem_pa_configuration_set.

If a MPSL_FEM_EVENT_TYPE_TIMER timer event is provided, the PA will be configured to activate or deactivate at the application-configured time gap before the timer instance reaches the given register_value. The time gap is set via the corresponding configuration setter of the selected Front End Module.

If a MPSL_FEM_EVENT_TYPE_GENERIC event is provided, the PA will be configured to activate or deactivate when an event occurs.

The function sets up the PPIs and the GPIOTE channel to activate PA for the upcoming radio transmission. The PA pin will be active until deactivated, which can happen either by encountering a configured deactivation event or by using mpsl_fem_deactivate_now.

Parameters
[in]p_activate_eventPointer to the activation event structure.
[in]p_deactivate_eventPointer to the deactivation event structure.
Precondition
To activate PA, the corresponding configuration setter of the selected Front End Module must have been called first.
Note
If a timer event is provided, the caller of this function is responsible for starting the timer and configuring its shorts. Moreover, the caller is responsible for stopping the timer no earlier than the compare channel of the lowest ID among the provided ones does expire.
The activation event can be only of type MPSL_FEM_EVENT_TYPE_TIMER. Using other activation event type leads to undefined module behavior.
Return values
0PA activation setup is successful.
-NRF_EPERMPA is currently disabled.
-NRF_EINVALPA activation setup could not be performed due to invalid or missing configuration parameters in p_activate_event or p_deactivate_event, or both.