Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nrf_802154: introduce NRF_802154_CCAIDLE_TO_TXEN_EXTRA_TIME_US #1633

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions nrf_802154/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@
add_library(nrf-802154-driver-interface INTERFACE)
add_library(nrf-802154-serialization-interface INTERFACE)

if (CONFIG_NRF_802154_RADIO_DRIVER OR CONFIG_NRF_802154_SERIALIZATION)
target_compile_definitions(zephyr-802154-interface
INTERFACE
NRF_802154_CCAIDLE_TO_TXEN_EXTRA_TIME_US=${CONFIG_NRF_802154_CCAIDLE_TO_TXEN_EXTRA_TIME_US}
)
endif()

add_subdirectory(common)

add_subdirectory(driver)
Expand Down
17 changes: 17 additions & 0 deletions nrf_802154/common/include/nrf_802154_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,23 @@ extern "C" {
#define NRF_802154_CCA_CORR_LIMIT_DEFAULT 0x02
#endif

/**
* @def NRF_802154_CCAIDLE_TO_TXEN_EXTRA_TIME_US
*
* Additional time in microseconds that delays triggering of @c TXEN after the
* @c CCAIDLE event occurred. Default value for most use-cases is @c 0,
* In this scenario, the short between the @c CCAIDLE event and the
* @c TXEN task is used. If this value is non-zero, the short is not used.
* The triggering of @c TXEN occurs through (D)PPI and TIMER.
* A non-zero value may be necessary to ensure enough switching time for
* use with some Front-End Modules.
*
* This option is supported for the nRF53 Series and the nRF54L Series only.
*/
#ifndef NRF_802154_CCAIDLE_TO_TXEN_EXTRA_TIME_US
#define NRF_802154_CCAIDLE_TO_TXEN_EXTRA_TIME_US 0U
#endif

/**
* @def NRF_802154_INTERNAL_RADIO_IRQ_HANDLING
*
Expand Down
10 changes: 10 additions & 0 deletions nrf_802154/doc/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ See also :ref:`nrf_802154_limitations` for permanent limitations.
Main branch - nRF 802.15.4 Radio Driver
***************************************

Added
=====

* For the nRF54L Series, added the :c:macro:`NRF_802154_CCAIDLE_TO_TXEN_EXTRA_TIME_US` configuration macro that allows to extend the time between the CCAIDLE event and the trigger of the TXEN task. (KRKNWK-19819)

Bug fixes
=========

* Fixed the constant describing the time between CCAIDLE and READY events. The constant is used for calculation of the time needed for a transmission using CCA for the nRF54L Series. (KRKNWK-19819)

Removed
=======

Expand Down
26 changes: 18 additions & 8 deletions nrf_802154/driver/src/nrf_802154_peripherals.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,46 +224,54 @@ extern "C" {
* of an interrupt by the RADIO.EVENTS_SYNC event.
*
*/
#define NRF_802154_EGU_SYNC_CHANNEL_NO 3
#define NRF_802154_EGU_SYNC_CHANNEL_NO 3

/**
* @def NRF_802154_EGU_SYNC_USED_CHANNELS_MASK
*
* Mask of EGU channels used by the interrupt generation from the RADIO.EVENTS_SYNC event.
* See @ref NRF_802154_EGU_USED_CHANNELS_MASK.
*/
#define NRF_802154_EGU_SYNC_USED_CHANNELS_MASK (1U << NRF_802154_EGU_SYNC_CHANNEL_NO)
#define NRF_802154_EGU_SYNC_USED_CHANNELS_MASK (1U << NRF_802154_EGU_SYNC_CHANNEL_NO)

/**
* @def NRF_802154_EGU_RAMP_UP_CHANNEL_NO
*
* The channel number of the @ref NRF_802154_EGU_INSTANCE used for triggering the ramp-up of the RADIO.
*/
#define NRF_802154_EGU_RAMP_UP_CHANNEL_NO 15
#define NRF_802154_EGU_RAMP_UP_CHANNEL_NO 15

/**
* @def NRF_802154_EGU_RAMP_UP_USED_CHANNELS_MASK
*
* Mask of EGU channels used for triggering the ramp-up of the RADIO.
* See @ref NRF_802154_EGU_USED_CHANNELS_MASK.
*/
#define NRF_802154_EGU_RAMP_UP_USED_CHANNELS_MASK (1U << NRF_802154_EGU_RAMP_UP_CHANNEL_NO)
#define NRF_802154_EGU_RAMP_UP_USED_CHANNELS_MASK (1U << NRF_802154_EGU_RAMP_UP_CHANNEL_NO)

/**
* @def NRF_802154_EGU_RAMP_UP_EVENT
*
* The EGU event used by the driver to trigger radio ramp-up.
*/
#define NRF_802154_EGU_RAMP_UP_EVENT NRFX_CONCAT_2(NRF_EGU_EVENT_TRIGGERED, \
NRF_802154_EGU_RAMP_UP_CHANNEL_NO)
#define NRF_802154_EGU_RAMP_UP_EVENT NRFX_CONCAT_2(NRF_EGU_EVENT_TRIGGERED, \
NRF_802154_EGU_RAMP_UP_CHANNEL_NO)

