nrfxlib API 3.3.99
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 <nrfx.h>
27#include "nrf_errno.h"
28#include "mpsl_tx_power.h"
29#include "mpsl_fem_types.h"
30
38
44
51
56typedef uint8_t mpsl_fem_event_type_t;
57
72#ifdef PPI_PRESENT
73typedef uint32_t mpsl_subscribable_hw_event_t;
74#else
76#endif
77
79typedef struct
80{
84 union
85 {
87 struct
88 {
93 NRF_TIMER_Type * p_timer_instance;
94
96 struct
97 {
99 uint32_t start;
101 uint32_t end;
103 } counter_period;
104
108 } timer;
109
111 struct
112 {
120 } generic;
121 } event;
122
123#if defined(NRF52_SERIES)
125 bool override_ppi;
127 uint8_t ppi_ch_id;
128#endif
130
140
147#define MPSL_FEM_CAPS_FLAG_PA_SETUP_REQUIRED (1U << 0)
148
155#define MPSL_FEM_CAPS_FLAG_LNA_SETUP_REQUIRED (1U << 1)
156
158typedef struct
159{
165 uint32_t flags;
167
173
184
199int32_t mpsl_fem_disable(void);
200
247int32_t mpsl_fem_pa_configuration_set(const mpsl_fem_event_t * const p_activate_event,
248 const mpsl_fem_event_t * const p_deactivate_event);
249
256
303int32_t mpsl_fem_lna_configuration_set(const mpsl_fem_event_t * const p_activate_event,
304 const mpsl_fem_event_t * const p_deactivate_event);
305
312
322
334
344int32_t mpsl_fem_abort_extend(uint32_t channel_to_add, uint32_t group);
345
355int32_t mpsl_fem_abort_reduce(uint32_t channel_to_remove, uint32_t group);
356
364
373
394 mpsl_tx_power_split_t * const p_tx_power_split,
395 mpsl_phy_t phy,
396 uint16_t freq_mhz,
397 bool tx_power_ceiling);
398
423
430void mpsl_fem_lna_is_configured(int8_t * const p_gain);
431
439
440#endif // MPSL_FEM_PROTOCOL_API_H__
441
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.
MPSL_FEM_FUNCTIONALITY
Applicable values for mpsl_fem_functionality_t type.
Definition mpsl_fem_protocol_api.h:33
@ MPSL_FEM_PA
Definition mpsl_fem_protocol_api.h:34
@ MPSL_FEM_ALL
Definition mpsl_fem_protocol_api.h:36
@ MPSL_FEM_LNA
Definition mpsl_fem_protocol_api.h:35
MPSL_FEM_EVENT_TYPE
Applicable values for mpsl_fem_event_type_t type.
Definition mpsl_fem_protocol_api.h:47
@ MPSL_FEM_EVENT_TYPE_GENERIC
Definition mpsl_fem_protocol_api.h:49
@ MPSL_FEM_EVENT_TYPE_TIMER
Definition mpsl_fem_protocol_api.h:48
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:75
uint8_t mpsl_fem_functionality_t
PA and LNA functionality types.
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.
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...
uint8_t mpsl_fem_event_type_t
PA and LNA activation event type.
Definition mpsl_fem_protocol_api.h:56
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.
int8_t mpsl_fem_tx_power_split(const mpsl_tx_power_t power, mpsl_tx_power_split_t *const p_tx_power_split, mpsl_phy_t phy, uint16_t freq_mhz, bool tx_power_ceiling)
Splits transmit power value into components to be applied on each stage on transmit path.
void mpsl_fem_cleanup(void)
Cleans up the configured PA/LNA hardware resources.
int8_t mpsl_tx_power_t
Definition mpsl_tx_power.h:58
uint8_t mpsl_phy_t
PHY type.
Definition mpsl_tx_power.h:55
uint32_t flags
Definition mpsl_fem_protocol_api.h:165
Structure representing capabilities and characteristics of the FEM in use.
Definition mpsl_fem_protocol_api.h:159
uint8_t compare_channel_mask
Definition mpsl_fem_protocol_api.h:106
mpsl_subscribable_hw_event_t event
Definition mpsl_fem_protocol_api.h:118
NRF_TIMER_Type * p_timer_instance
Definition mpsl_fem_protocol_api.h:93
mpsl_fem_event_type_t type
Definition mpsl_fem_protocol_api.h:82
uint32_t end
Definition mpsl_fem_protocol_api.h:101
uint32_t start
Definition mpsl_fem_protocol_api.h:99
MPSL Front End Module event.
Definition mpsl_fem_protocol_api.h:80
mpsl_tx_power_t radio_tx_power
Definition mpsl_fem_protocol_api.h:135
mpsl_fem_pa_power_control_t fem_pa_power_control
Definition mpsl_fem_protocol_api.h:138
Represents components of tx_power to be applied for stages on transmit path.
Definition mpsl_fem_protocol_api.h:133