nrfxlib API 0.1.0
Loading...
Searching...
No Matches
mpsl_fem_protocol_api.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
20#ifndef MPSL_FEM_PROTOCOL_API_H__
21#define MPSL_FEM_PROTOCOL_API_H__
22
23#include <stdint.h>
24#include <stdbool.h>
25
26#include <nrf.h>
27#include <nrf_peripherals.h>
28#include "nrf_errno.h"
29#include "mpsl_tx_power.h"
30#include "mpsl_fem_types.h"
31
33typedef enum
34{
35 MPSL_FEM_PA = 1 << 0,
36 MPSL_FEM_LNA = 1 << 1,
39
41typedef enum
42{
46
61#ifdef PPI_PRESENT
62typedef uint32_t mpsl_subscribable_hw_event_t;
63#else
65#endif
66
68typedef struct
69{
73 union
74 {
76 struct
77 {
82 NRF_TIMER_Type * p_timer_instance;
83
85 struct
86 {
88 uint32_t start;
90 uint32_t end;
92 } counter_period;
93
97 } timer;
98
100 struct
101 {
109 } generic;
110 } event;
111
112#if defined(NRF52_SERIES)
114 bool override_ppi;
116 uint8_t ppi_ch_id;
117#endif
119
121typedef struct
122{
125
129
136#define MPSL_FEM_CAPS_FLAG_PA_SETUP_REQUIRED (1U << 0)
137
144#define MPSL_FEM_CAPS_FLAG_LNA_SETUP_REQUIRED (1U << 1)
145
147typedef struct
148{
154 uint32_t flags;
156
162
173
188int32_t mpsl_fem_disable(void);
189
236int32_t mpsl_fem_pa_configuration_set(const mpsl_fem_event_t * const p_activate_event,
237 const mpsl_fem_event_t * const p_deactivate_event);
238
245
292int32_t mpsl_fem_lna_configuration_set(const mpsl_fem_event_t * const p_activate_event,
293 const mpsl_fem_event_t * const p_deactivate_event);
294
301
311
323
333int32_t mpsl_fem_abort_extend(uint32_t channel_to_add, uint32_t group);
334
344int32_t mpsl_fem_abort_reduce(uint32_t channel_to_remove, uint32_t group);
345
353
362
382 mpsl_tx_power_split_t * const p_tx_power_split,
383 uint16_t freq_mhz,
384 bool tx_power_ceiling);
385
410
417void mpsl_fem_lna_is_configured(int8_t * const p_gain);
418
436bool mpsl_fem_prepare_powerdown(NRF_TIMER_Type * p_instance,
437 uint32_t compare_channel,
438 uint32_t ppi_id,
439 uint32_t event_addr);
440
448
449#endif // MPSL_FEM_PROTOCOL_API_H__
450
uint8_t mpsl_fem_pa_power_control_t
Definition: mpsl_fem_types.h:33
void mpsl_fem_enable(void)
Enable Front End Module.
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)
Sets up PA using the provided events for the upcoming radio transmission.
int32_t mpsl_fem_abort_extend(uint32_t channel_to_add, uint32_t group)
Adds one more PPI channel to the PPI Group prepared by the mpsl_fem_abort_set function.
int32_t mpsl_fem_abort_clear(void)
Clears up the configuration provided by the mpsl_fem_abort_set function.
uint8_t mpsl_subscribable_hw_event_t
Type representing a multiple-subscribable hardware event.
Definition: mpsl_fem_protocol_api.h:64
int8_t mpsl_fem_tx_power_split(const mpsl_tx_power_t power, mpsl_tx_power_split_t *const p_tx_power_split, uint16_t freq_mhz, bool tx_power_ceiling)
Splits transmit power value into components to be applied on each stage on transmit path.
mpsl_fem_event_type_t
PA and LNA activation event types.
Definition: mpsl_fem_protocol_api.h:42
@ MPSL_FEM_EVENT_TYPE_GENERIC
Definition: mpsl_fem_protocol_api.h:44
@ MPSL_FEM_EVENT_TYPE_TIMER
Definition: mpsl_fem_protocol_api.h:43
int32_t mpsl_fem_pa_power_control_set(mpsl_fem_pa_power_control_t pa_power_control)
Sets the PA power control.
void mpsl_fem_utils_available_cc_channels_cache(uint8_t mask)
Caches the CC channels to be used by FEM.
void mpsl_fem_caps_get(mpsl_fem_caps_t *p_caps)
Gets the capabilities of the FEM in use.
bool mpsl_fem_prepare_powerdown(NRF_TIMER_Type *p_instance, uint32_t compare_channel, uint32_t ppi_id, uint32_t event_addr)
Prepares the Front End Module to switch to the Power Down state.
int32_t mpsl_fem_abort_set(mpsl_subscribable_hw_event_t event, uint32_t group)
Instruct Front End Module to disable PA and LNA as soon as possible using the group following the eve...
mpsl_fem_functionality_t
PA and LNA functionality types.
Definition: mpsl_fem_protocol_api.h:34
@ MPSL_FEM_PA
Definition: mpsl_fem_protocol_api.h:35
@ MPSL_FEM_ALL
Definition: mpsl_fem_protocol_api.h:37
@ MPSL_FEM_LNA
Definition: mpsl_fem_protocol_api.h:36
int32_t mpsl_fem_lna_configuration_clear(void)
Clears up the configuration provided by the mpsl_fem_lna_configuration_set function.
void mpsl_fem_deactivate_now(mpsl_fem_functionality_t type)
Deactivates PA/LNA with immediate effect.
void mpsl_fem_lna_is_configured(int8_t *const p_gain)
Returns LNA gain if the LNA signal is configured and enabled, 0 otherwise.
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)
Sets up LNA using the provided event for the upcoming radio reception.
int32_t mpsl_fem_pa_configuration_clear(void)
Clears up the configuration provided by the mpsl_fem_pa_configuration_set function.
int32_t mpsl_fem_disable(void)
Disable Front End Module.
int32_t mpsl_fem_abort_reduce(uint32_t channel_to_remove, uint32_t group)
Removes one PPI channel from the PPI Group prepared by the mpsl_fem_abort_set function.
void mpsl_fem_cleanup(void)
Cleans up the configured PA/LNA hardware resources.
int8_t mpsl_tx_power_t
Definition: mpsl_tx_power.h:45
uint32_t flags
Definition: mpsl_fem_protocol_api.h:154
Structure representing capabilities and characteristics of the FEM in use.
Definition: mpsl_fem_protocol_api.h:148
uint8_t compare_channel_mask
Definition: mpsl_fem_protocol_api.h:95
mpsl_subscribable_hw_event_t event
Definition: mpsl_fem_protocol_api.h:107
NRF_TIMER_Type * p_timer_instance
Definition: mpsl_fem_protocol_api.h:82
mpsl_fem_event_type_t type
Definition: mpsl_fem_protocol_api.h:71
uint32_t end
Definition: mpsl_fem_protocol_api.h:90
uint32_t start
Definition: mpsl_fem_protocol_api.h:88
MPSL Front End Module event.
Definition: mpsl_fem_protocol_api.h:69
mpsl_tx_power_t radio_tx_power
Definition: mpsl_fem_protocol_api.h:124
mpsl_fem_pa_power_control_t fem_pa_power_control
Definition: mpsl_fem_protocol_api.h:127
Represents components of tx_power to be applied for stages on transmit path.
Definition: mpsl_fem_protocol_api.h:122