|
63 | 63 | */ |
64 | 64 | #define HAL_RADIO_ISR_LATENCY_MAX_US 80U |
65 | 65 |
|
66 | | -#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX) |
67 | | -/* Delay of CCM TASKS_CRYPT start in number of bits for Radio Bit counter */ |
68 | | -#define CCM_TASKS_CRYPT_DELAY_BITS 3 |
69 | | -#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RX */ |
| 66 | +#define SW_SWITCH_TIMER_EVTS_COMP_BASE 4 |
70 | 67 |
|
71 | 68 | #if defined(CONFIG_BT_CTLR_PHY_CODED) |
72 | | -#define SW_SWITCH_TIMER_EVTS_COMP_BASE 4 |
73 | 69 | #define SW_SWITCH_TIMER_EVTS_COMP_S2_BASE 6 |
| 70 | +#endif /* !CONFIG_BT_CTLR_PHY_CODED */ |
| 71 | + |
| 72 | +#if defined(CONFIG_BT_CTLR_DF) |
| 73 | +#if defined(CONFIG_BT_CTLR_DF_PHYEND_OFFSET_COMPENSATION_ENABLE) |
| 74 | +/* Allocate 2 adjacent channels for PHYEND delay compensation. Use the same channels as for |
| 75 | + * PHY CODED S2. The CTEINLINE may not be enabled for PHY CODED so PHYEND event is generated |
| 76 | + * at the same instant as END event. Hence the channels are used interchangeably. |
| 77 | + * That saves from use of another timer. |
| 78 | + */ |
| 79 | +#define SW_SWITCH_TIMER_EVTS_COMP_PHYEND_DELAY_COMPENSATION_BASE 6 |
| 80 | +#endif /* CONFIG_BT_CTLR_DF_PHYEND_OFFSET_COMPENSATION_ENABLE */ |
74 | 81 |
|
75 | 82 | /* Wrapper for EVENTS_END event generated by Radio peripheral at the very end of the transmission |
76 | 83 | * or reception of a PDU on air. In case of regular PDU it is generated when last bit of CRC is |
77 | 84 | * received or transmitted. |
| 85 | + * |
| 86 | + * When direction finding is enabled a PDU may include Constant Tone Extension at its end. For PDU |
| 87 | + * including CTE EVENTS_PHYEND event is generated at very end of a PDU. In case there is no CTE in |
| 88 | + * a PDU the EVENTS_PHYEND event is generated in the same instant as EVENTS_END event. |
78 | 89 | */ |
79 | | -#define HAL_RADIO_TRX_EVENTS_END HAL_RADIO_EVENTS_END |
80 | | -#define HAL_NRF_RADIO_TRX_EVENT_END HAL_NRF_RADIO_EVENT_END |
| 90 | +#define HAL_RADIO_TRX_EVENTS_END HAL_RADIO_EVENTS_PHYEND |
| 91 | +#define HAL_NRF_RADIO_TRX_EVENT_END HAL_NRF_RADIO_EVENT_PHYEND |
81 | 92 |
|
82 | | -/* Wrapper for RADIO_SHORTS mask connecting EVENTS_END to EVENTS_DISABLE. |
83 | | - * This is a default shortcut used to automatically disable Radio after end of PDU. |
| 93 | +/* Wrapper for RADIO_SHORTS mask connecting EVENTS_PHYEND to EVENTS_DISABLE. |
| 94 | + * This is a mask for SOC that has Direction Finding Extension in a Radio peripheral. |
| 95 | + * It enables shortcut for EVENTS_PHYEND event generated at very end to Radio EVENTS_DISABLE event. |
| 96 | + * In case there is a CTE in a PDU then EVENTS_PHYEND event is generated after the CTE. |
| 97 | + * If there is no CTE, it is generated in the same instant as EVENTS_END. |
84 | 98 | */ |
85 | | -#define NRF_RADIO_SHORTS_TRX_END_DISABLE_Msk HAL_RADIO_SHORTS_TRX_END_DISABLE_Msk |
86 | | - |
87 | | -#define HAL_EVENT_TIMER_TRX_CC_OFFSET 0 |
88 | | -#define HAL_EVENT_TIMER_TRX_EVENT NRF_TIMER_EVENT_COMPARE0 |
89 | | -#define HAL_EVENT_TIMER_READY_TASK NRF_TIMER_TASK_CAPTURE0 |
90 | | - |
91 | | -#define HAL_EVENT_TIMER_HCTO_CC_OFFSET 1 |
92 | | -#define HAL_EVENT_TIMER_HCTO_EVENT NRF_TIMER_EVENT_COMPARE1 |
93 | | -#define HAL_EVENT_TIMER_ADDRESS_TASK NRF_TIMER_TASK_CAPTURE1 |
94 | | - |
95 | | -#define HAL_EVENT_TIMER_TRX_END_CC_OFFSET 2 |
96 | | -#define HAL_EVENT_TIMER_TRX_END_TASK NRF_TIMER_TASK_CAPTURE2 |
97 | | - |
98 | | -#define HAL_EVENT_TIMER_DEFERRED_TRX_CC_OFFSET 2 |
99 | | -#define HAL_EVENT_TIMER_DEFERRED_TX_EVENT NRF_TIMER_EVENT_COMPARE2 |
100 | | - |
101 | | -#define HAL_EVENT_TIMER_SAMPLE_CC_OFFSET 3 |
102 | | -#define HAL_EVENT_TIMER_SAMPLE_TASK NRF_TIMER_TASK_CAPTURE3 |
| 99 | +#define NRF_RADIO_SHORTS_TRX_END_DISABLE_Msk HAL_RADIO_SHORTS_TRX_PHYEND_DISABLE_Msk |
103 | 100 |
|
104 | | -#define HAL_EVENT_TIMER_PA_LNA_CC_OFFSET 2 |
105 | | -#define HAL_EVENT_TIMER_PA_LNA_PDN_CC_OFFSET 3 |
| 101 | +/* Delay of EVENTS_PHYEND event on receive PDU without CTE included when CTEINLINE is enabled */ |
| 102 | +#define RADIO_EVENTS_PHYEND_DELAY_US 16 |
106 | 103 |
|
107 | | -#else /* !CONFIG_BT_CTLR_PHY_CODED */ |
108 | | -#define SW_SWITCH_TIMER_EVTS_COMP_BASE 4 |
| 104 | +#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX) |
| 105 | +/* Delay of CCM TASKS_CRYPT start in number of bits for Radio Bit counter */ |
| 106 | +#define CCM_TASKS_CRYPT_DELAY_BITS 3 |
| 107 | +#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RX */ |
109 | 108 |
|
| 109 | +#else /* !CONFIG_BT_CTLR_DF */ |
110 | 110 | /* Wrapper for EVENTS_END event generated by Radio peripheral at the very end of the transmission |
111 | 111 | * or reception of a PDU on air. In case of regular PDU it is generated when last bit of CRC is |
112 | 112 | * received or transmitted. |
|
118 | 118 | * This is a default shortcut used to automatically disable Radio after end of PDU. |
119 | 119 | */ |
120 | 120 | #define NRF_RADIO_SHORTS_TRX_END_DISABLE_Msk HAL_RADIO_SHORTS_TRX_END_DISABLE_Msk |
| 121 | +#endif /* !CONFIG_BT_CTLR_DF */ |
121 | 122 |
|
122 | 123 | #define HAL_EVENT_TIMER_TRX_CC_OFFSET 0 |
123 | 124 | #define HAL_EVENT_TIMER_TRX_EVENT NRF_TIMER_EVENT_COMPARE0 |
|
138 | 139 |
|
139 | 140 | #define HAL_EVENT_TIMER_PA_LNA_CC_OFFSET 2 |
140 | 141 | #define HAL_EVENT_TIMER_PA_LNA_PDN_CC_OFFSET 3 |
141 | | -#endif /* !CONFIG_BT_CTLR_PHY_CODED */ |
142 | 142 |
|
143 | 143 | #else /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */ |
144 | 144 | #define EVENT_TIMER_ID 0 |
|
158 | 158 | #endif /* !CONFIG_BT_CTLR_PHY_CODED */ |
159 | 159 |
|
160 | 160 | #if defined(CONFIG_BT_CTLR_DF) |
161 | | - |
162 | 161 | #if defined(CONFIG_BT_CTLR_DF_PHYEND_OFFSET_COMPENSATION_ENABLE) |
163 | 162 | /* Allocate 2 adjacent channels for PHYEND delay compensation. Use the same channels as for |
164 | 163 | * PHY CODED S2. The CTEINLINE may not be enabled for PHY CODED so PHYEND event is generated |
|
0 commit comments