/**
* @def NRF_802154_EGU_RAMP_UP_TASK
*
* The EGU task used by the driver to trigger radio ramp-up.
*/
#define NRF_802154_EGU_RAMP_UP_TASK NRFX_CONCAT_2(NRF_EGU_TASK_TRIGGER, \
NRF_802154_EGU_RAMP_UP_CHANNEL_NO)
#define NRF_802154_EGU_RAMP_UP_TASK NRFX_CONCAT_2(NRF_EGU_TASK_TRIGGER, \
NRF_802154_EGU_RAMP_UP_CHANNEL_NO)

#ifndef NRF_802154_EGU_TIMER_START_USED_CHANNELS_MASK
#define NRF_802154_EGU_TIMER_START_USED_CHANNELS_MASK 0U
#endif

#ifndef NRF_802154_EGU_TIMER_START2_USED_CHANNELS_MASK
#define NRF_802154_EGU_TIMER_START2_USED_CHANNELS_MASK 0U
#endif

/**
* @def NRF_802154_EGU_USED_CHANNELS_MASK
Expand All @@ -276,6 +284,8 @@ extern "C" {
NRF_802154_EGU_REQUEST_USED_CHANNELS_MASK | \
NRF_802154_EGU_SYNC_USED_CHANNELS_MASK | \
NRF_802154_EGU_RAMP_UP_USED_CHANNELS_MASK | \
NRF_802154_EGU_TIMER_START_USED_CHANNELS_MASK | \
NRF_802154_EGU_TIMER_START2_USED_CHANNELS_MASK | \
NRF_802154_SL_EGU_USED_CHANNELS_MASK)

#ifdef __cplusplus
Expand Down
21 changes: 2 additions & 19 deletions nrf_802154/driver/src/nrf_802154_peripherals_nrf52.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,28 +152,13 @@ extern "C" {
#define NRF_802154_PPI_EGU_TO_TIMER_START 8U
#endif

/**
* @def NRF_802154_PPI_RADIO_CRCERROR_TO_TIMER_CLEAR
*
* The PPI channel that connects RADIO_CRCERROR event to TIMER_CLEAR task.
*
* @note This option is used by the core module regardless of the driver configuration.
* The peripheral is shared with @ref NRF_802154_PPI_RADIO_CCAIDLE_TO_FEM_GPIOTE
* and @ref NRF_802154_PPI_TIMER_COMPARE_TO_RADIO_TXEN.
*
*/
#ifndef NRF_802154_PPI_RADIO_CRCERROR_TO_TIMER_CLEAR
#define NRF_802154_PPI_RADIO_CRCERROR_TO_TIMER_CLEAR 9U
#endif

