mirror of
https://github.com/espressif/openthread.git
synced 2026-09-02 23:30:07 +00:00
[nrf528xx] change used FEM implementation from simple_gpio to three_pin_gpio (#4387)
This commit is contained in:
committed by
Jonathan Hui
parent
f7555a54f3
commit
3244d7a644
@@ -53,7 +53,7 @@ COMMONCPPFLAGS
|
||||
-I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio \
|
||||
-I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/hal \
|
||||
-I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/mac_features \
|
||||
-I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/fem/simple_gpio \
|
||||
-I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/fem/three_pin_gpio \
|
||||
-I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator \
|
||||
-I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/rsch \
|
||||
-I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/rsch/raal \
|
||||
|
||||
@@ -52,7 +52,7 @@ COMMONCPPFLAGS
|
||||
-I$(top_srcdir)/third_party/NordicSemiconductor/drivers/clock \
|
||||
-I$(top_srcdir)/third_party/NordicSemiconductor/drivers/common \
|
||||
-I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio \
|
||||
-I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/fem/simple_gpio \
|
||||
-I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/fem/three_pin_gpio \
|
||||
-I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/hal \
|
||||
-I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/mac_features \
|
||||
-I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator \
|
||||
|
||||
@@ -52,7 +52,7 @@ COMMONCPPFLAGS
|
||||
-I$(top_srcdir)/third_party/NordicSemiconductor/drivers/clock \
|
||||
-I$(top_srcdir)/third_party/NordicSemiconductor/drivers/common \
|
||||
-I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio \
|
||||
-I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/fem/simple_gpio \
|
||||
-I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/fem/three_pin_gpio \
|
||||
-I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/hal \
|
||||
-I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/mac_features \
|
||||
-I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator \
|
||||
|
||||
@@ -45,20 +45,31 @@
|
||||
|
||||
void PlatformFemSetConfigParams(const PlatformFemConfigParams *aConfig)
|
||||
{
|
||||
nrf_802154_fem_control_cfg_t cfg;
|
||||
nrf_fem_interface_config_t cfg;
|
||||
|
||||
memset(&cfg, 0, sizeof(cfg));
|
||||
|
||||
cfg.pa_cfg.enable = aConfig->mPaCfg.mEnable;
|
||||
cfg.pa_cfg.active_high = aConfig->mPaCfg.mActiveHigh;
|
||||
cfg.pa_cfg.gpio_pin = aConfig->mPaCfg.mGpioPin;
|
||||
cfg.lna_cfg.enable = aConfig->mLnaCfg.mEnable;
|
||||
cfg.lna_cfg.active_high = aConfig->mLnaCfg.mActiveHigh;
|
||||
cfg.lna_cfg.gpio_pin = aConfig->mLnaCfg.mGpioPin;
|
||||
cfg.ppi_ch_id_clr = aConfig->mPpiChIdClr;
|
||||
cfg.ppi_ch_id_set = aConfig->mPpiChIdSet;
|
||||
cfg.pa_gpiote_ch_id = aConfig->mGpiotePaChId;
|
||||
cfg.lna_gpiote_ch_id = aConfig->mGpioteLnaChId;
|
||||
cfg.fem_config.pa_time_gap_us = aConfig->mFemPhyCfg.mPaTimeGapUs;
|
||||
cfg.fem_config.lna_time_gap_us = aConfig->mFemPhyCfg.mLnaTimeGapUs;
|
||||
cfg.fem_config.pdn_settle_us = aConfig->mFemPhyCfg.mPdnSettleUs;
|
||||
cfg.fem_config.trx_hold_us = aConfig->mFemPhyCfg.mTrxHoldUs;
|
||||
cfg.fem_config.pa_gain_db = aConfig->mFemPhyCfg.mPaGainDb;
|
||||
cfg.fem_config.lna_gain_db = aConfig->mFemPhyCfg.mLnaGainDb;
|
||||
cfg.pa_pin_config.enable = aConfig->mPaCfg.mEnable;
|
||||
cfg.pa_pin_config.active_high = aConfig->mPaCfg.mActiveHigh;
|
||||
cfg.pa_pin_config.gpio_pin = aConfig->mPaCfg.mGpioPin;
|
||||
cfg.pa_pin_config.gpiote_ch_id = aConfig->mPaCfg.mGpioteChId;
|
||||
cfg.lna_pin_config.enable = aConfig->mLnaCfg.mEnable;
|
||||
cfg.lna_pin_config.active_high = aConfig->mLnaCfg.mActiveHigh;
|
||||
cfg.lna_pin_config.gpio_pin = aConfig->mLnaCfg.mGpioPin;
|
||||
cfg.lna_pin_config.gpiote_ch_id = aConfig->mLnaCfg.mGpioteChId;
|
||||
cfg.pdn_pin_config.enable = aConfig->mPdnCfg.mEnable;
|
||||
cfg.pdn_pin_config.active_high = aConfig->mPdnCfg.mActiveHigh;
|
||||
cfg.pdn_pin_config.gpio_pin = aConfig->mPdnCfg.mGpioPin;
|
||||
cfg.pdn_pin_config.gpiote_ch_id = aConfig->mPdnCfg.mGpioteChId;
|
||||
cfg.ppi_ch_id_clr = aConfig->mPpiChIdClr;
|
||||
cfg.ppi_ch_id_set = aConfig->mPpiChIdSet;
|
||||
cfg.ppi_ch_id_pdn = aConfig->mPpiChIdPdn;
|
||||
|
||||
nrf_802154_fem_control_cfg_set(&cfg);
|
||||
nrf_fem_interface_configuration_set(&cfg);
|
||||
}
|
||||
|
||||
@@ -39,37 +39,83 @@
|
||||
|
||||
// clang-format off
|
||||
|
||||
/**
|
||||
* @brief Configuration parameters for the Front End Module.
|
||||
*/
|
||||
#define PLATFORM_FEM_DEFAULT_PA_PIN 26 /**< Default Power Amplifier pin. */
|
||||
#define PLATFORM_FEM_DEFAULT_LNA_PIN 27 /**< Default Low Noise Amplifier pin. */
|
||||
#define PLATFORM_FEM_DEFAULT_PDN_PIN 28 /**< Default Power Down pin. */
|
||||
#define PLATFORM_FEM_DEFAULT_SET_PPI_CHANNEL 15 /**< Default PPI channel for pin setting. */
|
||||
#define PLATFORM_FEM_DEFAULT_CLR_PPI_CHANNEL 16 /**< Default PPI channel for pin clearing. */
|
||||
#define PLATFORM_FEM_DEFAULT_PDN_PPI_CHANNEL 14 /**< Default PPI channel for Power Down control. */
|
||||
#define PLATFORM_FEM_DEFAULT_TIMER_MATCH_PPI_GROUP 4 /**< Default PPI channel group used to disable timer match PPI. */
|
||||
#define PLATFORM_FEM_DEFAULT_RADIO_DISABLED_PPI_GROUP 5 /**< Default PPI channel group used to disable radio disabled PPI. */
|
||||
#define PLATFORM_FEM_DEFAULT_LNA_GPIOTE_CHANNEL 6 /**< Default LNA GPIOTE channel for FEM control. */
|
||||
#define PLATFORM_FEM_DEFAULT_PA_GPIOTE_CHANNEL 7 /**< Default PA GPIOTE channel for FEM control. */
|
||||
#define PLATFORM_FEM_DEFAULT_PA_GPIOTE_CHANNEL 6 /**< Default PA GPIOTE channel for FEM control. */
|
||||
#define PLATFORM_FEM_DEFAULT_LNA_GPIOTE_CHANNEL 7 /**< Default LNA GPIOTE channel for FEM control. */
|
||||
#define PLATFORM_FEM_DEFAULT_PDN_GPIOTE_CHANNEL 5 /**< Default PDN GPIOTE channel for FEM control. */
|
||||
|
||||
/**
|
||||
* @brief Configuration parameters for the Front End Module timings and gain.
|
||||
*/
|
||||
#define PLATFORM_FEM_PA_TIME_IN_ADVANCE_US 13 /**< Default time in microseconds when PA GPIO is activated before the radio is ready for transmission. */
|
||||
#define PLATFORM_FEM_LNA_TIME_IN_ADVANCE_US 13 /**< Default time in microseconds when LNA GPIO is activated before the radio is ready for reception. */
|
||||
#define PLATFORM_FEM_PDN_SETTLE_US 18 /**< Default the time between activating the PDN and asserting the RX_EN/TX_EN. */
|
||||
#define PLATFORM_FEM_TRX_HOLD_US 5 /**< Default the time between deasserting the RX_EN/TX_EN and deactivating PDN. */
|
||||
#define PLATFORM_FEM_PA_GAIN_DB 0 /**< Default PA gain. Ignored if the amplifier is not supporting this feature. */
|
||||
#define PLATFORM_FEM_LNA_GAIN_DB 0 /**< Default LNA gain. Ignored if the amplifier is not supporting this feature. */
|
||||
|
||||
// clang-format on
|
||||
|
||||
#define PLATFORM_FEM_DEFAULT_CONFIG \
|
||||
((PlatformFemConfigParams){ \
|
||||
.mPaCfg = \
|
||||
{ \
|
||||
.mEnable = 1, \
|
||||
.mActiveHigh = 1, \
|
||||
.mGpioPin = PLATFORM_FEM_DEFAULT_PA_PIN, \
|
||||
}, \
|
||||
.mLnaCfg = \
|
||||
{ \
|
||||
.mEnable = 1, \
|
||||
.mActiveHigh = 1, \
|
||||
.mGpioPin = PLATFORM_FEM_DEFAULT_LNA_PIN, \
|
||||
}, \
|
||||
.mPpiChIdClr = PLATFORM_FEM_DEFAULT_CLR_PPI_CHANNEL, \
|
||||
.mPpiChIdSet = PLATFORM_FEM_DEFAULT_SET_PPI_CHANNEL, \
|
||||
.mGpiotePaChId = PLATFORM_FEM_DEFAULT_PA_GPIOTE_CHANNEL, \
|
||||
.mGpioteLnaChId = PLATFORM_FEM_DEFAULT_LNA_GPIOTE_CHANNEL, \
|
||||
#define PLATFORM_FEM_DEFAULT_CONFIG \
|
||||
((PlatformFemConfigParams){ \
|
||||
.mFemPhyCfg = \
|
||||
{ \
|
||||
.mPaTimeGapUs = PLATFORM_FEM_PA_TIME_IN_ADVANCE_US, \
|
||||
.mLnaTimeGapUs = PLATFORM_FEM_LNA_TIME_IN_ADVANCE_US, \
|
||||
.mPdnSettleUs = PLATFORM_FEM_PDN_SETTLE_US, \
|
||||
.mTrxHoldUs = PLATFORM_FEM_TRX_HOLD_US, \
|
||||
.mPaGainDb = PLATFORM_FEM_PA_GAIN_DB, \
|
||||
.mLnaGainDb = PLATFORM_FEM_LNA_GAIN_DB, \
|
||||
}, \
|
||||
.mPaCfg = \
|
||||
{ \
|
||||
.mEnable = 1, \
|
||||
.mActiveHigh = 1, \
|
||||
.mGpioPin = PLATFORM_FEM_DEFAULT_PA_PIN, \
|
||||
.mGpioteChId = PLATFORM_FEM_DEFAULT_PA_GPIOTE_CHANNEL, \
|
||||
}, \
|
||||
.mLnaCfg = \
|
||||
{ \
|
||||
.mEnable = 1, \
|
||||
.mActiveHigh = 1, \
|
||||
.mGpioPin = PLATFORM_FEM_DEFAULT_LNA_PIN, \
|
||||
.mGpioteChId = PLATFORM_FEM_DEFAULT_LNA_GPIOTE_CHANNEL, \
|
||||
}, \
|
||||
.mPdnCfg = \
|
||||
{ \
|
||||
.mEnable = 1, \
|
||||
.mActiveHigh = 1, \
|
||||
.mGpioPin = PLATFORM_FEM_DEFAULT_PDN_PIN, \
|
||||
.mGpioteChId = PLATFORM_FEM_DEFAULT_PDN_GPIOTE_CHANNEL, \
|
||||
}, \
|
||||
.mPpiChIdClr = PLATFORM_FEM_DEFAULT_CLR_PPI_CHANNEL, \
|
||||
.mPpiChIdSet = PLATFORM_FEM_DEFAULT_SET_PPI_CHANNEL, \
|
||||
.mPpiChIdPdn = PLATFORM_FEM_DEFAULT_PDN_PPI_CHANNEL, \
|
||||
})
|
||||
|
||||
/**
|
||||
* @brief Configuration parameters for FEM PHY.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t mPaTimeGapUs;
|
||||
uint32_t mLnaTimeGapUs;
|
||||
uint32_t mPdnSettleUs;
|
||||
uint32_t mTrxHoldUs;
|
||||
uint8_t mPaGainDb;
|
||||
uint8_t mLnaGainDb;
|
||||
} PlatformFemPhyConfig;
|
||||
|
||||
/**
|
||||
* @brief Configuration parameters for the PA and LNA.
|
||||
*/
|
||||
@@ -78,7 +124,8 @@ typedef struct
|
||||
uint8_t mEnable : 1; /**< Enable toggling for this amplifier */
|
||||
uint8_t mActiveHigh : 1; /**< Set the pin to be active high */
|
||||
uint8_t mGpioPin : 6; /**< The GPIO pin to toggle for this amplifier */
|
||||
} PlatformFemConfigPaLna;
|
||||
uint8_t mGpioteChId; /**< The GPIOTE Channel ID used for toggling pins */
|
||||
} PlatformFemPinConfig;
|
||||
|
||||
/**
|
||||
* @brief PA & LNA GPIO toggle configuration
|
||||
@@ -94,12 +141,13 @@ typedef struct
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
PlatformFemConfigPaLna mPaCfg; /**< Power Amplifier configuration */
|
||||
PlatformFemConfigPaLna mLnaCfg; /**< Low Noise Amplifier configuration */
|
||||
uint8_t mPpiChIdSet; /**< PPI channel used for radio pin setting */
|
||||
uint8_t mPpiChIdClr; /**< PPI channel used for radio pin clearing */
|
||||
uint8_t mGpiotePaChId; /**< GPIOTE channel used for radio PA pin toggling */
|
||||
uint8_t mGpioteLnaChId; /**< GPIOTE channel used for radio LNA pin toggling */
|
||||
PlatformFemPhyConfig mFemPhyCfg; /**< Front End Module Physical layer configuration */
|
||||
PlatformFemPinConfig mPaCfg; /**< Power Amplifier configuration */
|
||||
PlatformFemPinConfig mLnaCfg; /**< Low Noise Amplifier configuration */
|
||||
PlatformFemPinConfig mPdnCfg; /**< Power Down configuration */
|
||||
uint8_t mPpiChIdSet; /**< PPI channel to be used for setting pins */
|
||||
uint8_t mPpiChIdClr; /**< PPI channel to be used for clearing pins */
|
||||
uint8_t mPpiChIdPdn; /**< PPI channel to handle PDN pin */
|
||||
} PlatformFemConfigParams;
|
||||
|
||||
/**
|
||||
|
||||
+2
-2
@@ -68,7 +68,7 @@ COMMONCPPFLAGS
|
||||
-I$(top_srcdir)/third_party/NordicSemiconductor/drivers/common \
|
||||
-I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio \
|
||||
-I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/fem \
|
||||
-I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/fem/simple_gpio \
|
||||
-I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/fem/three_pin_gpio \
|
||||
-I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/hal \
|
||||
-I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/rsch \
|
||||
-I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/rsch/raal \
|
||||
@@ -171,7 +171,7 @@ RADIO_DRIVER_SOURCES
|
||||
drivers/radio/mac_features/nrf_802154_filter.c \
|
||||
drivers/radio/mac_features/nrf_802154_frame_parser.c \
|
||||
drivers/radio/mac_features/nrf_802154_precise_ack_timeout.c \
|
||||
drivers/radio/fem/simple_gpio/nrf_fem_simple_gpio.c \
|
||||
drivers/radio/fem/three_pin_gpio/nrf_fem_three_pin_gpio.c \
|
||||
drivers/radio/nrf_802154_core_hooks.c \
|
||||
drivers/radio/nrf_802154_core.c \
|
||||
drivers/radio/nrf_802154_critical_section.c \
|
||||
|
||||
Reference in New Issue
Block a user