Bluetooth: Controller: Remove redudant header file includes
Remove redundant header file includes, introduce radio used resources header file. Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
parent
019f88ec21
commit
cfcbe5d68e
@ -4,7 +4,6 @@
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include <stdint.h>
|
||||
|
||||
void cntr_init(void);
|
||||
uint32_t cntr_start(void);
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include "common/assert.h"
|
||||
#include "common/assert.h"
|
||||
|
||||
#ifdef CONFIG_BT_CTLR_ASSERT_HANDLER
|
||||
void bt_ctlr_assert_handle(char *file, uint32_t line);
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "hal/ccm.h"
|
||||
#include "hal/radio.h"
|
||||
|
||||
@ -5,8 +5,6 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <zephyr/sys/dlist.h>
|
||||
|
||||
#include <hal/nrf_rtc.h>
|
||||
|
||||
#include "hal/cntr.h"
|
||||
|
||||
@ -7,8 +7,6 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <zephyr/sys/dlist.h>
|
||||
|
||||
#include <hal/nrf_ecb.h>
|
||||
|
||||
#include "util/mem.h"
|
||||
|
||||
@ -3,6 +3,8 @@
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include "../radio/radio_nrf5_resources.h"
|
||||
#include "../radio/radio_nrf5_fem.h"
|
||||
|
||||
#ifdef DPPI_PRESENT
|
||||
|
||||
@ -5,13 +5,13 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <zephyr/sys/dlist.h>
|
||||
#include <zephyr/toolchain.h>
|
||||
#include <zephyr/dt-bindings/gpio/gpio.h>
|
||||
#include <soc.h>
|
||||
|
||||
#include <hal/nrf_rtc.h>
|
||||
#include <hal/nrf_timer.h>
|
||||
#include <hal/nrf_radio.h>
|
||||
#include <hal/nrf_ccm.h>
|
||||
#include <hal/nrf_aar.h>
|
||||
|
||||
|
||||
@ -5,38 +5,16 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <hal/nrf_radio.h>
|
||||
|
||||
/* Common radio resources */
|
||||
#include "radio_nrf5_resources.h"
|
||||
|
||||
/* Helpers for radio timing conversions */
|
||||
#define HAL_RADIO_NS2US_CEIL(ns) ((ns + 999)/1000)
|
||||
#define HAL_RADIO_NS2US_ROUND(ns) ((ns + 500)/1000)
|
||||
|
||||
/* Use the timer instance ID, not NRF_TIMERx directly, so that it can be checked
|
||||
* in radio_nrf5_ppi.h by the preprocessor.
|
||||
*/
|
||||
#define EVENT_TIMER_ID 0
|
||||
#define EVENT_TIMER _CONCAT(NRF_TIMER, EVENT_TIMER_ID)
|
||||
|
||||
/* Wrapper for EVENTS_END event generated by Radio peripheral at the very end of the transmission
|
||||
* or reception of a PDU on air. In case of regular PDU it is generated when last bit of CRC is
|
||||
* received or transmitted.
|
||||
*/
|
||||
#define NRF_RADIO_TXRX_END_EVENT EVENTS_END
|
||||
/* Wrapper for RADIO_SHORTS mask connecting EVENTS_END to EVENTS_DISABLE.
|
||||
* This is a default shortcut used to automatically disable Radio after end of PDU.
|
||||
*/
|
||||
#define NRF_RADIO_SHORTS_PDU_END_DISABLE RADIO_SHORTS_END_DISABLE_Msk
|
||||
|
||||
/* Delay of EVENTS_PHYEND event on receive PDU without CTE inclded when CTEINLINE is enabled */
|
||||
#define RADIO_EVENTS_PHYEND_DELAY_US 16
|
||||
|
||||
/* Delay of CCM TASKS_CRYPT start in number of bits for Radio Bit counter */
|
||||
#define CCM_TASKS_CRYPT_DELAY_BITS 3
|
||||
|
||||
/* EVENTS_TIMER capture register used for sampling TIMER time-stamps. */
|
||||
#define HAL_EVENT_TIMER_SAMPLE_CC_OFFSET 3
|
||||
#define HAL_EVENT_TIMER_SAMPLE_TASK NRF_TIMER_TASK_CAPTURE3
|
||||
|
||||
/* Define to reset PPI registration */
|
||||
#define NRF_PPI_NONE 0
|
||||
|
||||
/* SoC specific defines */
|
||||
#if defined(CONFIG_SOC_SERIES_BSIM_NRFXX)
|
||||
#include "radio_sim_nrfxx.h"
|
||||
#elif defined(CONFIG_SOC_SERIES_NRF51X)
|
||||
@ -54,7 +32,6 @@
|
||||
#elif defined(CONFIG_SOC_NRF52833)
|
||||
#include "radio_nrf52833.h"
|
||||
#elif defined(CONFIG_SOC_NRF52840)
|
||||
#include <nrf52_erratas.h>
|
||||
#include "radio_nrf52840.h"
|
||||
#elif defined(CONFIG_SOC_NRF5340_CPUNET)
|
||||
#include <hal/nrf_vreqctrl.h>
|
||||
@ -63,20 +40,23 @@
|
||||
#error "Unsupported SoC."
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_SOC_SERIES_NRF51X)
|
||||
#define HAL_RADIO_PDU_LEN_MAX (BIT(5) - 1)
|
||||
#else
|
||||
#define HAL_RADIO_PDU_LEN_MAX (BIT(8) - 1)
|
||||
#endif
|
||||
|
||||
#include <nrf_peripherals.h>
|
||||
/* Define to reset PPI registration */
|
||||
#define NRF_PPI_NONE 0
|
||||
|
||||
/* This has to come before the ppi/dppi includes below. */
|
||||
#include "radio_nrf5_fem.h"
|
||||
|
||||
#if defined(PPI_PRESENT)
|
||||
#include <hal/nrf_ppi.h>
|
||||
#include "radio_nrf5_ppi_resources.h"
|
||||
#include "radio_nrf5_ppi.h"
|
||||
#elif defined(DPPI_PRESENT)
|
||||
#include <hal/nrf_timer.h>
|
||||
#include <hal/nrf_rtc.h>
|
||||
#include <hal/nrf_aar.h>
|
||||
#include <hal/nrf_ccm.h>
|
||||
#include <hal/nrf_dppi.h>
|
||||
#include "radio_nrf5_dppi_resources.h"
|
||||
#include "radio_nrf5_dppi.h"
|
||||
#else
|
||||
#error "PPI or DPPI abstractions missing."
|
||||
@ -84,6 +64,13 @@
|
||||
|
||||
#include "radio_nrf5_txp.h"
|
||||
|
||||
/* SoC specific Radio PDU length field maximum value */
|
||||
#if defined(CONFIG_SOC_SERIES_NRF51X)
|
||||
#define HAL_RADIO_PDU_LEN_MAX (BIT(5) - 1)
|
||||
#else
|
||||
#define HAL_RADIO_PDU_LEN_MAX (BIT(8) - 1)
|
||||
#endif
|
||||
|
||||
/* Common NRF_RADIO power-on reset value. Refer to Product Specification,
|
||||
* RADIO Registers section for the documented reset values.
|
||||
*
|
||||
|
||||
@ -5,11 +5,6 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#if !defined(CONFIG_BT_CTLR_TIFS_HW)
|
||||
#define SW_SWITCH_TIMER NRF_TIMER1
|
||||
#define SW_SWITCH_TIMER_EVTS_COMP_BASE 0
|
||||
#endif /* !CONFIG_BT_CTLR_TIFS_HW */
|
||||
|
||||
/* TXEN->TXIDLE + TXIDLE->TX in microseconds. */
|
||||
#define HAL_RADIO_NRF51_TXEN_TXIDLE_TX_US 140
|
||||
#define HAL_RADIO_NRF51_TXEN_TXIDLE_TX_NS 140000
|
||||
|
||||
@ -179,19 +179,6 @@
|
||||
#endif /* !CONFIG_BT_CTLR_TIFS_HW */
|
||||
#endif /* !CONFIG_BT_CTLR_RADIO_ENABLE_FAST */
|
||||
|
||||
#if !defined(CONFIG_BT_CTLR_TIFS_HW)
|
||||
#if defined(CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER)
|
||||
#undef EVENT_TIMER_ID
|
||||
#define EVENT_TIMER_ID 4
|
||||
#define SW_SWITCH_TIMER EVENT_TIMER
|
||||
#define SW_SWITCH_TIMER_EVTS_COMP_BASE 4
|
||||
#else /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */
|
||||
#define SW_SWITCH_TIMER NRF_TIMER1
|
||||
#define SW_SWITCH_TIMER_EVTS_COMP_BASE 0
|
||||
#endif /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */
|
||||
|
||||
#endif /* !CONFIG_BT_CTLR_TIFS_HW */
|
||||
|
||||
static inline void hal_radio_reset(void)
|
||||
{
|
||||
/* TODO: Add any required setup for each radio event
|
||||
|
||||
@ -181,18 +181,6 @@
|
||||
#endif /* !CONFIG_BT_CTLR_TIFS_HW */
|
||||
#endif /* !CONFIG_BT_CTLR_RADIO_ENABLE_FAST */
|
||||
|
||||
#if !defined(CONFIG_BT_CTLR_TIFS_HW)
|
||||
#if defined(CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER)
|
||||
#undef EVENT_TIMER_ID
|
||||
#define EVENT_TIMER_ID 4
|
||||
#define SW_SWITCH_TIMER EVENT_TIMER
|
||||
#define SW_SWITCH_TIMER_EVTS_COMP_BASE 4
|
||||
#else /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */
|
||||
#define SW_SWITCH_TIMER NRF_TIMER1
|
||||
#define SW_SWITCH_TIMER_EVTS_COMP_BASE 0
|
||||
#endif /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */
|
||||
#endif /* !CONFIG_BT_CTLR_TIFS_HW */
|
||||
|
||||
static inline void hal_radio_reset(void)
|
||||
{
|
||||
/* nRF52810 itself is not affected with these anomalies but it might be
|
||||
|
||||
@ -336,57 +336,6 @@
|
||||
#endif /* !CONFIG_BT_CTLR_TIFS_HW */
|
||||
#endif /* !CONFIG_BT_CTLR_RADIO_ENABLE_FAST */
|
||||
|
||||
#if !defined(CONFIG_BT_CTLR_TIFS_HW)
|
||||
#if defined(CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER)
|
||||
#undef EVENT_TIMER_ID
|
||||
#define EVENT_TIMER_ID 4
|
||||
#define SW_SWITCH_TIMER EVENT_TIMER
|
||||
#define SW_SWITCH_TIMER_EVTS_COMP_BASE 3
|
||||
#define SW_SWITCH_TIMER_EVTS_COMP_S2_BASE 5
|
||||
#undef HAL_EVENT_TIMER_SAMPLE_CC_OFFSET
|
||||
#define HAL_EVENT_TIMER_SAMPLE_CC_OFFSET 2
|
||||
#undef HAL_EVENT_TIMER_SAMPLE_TASK
|
||||
#define HAL_EVENT_TIMER_SAMPLE_TASK NRF_TIMER_TASK_CAPTURE2
|
||||
|
||||
#else /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */
|
||||
#define SW_SWITCH_TIMER_EVTS_COMP_BASE 0
|
||||
#define SW_SWITCH_TIMER_EVTS_COMP_S2_BASE 2
|
||||
|
||||
/* Wrapper for EVENTS_END event generated by Radio peripheral at the very end of the transmission
|
||||
* or reception of a PDU on air. In case of regular PDU it is generated when last bit of CRC is
|
||||
* received or transmitted.
|
||||
*
|
||||
* When direction finding is enabled a PDU may include Constant Tone Extensio at its end. For PDU
|
||||
* including CTE EVENTS_PHYEND event is generated at very end of a PDU. In case there is no CTE in
|
||||
* a PDU the EVENTS_PHYEND event is generated in the same instant as EVENTS_END event.
|
||||
*/
|
||||
#undef NRF_RADIO_TXRX_END_EVENT
|
||||
#define NRF_RADIO_TXRX_END_EVENT EVENTS_PHYEND
|
||||
|
||||
/* Wrapper for RADIO_SHORTS mask connecting EVENTS_PHYEND to EVENTS_DISABLE.
|
||||
* This is a mask for SOC that has Direction Finding Extension in a Radio peripheral.
|
||||
* It enables shortcut for EVENTS_PHYEND event generated at very end to Radio EVENTS_DISABLE event.
|
||||
* In case there is a CTE in a PDU then EVENTS_PHYEND event is generated after the CTE.
|
||||
* If there is no CTE, it is generated in the same instant as EVENTS_END.
|
||||
*/
|
||||
#undef NRF_RADIO_SHORTS_PDU_END_DISABLE
|
||||
#define NRF_RADIO_SHORTS_PDU_END_DISABLE RADIO_SHORTS_PHYEND_DISABLE_Msk
|
||||
|
||||
#if defined(CONFIG_BT_CTLR_DF_PHYEND_OFFSET_COMPENSATION_ENABLE)
|
||||
/* Use NRF_TIMER3 for PHYEND delay compensation because it has 6 channels available.
|
||||
* In other cases NRF_TIMER1 with its 4 channels is enough.
|
||||
*/
|
||||
#define SW_SWITCH_TIMER NRF_TIMER3
|
||||
/* Allocate 2 adjacent channels for PHYEND delay compensation. Channels 4 and 5 will be used for it.
|
||||
* It must be two channels because Radio TX/RX mode SW SWITCH uses two channels.
|
||||
*/
|
||||
#define SW_SWITCH_TIMER_EVTS_COMP_PHYEND_DELAY_COMPENSATION_BASE 4
|
||||
#else /* CONFIG_BT_CTLR_DF_PHYEND_OFFSET_COMPENSATION_ENABLE */
|
||||
#define SW_SWITCH_TIMER NRF_TIMER1
|
||||
#endif /* CONFIG_BT_CTLR_DF_PHYEND_OFFSET_COMPENSATION_ENABLE */
|
||||
#endif /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */
|
||||
#endif /* !CONFIG_BT_CTLR_TIFS_HW */
|
||||
|
||||
/* SoC specific NRF_RADIO power-on reset value. Refer to Product Specification,
|
||||
* RADIO Registers section for the documented reset values.
|
||||
*
|
||||
|
||||
@ -336,57 +336,6 @@
|
||||
#endif /* !CONFIG_BT_CTLR_TIFS_HW */
|
||||
#endif /* !CONFIG_BT_CTLR_RADIO_ENABLE_FAST */
|
||||
|
||||
#if !defined(CONFIG_BT_CTLR_TIFS_HW)
|
||||
#if defined(CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER)
|
||||
#undef EVENT_TIMER_ID
|
||||
#define EVENT_TIMER_ID 4
|
||||
#define SW_SWITCH_TIMER EVENT_TIMER
|
||||
#define SW_SWITCH_TIMER_EVTS_COMP_BASE 3
|
||||
#define SW_SWITCH_TIMER_EVTS_COMP_S2_BASE 5
|
||||
#undef HAL_EVENT_TIMER_SAMPLE_CC_OFFSET
|
||||
#define HAL_EVENT_TIMER_SAMPLE_CC_OFFSET 2
|
||||
#undef HAL_EVENT_TIMER_SAMPLE_TASK
|
||||
#define HAL_EVENT_TIMER_SAMPLE_TASK NRF_TIMER_TASK_CAPTURE2
|
||||
|
||||
#else /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */
|
||||
#define SW_SWITCH_TIMER_EVTS_COMP_BASE 0
|
||||
#define SW_SWITCH_TIMER_EVTS_COMP_S2_BASE 2
|
||||
|
||||
/* Wrapper for EVENTS_END event generated by Radio peripheral at the very end of the transmission
|
||||
* or reception of a PDU on air. In case of regular PDU it is generated when last bit of CRC is
|
||||
* received or transmitted.
|
||||
*
|
||||
* When direction finding is enabled a PDU may include Constant Tone Extensio at its end. For PDU
|
||||
* including CTE EVENTS_PHYEND event is generated at very end of a PDU. In case there is no CTE in
|
||||
* a PDU the EVENTS_PHYEND event is generated in the same instant as EVENTS_END event.
|
||||
*/
|
||||
#undef NRF_RADIO_TXRX_END_EVENT
|
||||
#define NRF_RADIO_TXRX_END_EVENT EVENTS_PHYEND
|
||||
|
||||
/* Wrapper for RADIO_SHORTS mask connecting EVENTS_PHYEND to EVENTS_DISABLE.
|
||||
* This is a mask for SOC that has Direction Finding Extension in a Radio peripheral.
|
||||
* It enables shortcut for EVENTS_PHYEND event generated at very end to Radio EVENTS_DISABLE event.
|
||||
* In case there is a CTE in a PDU then EVENTS_PHYEND event is generated after the CTE.
|
||||
* If there is no CTE, it is generated in the same instant as EVENTS_END.
|
||||
*/
|
||||
#undef NRF_RADIO_SHORTS_PDU_END_DISABLE
|
||||
#define NRF_RADIO_SHORTS_PDU_END_DISABLE RADIO_SHORTS_PHYEND_DISABLE_Msk
|
||||
|
||||
#if defined(CONFIG_BT_CTLR_DF_PHYEND_OFFSET_COMPENSATION_ENABLE)
|
||||
/* Use NRF_TIMER3 for PHYEND delay compensation because it has 6 channels available.
|
||||
* In other cases NRF_TIMER1 with its 4 channels is enough.
|
||||
*/
|
||||
#define SW_SWITCH_TIMER NRF_TIMER3
|
||||
/* Allocate 2 adjacent channels for PHYEND delay compensation. Channels 4 and 5 will be used for it.
|
||||
* It must be two channels because Radio TX/RX mode SW SWITCH uses two channels.
|
||||
*/
|
||||
#define SW_SWITCH_TIMER_EVTS_COMP_PHYEND_DELAY_COMPENSATION_BASE 4
|
||||
#else /* CONFIG_BT_CTLR_DF_PHYEND_OFFSET_COMPENSATION_ENABLE */
|
||||
#define SW_SWITCH_TIMER NRF_TIMER1
|
||||
#endif /* CONFIG_BT_CTLR_DF_PHYEND_OFFSET_COMPENSATION_ENABLE */
|
||||
#endif /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */
|
||||
#endif /* !CONFIG_BT_CTLR_TIFS_HW */
|
||||
|
||||
/* SoC specific NRF_RADIO power-on reset value. Refer to Product Specification,
|
||||
* RADIO Registers section for the documented reset values.
|
||||
*
|
||||
|
||||
@ -182,18 +182,6 @@
|
||||
#endif /* !CONFIG_BT_CTLR_TIFS_HW */
|
||||
#endif /* !CONFIG_BT_CTLR_RADIO_ENABLE_FAST */
|
||||
|
||||
#if !defined(CONFIG_BT_CTLR_TIFS_HW)
|
||||
#if defined(CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER)
|
||||
#undef EVENT_TIMER_ID
|
||||
#define EVENT_TIMER_ID 4
|
||||
#define SW_SWITCH_TIMER EVENT_TIMER
|
||||
#define SW_SWITCH_TIMER_EVTS_COMP_BASE 4
|
||||
#else /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */
|
||||
#define SW_SWITCH_TIMER NRF_TIMER1
|
||||
#define SW_SWITCH_TIMER_EVTS_COMP_BASE 0
|
||||
#endif /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */
|
||||
#endif /* !CONFIG_BT_CTLR_TIFS_HW */
|
||||
|
||||
static inline void hal_radio_reset(void)
|
||||
{
|
||||
if (nrf52_errata_102() || nrf52_errata_106() || nrf52_errata_107()) {
|
||||
|
||||
@ -336,57 +336,6 @@
|
||||
#endif /* !CONFIG_BT_CTLR_TIFS_HW */
|
||||
#endif /* !CONFIG_BT_CTLR_RADIO_ENABLE_FAST */
|
||||
|
||||
#if !defined(CONFIG_BT_CTLR_TIFS_HW)
|
||||
#if defined(CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER)
|
||||
#undef EVENT_TIMER_ID
|
||||
#define EVENT_TIMER_ID 4
|
||||
#define SW_SWITCH_TIMER EVENT_TIMER
|
||||
#define SW_SWITCH_TIMER_EVTS_COMP_BASE 3
|
||||
#define SW_SWITCH_TIMER_EVTS_COMP_S2_BASE 5
|
||||
#undef HAL_EVENT_TIMER_SAMPLE_CC_OFFSET
|
||||
#define HAL_EVENT_TIMER_SAMPLE_CC_OFFSET 2
|
||||
#undef HAL_EVENT_TIMER_SAMPLE_TASK
|
||||
#define HAL_EVENT_TIMER_SAMPLE_TASK NRF_TIMER_TASK_CAPTURE2
|
||||
|
||||
#else /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */
|
||||
#define SW_SWITCH_TIMER_EVTS_COMP_BASE 0
|
||||
#define SW_SWITCH_TIMER_EVTS_COMP_S2_BASE 2
|
||||
|
||||
/* Wrapper for EVENTS_END event generated by Radio peripheral at the very end of the transmission
|
||||
* or reception of a PDU on air. In case of regular PDU it is generated when last bit of CRC is
|
||||
* received or transmitted.
|
||||
*
|
||||
* When direction finding is enabled a PDU may include Constant Tone Extension at its end. For PDU
|
||||
* including CTE EVENTS_PHYEND event is generated at very end of a PDU. In case there is no CTE in
|
||||
* a PDU the EVENTS_PHYEND event is generated in the same instant as EVENTS_END event.
|
||||
*/
|
||||
#undef NRF_RADIO_TXRX_END_EVENT
|
||||
#define NRF_RADIO_TXRX_END_EVENT EVENTS_PHYEND
|
||||
|
||||
/* Wrapper for RADIO_SHORTS mask connecting EVENTS_PHYEND to EVENTS_DISABLE.
|
||||
* This is a mask for SOC that has Direction Finding Extension in a Radio peripheral.
|
||||
* It enables shortcut for EVENTS_PHYEND event generated at very end to Radio EVENTS_DISABLE event.
|
||||
* In case there is a CTE in a PDU then EVENTS_PHYEND event is generated after the CTE.
|
||||
* If there is no CTE, it is generated in the same instant as EVENTS_END.
|
||||
*/
|
||||
#undef NRF_RADIO_SHORTS_PDU_END_DISABLE
|
||||
#define NRF_RADIO_SHORTS_PDU_END_DISABLE RADIO_SHORTS_PHYEND_DISABLE_Msk
|
||||
|
||||
#if defined(CONFIG_BT_CTLR_DF_PHYEND_OFFSET_COMPENSATION_ENABLE)
|
||||
/* Use NRF_TIMER3 for PHYEND delay compensation because it has 6 channels available.
|
||||
* In other cases NRF_TIMER1 with its 4 channels is enough.
|
||||
*/
|
||||
#define SW_SWITCH_TIMER NRF_TIMER3
|
||||
/* Allocate 2 adjacent channels for PHYEND delay compensation. Channels 4 and 5 will be used for it.
|
||||
* It must be two channels because Radio TX/RX mode SW SWITCH uses two channels.
|
||||
*/
|
||||
#define SW_SWITCH_TIMER_EVTS_COMP_PHYEND_DELAY_COMPENSATION_BASE 4
|
||||
#else /* CONFIG_BT_CTLR_DF_PHYEND_OFFSET_COMPENSATION_ENABLE */
|
||||
#define SW_SWITCH_TIMER NRF_TIMER1
|
||||
#endif /* CONFIG_BT_CTLR_DF_PHYEND_OFFSET_COMPENSATION_ENABLE */
|
||||
#endif /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */
|
||||
#endif /* !CONFIG_BT_CTLR_TIFS_HW */
|
||||
|
||||
/* SoC specific NRF_RADIO power-on reset value. Refer to Product Specification,
|
||||
* RADIO Registers section for the documented reset values.
|
||||
*
|
||||
|
||||
@ -5,6 +5,8 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <nrf_erratas.h>
|
||||
|
||||
/* NRF Radio HW timing constants
|
||||
* - provided in US and NS (for higher granularity)
|
||||
* - based on empirical measurements and sniffer logs
|
||||
@ -337,25 +339,6 @@
|
||||
#endif /* !CONFIG_BT_CTLR_TIFS_HW */
|
||||
#endif /* !CONFIG_BT_CTLR_RADIO_ENABLE_FAST */
|
||||
|
||||
#if !defined(CONFIG_BT_CTLR_TIFS_HW)
|
||||
#if defined(CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER)
|
||||
#undef EVENT_TIMER_ID
|
||||
#define EVENT_TIMER_ID 4
|
||||
#define SW_SWITCH_TIMER EVENT_TIMER
|
||||
#define SW_SWITCH_TIMER_EVTS_COMP_BASE 3
|
||||
#define SW_SWITCH_TIMER_EVTS_COMP_S2_BASE 5
|
||||
#undef HAL_EVENT_TIMER_SAMPLE_CC_OFFSET
|
||||
#define HAL_EVENT_TIMER_SAMPLE_CC_OFFSET 2
|
||||
#undef HAL_EVENT_TIMER_SAMPLE_TASK
|
||||
#define HAL_EVENT_TIMER_SAMPLE_TASK NRF_TIMER_TASK_CAPTURE2
|
||||
|
||||
#else /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */
|
||||
#define SW_SWITCH_TIMER NRF_TIMER1
|
||||
#define SW_SWITCH_TIMER_EVTS_COMP_BASE 0
|
||||
#define SW_SWITCH_TIMER_EVTS_COMP_S2_BASE 2
|
||||
#endif /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */
|
||||
#endif /* !CONFIG_BT_CTLR_TIFS_HW */
|
||||
|
||||
static inline void hal_radio_reset(void)
|
||||
{
|
||||
/* TODO: Add any required setup for each radio event
|
||||
|
||||
@ -337,56 +337,6 @@
|
||||
#endif /* !CONFIG_BT_CTLR_TIFS_HW */
|
||||
#endif /* !CONFIG_BT_CTLR_RADIO_ENABLE_FAST */
|
||||
|
||||
#if !defined(CONFIG_BT_CTLR_TIFS_HW)
|
||||
#if defined(CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER)
|
||||
#undef EVENT_TIMER_ID
|
||||
#define EVENT_TIMER_ID 0
|
||||
#define SW_SWITCH_TIMER EVENT_TIMER
|
||||
#define SW_SWITCH_TIMER_EVTS_COMP_BASE 3
|
||||
#define SW_SWITCH_TIMER_EVTS_COMP_S2_BASE 5
|
||||
#undef HAL_EVENT_TIMER_SAMPLE_CC_OFFSET
|
||||
#define HAL_EVENT_TIMER_SAMPLE_CC_OFFSET 2
|
||||
#undef HAL_EVENT_TIMER_SAMPLE_TASK
|
||||
#define HAL_EVENT_TIMER_SAMPLE_TASK NRF_TIMER_TASK_CAPTURE2
|
||||
|
||||
#else /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */
|
||||
#define SW_SWITCH_TIMER NRF_TIMER1
|
||||
#define SW_SWITCH_TIMER_EVTS_COMP_BASE 0
|
||||
#define SW_SWITCH_TIMER_EVTS_COMP_S2_BASE 2
|
||||
|
||||
/* Wrapper for EVENTS_END event generated by Radio peripheral at the very end of the transmission
|
||||
* or reception of a PDU on air. In case of regular PDU it is generated when last bit of CRC is
|
||||
* received or transmitted.
|
||||
*
|
||||
* When direction finding is enabled a PDU may include Constant Tone Extension at its end. For PDU
|
||||
* including CTE EVENTS_PHYEND event is generated at very end of a PDU, after CTE is received or
|
||||
* transmitted. In case there is no CTE in a PDU the EVENTS_PHYEND event is generated in the same
|
||||
* instant as EVENTS_END event.
|
||||
*/
|
||||
#undef NRF_RADIO_TXRX_END_EVENT
|
||||
#define NRF_RADIO_TXRX_END_EVENT EVENTS_PHYEND
|
||||
|
||||
/* Wrapper for RADIO_SHORTS mask connecting EVENTS_PHYEND to EVENTS_DISABLE.
|
||||
* This is a mask for SOC that has Direction Finding Extension in a Radio peripheral.
|
||||
* It enables shortcut for EVENTS_PHYEND event generated at very end to Radio EVENTS_DISABLE event.
|
||||
* In case there is a CTE in a PDU then EVENTS_PHYEND event is generated after the CTE.
|
||||
* If there is no CTE, it is generated in the same instant as EVENTS_END.
|
||||
*/
|
||||
#undef NRF_RADIO_SHORTS_PDU_END_DISABLE
|
||||
#define NRF_RADIO_SHORTS_PDU_END_DISABLE RADIO_SHORTS_PHYEND_DISABLE_Msk
|
||||
|
||||
#if defined(CONFIG_BT_CTLR_DF_PHYEND_OFFSET_COMPENSATION_ENABLE)
|
||||
/* Allocate 2 adjacent channels for PHYEND delay compensation. Use the same channels as for
|
||||
* PHY CODED S2. The CTEINLINE may not be enabled for PHY CODED so PHYEND event is generated
|
||||
* at the same instant as END event. Hence the channels are uesed interchangeably.
|
||||
* That saves from use of another timer.
|
||||
*/
|
||||
#define SW_SWITCH_TIMER_EVTS_COMP_PHYEND_DELAY_COMPENSATION_BASE 2
|
||||
#endif /* CONFIG_BT_CTLR_DF_PHYEND_OFFSET_COMPENSATION_ENABLE */
|
||||
|
||||
#endif /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */
|
||||
#endif /* !CONFIG_BT_CTLR_TIFS_HW */
|
||||
|
||||
/* nRF5340 supports +3dBm Tx Power using high voltage request, define +3dBm
|
||||
* value for Controller use.
|
||||
*/
|
||||
|
||||
@ -4,17 +4,6 @@
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#if defined(CONFIG_SOC_NRF5340_CPUNET) || defined(DPPI_PRESENT)
|
||||
|
||||
#include <hal/nrf_dppi.h>
|
||||
#include <hal/nrf_timer.h>
|
||||
#include <hal/nrf_radio.h>
|
||||
#include <hal/nrf_rtc.h>
|
||||
#include <hal/nrf_ccm.h>
|
||||
#include <hal/nrf_aar.h>
|
||||
#include <hal/nrf_gpiote.h>
|
||||
|
||||
#include "radio_nrf5_dppi_resources.h"
|
||||
|
||||
static inline void hal_radio_nrf_ppi_channels_enable(uint32_t mask)
|
||||
{
|
||||
@ -765,5 +754,3 @@ hal_radio_sw_switch_phyend_delay_compensation_config_clear(uint8_t radio_enable_
|
||||
#endif /* CONFIG_BT_CTLR_DF_PHYEND_OFFSET_COMPENSATION_ENABLE */
|
||||
|
||||
#endif /* !CONFIG_BT_CTLR_TIFS_HW */
|
||||
|
||||
#endif /* CONFIG_SOC_NRF5340_CPUNET || DPPI_PRESENT */
|
||||
|
||||
@ -4,11 +4,6 @@
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#if defined(CONFIG_SOC_SERIES_NRF51X) || defined(CONFIG_SOC_COMPATIBLE_NRF52X)
|
||||
|
||||
#include <hal/nrf_ppi.h>
|
||||
|
||||
#include "radio_nrf5_ppi_resources.h"
|
||||
|
||||
static inline void hal_radio_nrf_ppi_channels_enable(uint32_t mask)
|
||||
{
|
||||
@ -726,4 +721,3 @@ static inline void hal_radio_sw_switch_ppi_group_setup(void)
|
||||
}
|
||||
|
||||
#endif /* !CONFIG_BT_CTLR_TIFS_HW */
|
||||
#endif /* CONFIG_SOC_SERIES_NRF51X || CONFIG_SOC_COMPATIBLE_NRF52X */
|
||||
|
||||
@ -3,8 +3,6 @@
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include <zephyr/sys/util.h>
|
||||
#include "radio_nrf5_fem.h"
|
||||
|
||||
#if defined(CONFIG_BT_CTLR_TIFS_HW) || !defined(CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER)
|
||||
|
||||
|
||||
@ -0,0 +1,130 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Nordic Semiconductor ASA
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* Use the timer instance ID, not NRF_TIMERx directly, so that it can be checked
|
||||
* in radio_nrf5_ppi.h by the preprocessor.
|
||||
*/
|
||||
#if !defined(CONFIG_BT_CTLR_TIFS_HW)
|
||||
|
||||
#if defined(CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER)
|
||||
#define EVENT_TIMER_ID 4
|
||||
#define EVENT_TIMER _CONCAT(NRF_TIMER, EVENT_TIMER_ID)
|
||||
|
||||
#define SW_SWITCH_TIMER EVENT_TIMER
|
||||
|
||||
#if defined(CONFIG_BT_CTLR_PHY_CODED)
|
||||
#define SW_SWITCH_TIMER_EVTS_COMP_BASE 3
|
||||
#define SW_SWITCH_TIMER_EVTS_COMP_S2_BASE 5
|
||||
|
||||
/* Wrapper for EVENTS_END event generated by Radio peripheral at the very end of the transmission
|
||||
* or reception of a PDU on air. In case of regular PDU it is generated when last bit of CRC is
|
||||
* received or transmitted.
|
||||
*/
|
||||
#define NRF_RADIO_TXRX_END_EVENT EVENTS_END
|
||||
/* Wrapper for RADIO_SHORTS mask connecting EVENTS_END to EVENTS_DISABLE.
|
||||
* This is a default shortcut used to automatically disable Radio after end of PDU.
|
||||
*/
|
||||
#define NRF_RADIO_SHORTS_PDU_END_DISABLE RADIO_SHORTS_END_DISABLE_Msk
|
||||
|
||||
#define HAL_EVENT_TIMER_SAMPLE_CC_OFFSET 2
|
||||
#define HAL_EVENT_TIMER_SAMPLE_TASK NRF_TIMER_TASK_CAPTURE2
|
||||
|
||||
#else /* !CONFIG_BT_CTLR_PHY_CODED */
|
||||
#define SW_SWITCH_TIMER_EVTS_COMP_BASE 4
|
||||
|
||||
/* Wrapper for EVENTS_END event generated by Radio peripheral at the very end of the transmission
|
||||
* or reception of a PDU on air. In case of regular PDU it is generated when last bit of CRC is
|
||||
* received or transmitted.
|
||||
*/
|
||||
#define NRF_RADIO_TXRX_END_EVENT EVENTS_END
|
||||
/* Wrapper for RADIO_SHORTS mask connecting EVENTS_END to EVENTS_DISABLE.
|
||||
* This is a default shortcut used to automatically disable Radio after end of PDU.
|
||||
*/
|
||||
#define NRF_RADIO_SHORTS_PDU_END_DISABLE RADIO_SHORTS_END_DISABLE_Msk
|
||||
|
||||
#define HAL_EVENT_TIMER_SAMPLE_CC_OFFSET 3
|
||||
#define HAL_EVENT_TIMER_SAMPLE_TASK NRF_TIMER_TASK_CAPTURE3
|
||||
#endif /* !CONFIG_BT_CTLR_PHY_CODED */
|
||||
|
||||
#else /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */
|
||||
#define EVENT_TIMER_ID 0
|
||||
#define EVENT_TIMER _CONCAT(NRF_TIMER, EVENT_TIMER_ID)
|
||||
|
||||
#define SW_SWITCH_TIMER NRF_TIMER1
|
||||
#define SW_SWITCH_TIMER_EVTS_COMP_BASE 0
|
||||
|
||||
#if defined(CONFIG_BT_CTLR_PHY_CODED)
|
||||
#define SW_SWITCH_TIMER_EVTS_COMP_S2_BASE 2
|
||||
#endif /* !CONFIG_BT_CTLR_PHY_CODED */
|
||||
|
||||
#if defined(CONFIG_BT_CTLR_DF)
|
||||
|
||||
#if defined(CONFIG_BT_CTLR_DF_PHYEND_OFFSET_COMPENSATION_ENABLE)
|
||||
/* Allocate 2 adjacent channels for PHYEND delay compensation. Use the same channels as for
|
||||
* PHY CODED S2. The CTEINLINE may not be enabled for PHY CODED so PHYEND event is generated
|
||||
* at the same instant as END event. Hence the channels are uesed interchangeably.
|
||||
* That saves from use of another timer.
|
||||
*/
|
||||
#define SW_SWITCH_TIMER_EVTS_COMP_PHYEND_DELAY_COMPENSATION_BASE 2
|
||||
#endif /* CONFIG_BT_CTLR_DF_PHYEND_OFFSET_COMPENSATION_ENABLE */
|
||||
|
||||
/* Wrapper for EVENTS_END event generated by Radio peripheral at the very end of the transmission
|
||||
* or reception of a PDU on air. In case of regular PDU it is generated when last bit of CRC is
|
||||
* received or transmitted.
|
||||
*
|
||||
* When direction finding is enabled a PDU may include Constant Tone Extension at its end. For PDU
|
||||
* including CTE EVENTS_PHYEND event is generated at very end of a PDU. In case there is no CTE in
|
||||
* a PDU the EVENTS_PHYEND event is generated in the same instant as EVENTS_END event.
|
||||
*/
|
||||
#define NRF_RADIO_TXRX_END_EVENT EVENTS_PHYEND
|
||||
|
||||
/* Wrapper for RADIO_SHORTS mask connecting EVENTS_PHYEND to EVENTS_DISABLE.
|
||||
* This is a mask for SOC that has Direction Finding Extension in a Radio peripheral.
|
||||
* It enables shortcut for EVENTS_PHYEND event generated at very end to Radio EVENTS_DISABLE event.
|
||||
* In case there is a CTE in a PDU then EVENTS_PHYEND event is generated after the CTE.
|
||||
* If there is no CTE, it is generated in the same instant as EVENTS_END.
|
||||
*/
|
||||
#define NRF_RADIO_SHORTS_PDU_END_DISABLE RADIO_SHORTS_PHYEND_DISABLE_Msk
|
||||
|
||||
/* Delay of EVENTS_PHYEND event on receive PDU without CTE inclded when CTEINLINE is enabled */
|
||||
#define RADIO_EVENTS_PHYEND_DELAY_US 16
|
||||
|
||||
/* Delay of CCM TASKS_CRYPT start in number of bits for Radio Bit counter */
|
||||
#define CCM_TASKS_CRYPT_DELAY_BITS 3
|
||||
|
||||
#else /* !CONFIG_BT_CTLR_DF */
|
||||
/* Wrapper for EVENTS_END event generated by Radio peripheral at the very end of the transmission
|
||||
* or reception of a PDU on air. In case of regular PDU it is generated when last bit of CRC is
|
||||
* received or transmitted.
|
||||
*/
|
||||
#define NRF_RADIO_TXRX_END_EVENT EVENTS_END
|
||||
/* Wrapper for RADIO_SHORTS mask connecting EVENTS_END to EVENTS_DISABLE.
|
||||
* This is a default shortcut used to automatically disable Radio after end of PDU.
|
||||
*/
|
||||
#define NRF_RADIO_SHORTS_PDU_END_DISABLE RADIO_SHORTS_END_DISABLE_Msk
|
||||
#endif /* !CONFIG_BT_CTLR_DF */
|
||||
|
||||
#define HAL_EVENT_TIMER_SAMPLE_CC_OFFSET 3
|
||||
#define HAL_EVENT_TIMER_SAMPLE_TASK NRF_TIMER_TASK_CAPTURE3
|
||||
#endif /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */
|
||||
|
||||
#else /* !CONFIG_BT_CTLR_TIFS_HW */
|
||||
#define EVENT_TIMER_ID 0
|
||||
#define EVENT_TIMER _CONCAT(NRF_TIMER, EVENT_TIMER_ID)
|
||||
|
||||
/* Wrapper for EVENTS_END event generated by Radio peripheral at the very end of the transmission
|
||||
* or reception of a PDU on air. In case of regular PDU it is generated when last bit of CRC is
|
||||
* received or transmitted.
|
||||
*/
|
||||
#define NRF_RADIO_TXRX_END_EVENT EVENTS_END
|
||||
/* Wrapper for RADIO_SHORTS mask connecting EVENTS_END to EVENTS_DISABLE.
|
||||
* This is a default shortcut used to automatically disable Radio after end of PDU.
|
||||
*/
|
||||
#define NRF_RADIO_SHORTS_PDU_END_DISABLE RADIO_SHORTS_END_DISABLE_Msk
|
||||
|
||||
#define HAL_EVENT_TIMER_SAMPLE_CC_OFFSET 3
|
||||
#define HAL_EVENT_TIMER_SAMPLE_TASK NRF_TIMER_TASK_CAPTURE3
|
||||
#endif /* !CONFIG_BT_CTLR_TIFS_HW */
|
||||
@ -183,18 +183,6 @@
|
||||
#endif /* !CONFIG_BT_CTLR_TIFS_HW */
|
||||
#endif /* !CONFIG_BT_CTLR_RADIO_ENABLE_FAST */
|
||||
|
||||
#if !defined(CONFIG_BT_CTLR_TIFS_HW)
|
||||
#if defined(CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER)
|
||||
#undef EVENT_TIMER_ID
|
||||
#define EVENT_TIMER_ID 4
|
||||
#define SW_SWITCH_TIMER EVENT_TIMER
|
||||
#define SW_SWITCH_TIMER_EVTS_COMP_BASE 4
|
||||
#else /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */
|
||||
#define SW_SWITCH_TIMER NRF_TIMER1
|
||||
#define SW_SWITCH_TIMER_EVTS_COMP_BASE 0
|
||||
#endif /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */
|
||||
#endif /* !CONFIG_BT_CTLR_TIFS_HW */
|
||||
|
||||
static inline void hal_radio_reset(void)
|
||||
{
|
||||
/* TODO: Add any required setup for each radio event
|
||||
|
||||
@ -5,8 +5,9 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <zephyr/sys/dlist.h>
|
||||
|
||||
#include <zephyr/sys/util.h>
|
||||
|
||||
#include "hal/cntr.h"
|
||||
|
||||
@ -4,8 +4,6 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <hal/nrf_radio.h>
|
||||
|
||||
#include "hal/nrf5/radio/radio.h"
|
||||
#include "hal/nrf5/radio/radio_nrf5.h"
|
||||
#include "hal/nrf5/radio/radio_nrf5_txp.h"
|
||||
|
||||
@ -6,14 +6,14 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <zephyr/sys/dlist.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <zephyr/dt-bindings/interrupt-controller/openisa-intmux.h>
|
||||
|
||||
#include "hal/cntr.h"
|
||||
|
||||
#include "hal/debug.h"
|
||||
#include <zephyr/dt-bindings/interrupt-controller/openisa-intmux.h>
|
||||
#include "ll_irqs.h"
|
||||
|
||||
#include "ll_irqs.h"
|
||||
|
||||
#define PCS_SOURCE_RTC 2
|
||||
|
||||
|
||||
@ -8,11 +8,10 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <zephyr/bluetooth/hci_types.h>
|
||||
|
||||
#include <zephyr/sys/dlist.h>
|
||||
#include <zephyr/sys/byteorder.h>
|
||||
|
||||
#include <zephyr/bluetooth/hci_types.h>
|
||||
|
||||
#include "hal/ecb.h"
|
||||
|
||||
#include <zephyr/logging/log.h>
|
||||
|
||||
@ -8,7 +8,6 @@
|
||||
|
||||
#include <string.h>
|
||||
#include <zephyr/sys/printk.h>
|
||||
#include <zephyr/sys/dlist.h>
|
||||
#include <zephyr/sys/byteorder.h>
|
||||
#include <zephyr/bluetooth/addr.h>
|
||||
#include <zephyr/toolchain.h>
|
||||
|
||||
@ -5,8 +5,8 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <zephyr/sys/dlist.h>
|
||||
|
||||
#include "hal/cntr.h"
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user