/**
* @def NRF_802154_PPI_RADIO_CCAIDLE_TO_FEM_GPIOTE
*
* The PPI channel that connects RADIO_CCAIDLE event to the GPIOTE tasks used by the Frontend.
*
* @note This option is used by the core module regardless of the driver configuration.
* The peripheral is shared with @ref NRF_802154_PPI_RADIO_CRCERROR_TO_TIMER_CLEAR
* and @ref NRF_802154_PPI_TIMER_COMPARE_TO_RADIO_TXEN.
* The peripheral is shared with @ref NRF_802154_PPI_TIMER_COMPARE_TO_RADIO_TXEN.
*
*/
#ifndef NRF_802154_PPI_RADIO_CCAIDLE_TO_FEM_GPIOTE
Expand All @@ -186,8 +171,7 @@ extern "C" {
* The PPI channel that connects TIMER_COMPARE event to RADIO_TXEN task.
*
* @note This option is used by the core module regardless of the driver configuration.
* The peripheral is shared with @ref NRF_802154_PPI_RADIO_CRCERROR_TO_TIMER_CLEAR
* and @ref NRF_802154_PPI_RADIO_CCAIDLE_TO_FEM_GPIOTE.
* The peripheral is shared with @ref NRF_802154_PPI_RADIO_CCAIDLE_TO_FEM_GPIOTE.
*
*/
#ifndef NRF_802154_PPI_TIMER_COMPARE_TO_RADIO_TXEN
Expand Down Expand Up @@ -262,7 +246,6 @@ extern "C" {
(1 << NRF_802154_PPI_RADIO_RAMP_UP_TRIGG) | \
(1 << NRF_802154_PPI_EGU_TO_RADIO_RAMP_UP) | \
(1 << NRF_802154_PPI_EGU_TO_TIMER_START) | \
(1 << NRF_802154_PPI_RADIO_CRCERROR_TO_TIMER_CLEAR) | \
(1 << NRF_802154_PPI_RADIO_CCAIDLE_TO_FEM_GPIOTE) | \
(1 << NRF_802154_PPI_TIMER_COMPARE_TO_RADIO_TXEN) | \
(1 << NRF_802154_PPI_RADIO_CCABUSY_TO_RADIO_CCASTART) | \
Expand Down
62 changes: 62 additions & 0 deletions nrf_802154/driver/src/nrf_802154_peripherals_nrf53.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,32 @@ extern "C" {
#define NRF_802154_EGU_USED_MASK (1 << NRF_802154_EGU_INSTANCE_NO)
#endif

#if (NRF_802154_CCAIDLE_TO_TXEN_EXTRA_TIME_US != 0) || defined(__DOXYGEN__)

/**
* @def NRF_802154_EGU_TIMER_START_CHANNEL_NO
*
* The channel number of the @ref NRF_802154_EGU_INSTANCE used for starting the TIMER.
* Used only when @ref NRF_802154_CCAIDLE_TO_TXEN_EXTRA_TIME_US is non-zero.
*/
#define NRF_802154_EGU_TIMER_START_CHANNEL_NO 14

#define NRF_802154_EGU_TIMER_START_USED_CHANNELS_MASK \
(1U << NRF_802154_EGU_TIMER_START_CHANNEL_NO)

/**
* @def NRF_802154_EGU_TIMER_START2_CHANNEL_NO
*
* The channel number of the @ref NRF_802154_EGU_INSTANCE used for starting the TIMER (second source).
* Used only when @ref NRF_802154_CCAIDLE_TO_TXEN_EXTRA_TIME_US is non-zero.
*/
#define NRF_802154_EGU_TIMER_START2_CHANNEL_NO 13

#define NRF_802154_EGU_TIMER_START2_USED_CHANNELS_MASK \
(1U << NRF_802154_EGU_TIMER_START2_CHANNEL_NO)

#endif /* (NRF_802154_CCAIDLE_TO_TXEN_EXTRA_TIME_US != 0) || defined(__DOXYGEN__) */

/**
* @def NRF_802154_RTC_INSTANCE_NO
*
Expand Down Expand Up @@ -206,6 +232,40 @@ extern "C" {
#define NRF_802154_DPPI_RADIO_SYNC_TO_EGU_SYNC 12U
#endif

#if (NRF_802154_CCAIDLE_TO_TXEN_EXTRA_TIME_US != 0) || defined(__DOXYGEN__)
/**
* @def NRF_802154_DPPI_TIMER_START
*
* The DPPI channel that is used to trigger TIMER's START task.
* Used only when @ref NRF_802154_CCAIDLE_TO_TXEN_EXTRA_TIME_US is non-zero.
*
*/
#ifndef NRF_802154_DPPI_TIMER_START
#define NRF_802154_DPPI_TIMER_START 16U
#endif

/**
* @def NRF_802154_DPPI_RADIO_TXEN
*
* The DPPI channel that is used to trigger RADIO's TXEN task
* in the scenario where short CCAIDLE_TXEN is not used.
* Used only when @ref NRF_802154_CCAIDLE_TO_TXEN_EXTRA_TIME_US is non-zero.
*
*/
#ifndef NRF_802154_DPPI_RADIO_TXEN
#define NRF_802154_DPPI_RADIO_TXEN 17U
#endif

#define NRF_802154_DPPI_TIMER_START_MASK (1U << NRF_802154_DPPI_TIMER_START)
#define NRF_802154_DPPI_RADIO_TXEN_MASK (1U << NRF_802154_DPPI_RADIO_TXEN)

#else

#define NRF_802154_DPPI_TIMER_START_MASK 0U
#define NRF_802154_DPPI_RADIO_TXEN_MASK 0U

#endif /* (NRF_802154_CCAIDLE_TO_TXEN_EXTRA_TIME_US != 0) || defined(__DOXYGEN__) */

/**
* @def NRF_802154_DPPI_RADIO_CCAIDLE
*
Expand Down Expand Up @@ -255,6 +315,8 @@ extern "C" {
(1UL << NRF_802154_DPPI_EGU_TO_RADIO_RAMP_UP) | \
(1UL << NRF_802154_DPPI_TIMER_COMPARE_TO_RADIO_TXEN) | \
(1UL << NRF_802154_DPPI_RADIO_SYNC_TO_EGU_SYNC) | \
(NRF_802154_DPPI_TIMER_START_MASK) | \
(NRF_802154_DPPI_RADIO_TXEN_MASK) | \
(1UL << NRF_802154_DPPI_RADIO_CCAIDLE) | \
(1UL << NRF_802154_DPPI_RADIO_CCABUSY) | \
(1UL << NRF_802154_DPPI_RADIO_HW_TRIGGER) | \
Expand Down
65 changes: 64 additions & 1 deletion nrf_802154/driver/src/nrf_802154_peripherals_nrf54l.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,32 @@ extern "C" {
#define NRF_802154_EGU_USED_MASK (1 << NRF_802154_EGU_INSTANCE_NO)
#endif

#if (NRF_802154_CCAIDLE_TO_TXEN_EXTRA_TIME_US != 0) || defined(__DOXYGEN__)

/**
* @def NRF_802154_EGU_TIMER_START_CHANNEL_NO
*
* The channel number of the @ref NRF_802154_EGU_INSTANCE used for starting the TIMER.
* Used only when @ref NRF_802154_CCAIDLE_TO_TXEN_EXTRA_TIME_US is non-zero.
*/
#define NRF_802154_EGU_TIMER_START_CHANNEL_NO 14

#define NRF_802154_EGU_TIMER_START_USED_CHANNELS_MASK \
(1U << NRF_802154_EGU_TIMER_START_CHANNEL_NO)

/**
* @def NRF_802154_EGU_TIMER_START2_CHANNEL_NO
*
* The channel number of the @ref NRF_802154_EGU_INSTANCE used for starting the TIMER (second source).
* Used only when @ref NRF_802154_CCAIDLE_TO_TXEN_EXTRA_TIME_US is non-zero.
*/
#define NRF_802154_EGU_TIMER_START2_CHANNEL_NO 13

#define NRF_802154_EGU_TIMER_START2_USED_CHANNELS_MASK \
(1U << NRF_802154_EGU_TIMER_START2_CHANNEL_NO)

#endif /* (NRF_802154_CCAIDLE_TO_TXEN_EXTRA_TIME_US != 0) || defined(__DOXYGEN__) */

/**
* @def NRF_802154_CCM_INSTANCE_NO
*
Expand All @@ -108,7 +134,8 @@ extern "C" {
* @note This option is used when @ref NRF_802154_ENCRYPTION_ENABLED is set.
*
*/
#define NRF_802154_CCM_INSTANCE NRFX_CONCAT_2(NRF_CCM, NRF_802154_CCM_INSTANCE_NO)
#define NRF_802154_CCM_INSTANCE NRFX_CONCAT_2(NRF_CCM, \
NRF_802154_CCM_INSTANCE_NO)

/**
* @def NRF_802154_RTC_INSTANCE_NO
Expand Down Expand Up @@ -233,6 +260,40 @@ extern "C" {
#define NRF_802154_DPPI_RADIO_SYNC_TO_EGU_SYNC 22U
#endif

#if (NRF_802154_CCAIDLE_TO_TXEN_EXTRA_TIME_US != 0) || defined(__DOXYGEN__)
/**
* @def NRF_802154_DPPI_TIMER_START
*
* The DPPI channel that is used to trigger TIMER's START task.
* Used only when @ref NRF_802154_CCAIDLE_TO_TXEN_EXTRA_TIME_US is non-zero.
*
*/
#ifndef NRF_802154_DPPI_TIMER_START
#define NRF_802154_DPPI_TIMER_START 21U
#endif

/**
* @def NRF_802154_DPPI_RADIO_TXEN
*
* The DPPI channel that is used to trigger RADIO's TXEN task
* in the scenario where short CCAIDLE_TXEN is not used.
* Used only when @ref NRF_802154_CCAIDLE_TO_TXEN_EXTRA_TIME_US is non-zero.
*
*/
#ifndef NRF_802154_DPPI_RADIO_TXEN
#define NRF_802154_DPPI_RADIO_TXEN 20U
#endif

#define NRF_802154_DPPI_TIMER_START_MASK (1U << NRF_802154_DPPI_TIMER_START)
#define NRF_802154_DPPI_RADIO_TXEN_MASK (1U << NRF_802154_DPPI_RADIO_TXEN)

#else

#define NRF_802154_DPPI_TIMER_START_MASK 0U
#define NRF_802154_DPPI_RADIO_TXEN_MASK 0U

#endif /* (NRF_802154_CCAIDLE_TO_TXEN_EXTRA_TIME_US != 0) || defined(__DOXYGEN__) */

/**
* @def NRF_802154_DPPI_RADIO_CCAIDLE
*
Expand Down Expand Up @@ -275,6 +336,8 @@ extern "C" {
(1UL << NRF_802154_DPPI_EGU_TO_RADIO_RAMP_UP) | \
(1UL << NRF_802154_DPPI_TIMER_COMPARE_TO_RADIO_TXEN) | \
(1UL << NRF_802154_DPPI_RADIO_SYNC_TO_EGU_SYNC) | \
(NRF_802154_DPPI_TIMER_START_MASK) | \
(NRF_802154_DPPI_RADIO_TXEN_MASK) | \
(1UL << NRF_802154_DPPI_RADIO_CCAIDLE) | \
(1UL << NRF_802154_DPPI_RADIO_CCABUSY) | \
(1UL << NRF_802154_DPPI_RADIO_HW_TRIGGER) | \
Expand Down
9 changes: 8 additions & 1 deletion nrf_802154/driver/src/nrf_802154_procedures_duration.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,14 @@
#define RX_RAMP_UP_TIME 40 // us
#define RX_RAMP_DOWN_TIME 0 // us
#define MAX_RAMP_DOWN_TIME 6 // us
#define RX_TX_TURNAROUND_TIME 20 // us
#if defined(NRF54L_SERIES)
#define RX_TX_TURNAROUND_TIME_HW 15 // us
#else
#define RX_TX_TURNAROUND_TIME_HW 20 // us
#endif

#define RX_TX_TURNAROUND_TIME (RX_TX_TURNAROUND_TIME_HW + \
NRF_802154_CCAIDLE_TO_TXEN_EXTRA_TIME_US)

#define A_CCA_DURATION_SYMBOLS 8 // sym
#define A_TURNAROUND_TIME_SYMBOLS 12 // sym
Expand Down
Loading
Loading