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

◆ mpsl_fem_lna_configuration_set()

int32_t mpsl_fem_lna_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 LNA using the provided event for the upcoming radio reception.

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

The order of calls of this function and its pa 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 LNA 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 LNA will be configured to activate or deactivate when an event occurs.

The function sets up the PPIs and the GPIOTE channel to activate LNA for the upcoming radio transmission. The LNA 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 LNA, 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
0LNA activation setup is successful.
-NRF_EPERMLNA is currently disabled.
-NRF_EINVALLNA activation setup could not be performed due to invalid or missing configuration parameters in p_activate_event or p_deactivate_event, or both.