Skip to content

Commit

Permalink
Bluetooth: Controller: Fix nRF5 radio and event timer abstractions
Browse files Browse the repository at this point in the history
Fix nRF5 radio and event timer abstractions for some that
where hard coded compared to use of the ones defined in the
resources header file.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
  • Loading branch information
cvinayak authored and kartben committed Jan 18, 2025
1 parent 7e51788 commit 06b7503
Show file tree
Hide file tree
Showing 18 changed files with 149 additions and 73 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ static void last_pdu_end_us_init(uint32_t latency_us)

uint32_t radio_is_done(void)
{
if (NRF_RADIO->NRF_RADIO_TRX_END_EVENT != 0) {
if (NRF_RADIO->HAL_RADIO_TRX_EVENTS_END != 0) {
/* On packet END event increment last packet end time value.
* Note: this depends on the function being called exactly once
* in the ISR function.
Expand All @@ -637,7 +637,7 @@ uint32_t radio_is_done(void)
#else /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */
uint32_t radio_is_done(void)
{
return (NRF_RADIO->NRF_RADIO_TRX_END_EVENT != 0);
return (NRF_RADIO->HAL_RADIO_TRX_EVENTS_END != 0);
}
#endif /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@
#define HAL_RADIO_NRF51_RX_CHAIN_DELAY_NS 3000 /* 3.0 */

/* HAL abstraction of Radio bitfields */
#define HAL_RADIO_INTENSET_DISABLED_Msk RADIO_INTENSET_DISABLED_Msk
#define HAL_RADIO_SHORTS_TRX_END_DISABLE_Msk RADIO_SHORTS_END_DISABLE_Msk
#define HAL_RADIO_SHORTS_TRX_PHYEND_DISABLE_Msk RADIO_SHORTS_PHYEND_DISABLE_Msk
#define HAL_NRF_RADIO_EVENT_END NRF_RADIO_EVENT_END
#define HAL_RADIO_EVENTS_END EVENTS_END
#define HAL_RADIO_INTENSET_DISABLED_Msk RADIO_INTENSET_DISABLED_Msk
#define HAL_RADIO_SHORTS_TRX_END_DISABLE_Msk RADIO_SHORTS_END_DISABLE_Msk

/* HAL abstraction of Radio IRQ number */
#define HAL_RADIO_IRQn RADIO_IRQn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,10 @@
#endif /* !CONFIG_BT_CTLR_RADIO_ENABLE_FAST */

/* HAL abstraction of Radio bitfields */
#define HAL_RADIO_INTENSET_DISABLED_Msk RADIO_INTENSET_DISABLED_Msk
#define HAL_RADIO_SHORTS_TRX_END_DISABLE_Msk RADIO_SHORTS_END_DISABLE_Msk
#define HAL_RADIO_SHORTS_TRX_PHYEND_DISABLE_Msk RADIO_SHORTS_PHYEND_DISABLE_Msk
#define HAL_NRF_RADIO_EVENT_END NRF_RADIO_EVENT_END
#define HAL_RADIO_EVENTS_END EVENTS_END
#define HAL_RADIO_INTENSET_DISABLED_Msk RADIO_INTENSET_DISABLED_Msk
#define HAL_RADIO_SHORTS_TRX_END_DISABLE_Msk RADIO_SHORTS_END_DISABLE_Msk

/* HAL abstraction of Radio IRQ number */
#define HAL_RADIO_IRQn RADIO_IRQn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,10 @@
#endif /* !CONFIG_BT_CTLR_RADIO_ENABLE_FAST */

/* HAL abstraction of Radio bitfields */
#define HAL_RADIO_INTENSET_DISABLED_Msk RADIO_INTENSET_DISABLED_Msk
#define HAL_RADIO_SHORTS_TRX_END_DISABLE_Msk RADIO_SHORTS_END_DISABLE_Msk
#define HAL_RADIO_SHORTS_TRX_PHYEND_DISABLE_Msk RADIO_SHORTS_PHYEND_DISABLE_Msk
#define HAL_NRF_RADIO_EVENT_END NRF_RADIO_EVENT_END
#define HAL_RADIO_EVENTS_END EVENTS_END
#define HAL_RADIO_INTENSET_DISABLED_Msk RADIO_INTENSET_DISABLED_Msk
#define HAL_RADIO_SHORTS_TRX_END_DISABLE_Msk RADIO_SHORTS_END_DISABLE_Msk

/* HAL abstraction of Radio IRQ number */
#define HAL_RADIO_IRQn RADIO_IRQn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,10 @@
#endif /* !CONFIG_BT_CTLR_RADIO_ENABLE_FAST */

/* HAL abstraction of Radio bitfields */
#define HAL_NRF_RADIO_EVENT_END NRF_RADIO_EVENT_END
#define HAL_RADIO_EVENTS_END EVENTS_END
#define HAL_NRF_RADIO_EVENT_PHYEND NRF_RADIO_EVENT_PHYEND
#define HAL_RADIO_EVENTS_PHYEND EVENTS_PHYEND
#define HAL_RADIO_INTENSET_DISABLED_Msk RADIO_INTENSET_DISABLED_Msk
#define HAL_RADIO_SHORTS_TRX_END_DISABLE_Msk RADIO_SHORTS_END_DISABLE_Msk
#define HAL_RADIO_SHORTS_TRX_PHYEND_DISABLE_Msk RADIO_SHORTS_PHYEND_DISABLE_Msk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,10 @@
#endif /* !CONFIG_BT_CTLR_RADIO_ENABLE_FAST */

/* HAL abstraction of Radio bitfields */
#define HAL_NRF_RADIO_EVENT_END NRF_RADIO_EVENT_END
#define HAL_RADIO_EVENTS_END EVENTS_END
#define HAL_NRF_RADIO_EVENT_PHYEND NRF_RADIO_EVENT_PHYEND
#define HAL_RADIO_EVENTS_PHYEND EVENTS_PHYEND
#define HAL_RADIO_INTENSET_DISABLED_Msk RADIO_INTENSET_DISABLED_Msk
#define HAL_RADIO_SHORTS_TRX_END_DISABLE_Msk RADIO_SHORTS_END_DISABLE_Msk
#define HAL_RADIO_SHORTS_TRX_PHYEND_DISABLE_Msk RADIO_SHORTS_PHYEND_DISABLE_Msk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,10 @@
#endif /* !CONFIG_BT_CTLR_RADIO_ENABLE_FAST */

/* HAL abstraction of Radio bitfields */
#define HAL_RADIO_INTENSET_DISABLED_Msk RADIO_INTENSET_DISABLED_Msk
#define HAL_RADIO_SHORTS_TRX_END_DISABLE_Msk RADIO_SHORTS_END_DISABLE_Msk
#define HAL_RADIO_SHORTS_TRX_PHYEND_DISABLE_Msk RADIO_SHORTS_PHYEND_DISABLE_Msk
#define HAL_NRF_RADIO_EVENT_END NRF_RADIO_EVENT_END
#define HAL_RADIO_EVENTS_END EVENTS_END
#define HAL_RADIO_INTENSET_DISABLED_Msk RADIO_INTENSET_DISABLED_Msk
#define HAL_RADIO_SHORTS_TRX_END_DISABLE_Msk RADIO_SHORTS_END_DISABLE_Msk

/* HAL abstraction of Radio IRQ number */
#define HAL_RADIO_IRQn RADIO_IRQn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,10 @@
#endif /* !CONFIG_BT_CTLR_RADIO_ENABLE_FAST */

/* HAL abstraction of Radio bitfields */
#define HAL_NRF_RADIO_EVENT_END NRF_RADIO_EVENT_END
#define HAL_RADIO_EVENTS_END EVENTS_END
#define HAL_NRF_RADIO_EVENT_PHYEND NRF_RADIO_EVENT_PHYEND
#define HAL_RADIO_EVENTS_PHYEND EVENTS_PHYEND
#define HAL_RADIO_INTENSET_DISABLED_Msk RADIO_INTENSET_DISABLED_Msk
#define HAL_RADIO_SHORTS_TRX_END_DISABLE_Msk RADIO_SHORTS_END_DISABLE_Msk
#define HAL_RADIO_SHORTS_TRX_PHYEND_DISABLE_Msk RADIO_SHORTS_PHYEND_DISABLE_Msk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,10 @@
#endif /* !CONFIG_BT_CTLR_RADIO_ENABLE_FAST */

/* HAL abstraction of Radio bitfields */
#define HAL_RADIO_INTENSET_DISABLED_Msk RADIO_INTENSET_DISABLED_Msk
#define HAL_RADIO_SHORTS_TRX_END_DISABLE_Msk RADIO_SHORTS_END_DISABLE_Msk
#define HAL_RADIO_SHORTS_TRX_PHYEND_DISABLE_Msk RADIO_SHORTS_PHYEND_DISABLE_Msk
#define HAL_NRF_RADIO_EVENT_END NRF_RADIO_EVENT_END
#define HAL_RADIO_EVENTS_END EVENTS_END
#define HAL_RADIO_INTENSET_DISABLED_Msk RADIO_INTENSET_DISABLED_Msk
#define HAL_RADIO_SHORTS_TRX_END_DISABLE_Msk RADIO_SHORTS_END_DISABLE_Msk

/* HAL abstraction of Radio IRQ number */
#define HAL_RADIO_IRQn RADIO_IRQn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,12 @@
#endif

/* HAL abstraction of Radio bitfields */
#define HAL_NRF_RADIO_EVENT_END NRF_RADIO_EVENT_END
#define HAL_RADIO_EVENTS_END EVENTS_END
#define HAL_RADIO_PUBLISH_END PUBLISH_END
#define HAL_NRF_RADIO_EVENT_PHYEND NRF_RADIO_EVENT_PHYEND
#define HAL_RADIO_EVENTS_PHYEND EVENTS_PHYEND
#define HAL_RADIO_PUBLISH_PHYEND PUBLISH_PHYEND
#define HAL_RADIO_INTENSET_DISABLED_Msk RADIO_INTENSET_DISABLED_Msk
#define HAL_RADIO_SHORTS_TRX_END_DISABLE_Msk RADIO_SHORTS_END_DISABLE_Msk
#define HAL_RADIO_SHORTS_TRX_PHYEND_DISABLE_Msk RADIO_SHORTS_PHYEND_DISABLE_Msk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,12 @@
#endif /* !CONFIG_BT_CTLR_RADIO_ENABLE_FAST */

/* HAL abstraction of Radio bitfields */
#define HAL_NRF_RADIO_EVENT_END NRF_RADIO_EVENT_END
#define HAL_RADIO_EVENTS_END EVENTS_END
#define HAL_RADIO_PUBLISH_END PUBLISH_END
#define HAL_NRF_RADIO_EVENT_PHYEND NRF_RADIO_EVENT_PHYEND
#define HAL_RADIO_EVENTS_PHYEND EVENTS_PHYEND
#define HAL_RADIO_PUBLISH_PHYEND PUBLISH_PHYEND
#define HAL_RADIO_INTENSET_DISABLED_Msk RADIO_INTENSET00_DISABLED_Msk
#define HAL_RADIO_SHORTS_TRX_END_DISABLE_Msk RADIO_SHORTS_PHYEND_DISABLE_Msk
#define HAL_RADIO_SHORTS_TRX_PHYEND_DISABLE_Msk RADIO_SHORTS_PHYEND_DISABLE_Msk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static inline void hal_radio_nrf_ppi_channels_disable(uint32_t mask)
static inline void hal_radio_enable_on_tick_ppi_config_and_enable(uint8_t trx)
{
if (trx) {
nrf_timer_publish_set(EVENT_TIMER, NRF_TIMER_EVENT_COMPARE0,
nrf_timer_publish_set(EVENT_TIMER, HAL_EVENT_TIMER_TRX_EVENT,
HAL_RADIO_ENABLE_TX_ON_TICK_PPI);
nrf_radio_subscribe_set(NRF_RADIO, NRF_RADIO_TASK_TXEN,
HAL_RADIO_ENABLE_TX_ON_TICK_PPI);
Expand All @@ -40,7 +40,7 @@ static inline void hal_radio_enable_on_tick_ppi_config_and_enable(uint8_t trx)
nrf_dppi_channels_enable(NRF_DPPIC,
BIT(HAL_RADIO_ENABLE_TX_ON_TICK_PPI));
} else {
nrf_timer_publish_set(EVENT_TIMER, NRF_TIMER_EVENT_COMPARE0,
nrf_timer_publish_set(EVENT_TIMER, HAL_EVENT_TIMER_TRX_EVENT,
HAL_RADIO_ENABLE_RX_ON_TICK_PPI);
nrf_radio_subscribe_set(NRF_RADIO, NRF_RADIO_TASK_RXEN,
HAL_RADIO_ENABLE_RX_ON_TICK_PPI);
Expand All @@ -63,10 +63,10 @@ static inline void hal_radio_enable_on_tick_ppi_config_and_enable(uint8_t trx)
*/
static inline void hal_radio_recv_timeout_cancel_ppi_config(void)
{
nrf_radio_publish_set(NRF_RADIO,
NRF_RADIO_EVENT_ADDRESS, HAL_RADIO_RECV_TIMEOUT_CANCEL_PPI);
nrf_timer_subscribe_set(EVENT_TIMER,
NRF_TIMER_TASK_CAPTURE1, HAL_RADIO_RECV_TIMEOUT_CANCEL_PPI);
nrf_radio_publish_set(NRF_RADIO, NRF_RADIO_EVENT_ADDRESS,
HAL_RADIO_RECV_TIMEOUT_CANCEL_PPI);
nrf_timer_subscribe_set(EVENT_TIMER, HAL_EVENT_TIMER_ADDRESS_TASK,
HAL_RADIO_RECV_TIMEOUT_CANCEL_PPI);
}

/*******************************************************************************
Expand All @@ -76,10 +76,10 @@ static inline void hal_radio_recv_timeout_cancel_ppi_config(void)
*/
static inline void hal_radio_disable_on_hcto_ppi_config(void)
{
nrf_timer_publish_set(EVENT_TIMER,
NRF_TIMER_EVENT_COMPARE1, HAL_RADIO_DISABLE_ON_HCTO_PPI);
nrf_radio_subscribe_set(NRF_RADIO,
NRF_RADIO_TASK_DISABLE, HAL_RADIO_DISABLE_ON_HCTO_PPI);
nrf_timer_publish_set(EVENT_TIMER, HAL_EVENT_TIMER_HCTO_EVENT,
HAL_RADIO_DISABLE_ON_HCTO_PPI);
nrf_radio_subscribe_set(NRF_RADIO, NRF_RADIO_TASK_DISABLE,
HAL_RADIO_DISABLE_ON_HCTO_PPI);
}

/*******************************************************************************
Expand All @@ -89,9 +89,9 @@ static inline void hal_radio_disable_on_hcto_ppi_config(void)
*/
static inline void hal_radio_end_time_capture_ppi_config(void)
{
nrf_radio_publish_set(NRF_RADIO, NRF_RADIO_EVENT_END, HAL_RADIO_END_TIME_CAPTURE_PPI);
nrf_timer_subscribe_set(EVENT_TIMER,
NRF_TIMER_TASK_CAPTURE2, HAL_RADIO_END_TIME_CAPTURE_PPI);
nrf_radio_publish_set(NRF_RADIO, HAL_NRF_RADIO_EVENT_END, HAL_RADIO_END_TIME_CAPTURE_PPI);
nrf_timer_subscribe_set(EVENT_TIMER, HAL_EVENT_TIMER_TRX_END_TASK,
HAL_RADIO_END_TIME_CAPTURE_PPI);
}

/*******************************************************************************
Expand Down Expand Up @@ -131,10 +131,10 @@ static inline void hal_event_timer_start_ppi_config(void)
*/
static inline void hal_radio_ready_time_capture_ppi_config(void)
{
nrf_radio_publish_set(NRF_RADIO,
NRF_RADIO_EVENT_READY, HAL_RADIO_READY_TIME_CAPTURE_PPI);
nrf_timer_subscribe_set(EVENT_TIMER,
NRF_TIMER_TASK_CAPTURE0, HAL_RADIO_READY_TIME_CAPTURE_PPI);
nrf_radio_publish_set(NRF_RADIO, NRF_RADIO_EVENT_READY,
HAL_RADIO_READY_TIME_CAPTURE_PPI);
nrf_timer_subscribe_set(EVENT_TIMER, HAL_EVENT_TIMER_READY_TASK,
HAL_RADIO_READY_TIME_CAPTURE_PPI);
}

#if defined(CONFIG_BT_CTLR_LE_ENC) || defined(CONFIG_BT_CTLR_BROADCAST_ISO_ENC)
Expand Down Expand Up @@ -215,16 +215,14 @@ static inline void hal_trigger_crypt_by_bcmatch_ppi_config(void)
/******************************************************************************/
#if !defined(CONFIG_BT_CTLR_TIFS_HW)

#if !defined(CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER)
#define NRF_RADIO_PUBLISH_PDU_END_EVT PUBLISH_PHYEND
/* Wrappenr for EVENTS_END event name used by nRFX API */
#define NRFX_RADIO_TXRX_END_EVENT NRF_RADIO_EVENT_PHYEND
#else /* CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */
#define NRF_RADIO_PUBLISH_PDU_END_EVT PUBLISH_END
#define NRFX_RADIO_TXRX_END_EVENT NRF_RADIO_EVENT_END
#endif /* CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */

/* DPPI setup used for SW-based auto-switching during TIFS. */
#if defined(CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER)
#define HAL_NRF_RADIO_TIFS_DPPI_EVENT_END HAL_NRF_RADIO_EVENT_END
#define HAL_RADIO_TIFS_DPPI_PUBLISH_END HAL_RADIO_PUBLISH_END
#else /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */
#define HAL_NRF_RADIO_TIFS_DPPI_EVENT_END HAL_NRF_RADIO_EVENT_PHYEND
#define HAL_RADIO_TIFS_DPPI_PUBLISH_END HAL_RADIO_PUBLISH_PHYEND
#endif /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */

/* Clear SW-switch timer on packet end:
* wire the RADIO EVENTS_END event to SW_SWITCH_TIMER TASKS_CLEAR task.
Expand All @@ -236,7 +234,8 @@ static inline void hal_trigger_crypt_by_bcmatch_ppi_config(void)
*/
static inline void hal_sw_switch_timer_clear_ppi_config(void)
{
nrf_radio_publish_set(NRF_RADIO, NRFX_RADIO_TXRX_END_EVENT, HAL_SW_SWITCH_TIMER_CLEAR_PPI);
nrf_radio_publish_set(NRF_RADIO, HAL_NRF_RADIO_TIFS_DPPI_EVENT_END,
HAL_SW_SWITCH_TIMER_CLEAR_PPI);
nrf_timer_subscribe_set(SW_SWITCH_TIMER,
NRF_TIMER_TASK_CLEAR, HAL_SW_SWITCH_TIMER_CLEAR_PPI);

Expand Down Expand Up @@ -305,7 +304,8 @@ static inline void hal_sw_switch_timer_clear_ppi_config(void)
* Note: we do not need an additional PPI, since we have already set up
* a PPI to publish RADIO END event.
*/
#define HAL_SW_SWITCH_GROUP_TASK_ENABLE_PPI_REGISTER_EVT (NRF_RADIO->NRF_RADIO_PUBLISH_PDU_END_EVT)
#define HAL_SW_SWITCH_GROUP_TASK_ENABLE_PPI_REGISTER_EVT \
(NRF_RADIO->HAL_RADIO_TIFS_DPPI_PUBLISH_END)
#define HAL_SW_SWITCH_GROUP_TASK_ENABLE_PPI_EVT \
(((HAL_SW_SWITCH_GROUP_TASK_ENABLE_PPI << \
RADIO_PUBLISH_END_CHIDX_Pos) \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,16 @@
/* Clear SW-switch timer on packet end:
* wire the RADIO EVENTS_END event to SW_SWITCH_TIMER TASKS_CLEAR task.
*
* Note: In case of HW TIFS support or single timer configuration we do not need
* an additional PPI, since we have already set up a PPI to publish RADIO END
* event. In other case separate PPI is used because packet end is marked by
* PHYEND event while last bit or CRC is marked by END event.
* Note: In case of single timer configuration we do not need an additional PPI,
* since we have already set up a PPI to publish RADIO END event. In other case
* separate PPI is used because packet end is marked by PHYEND event while last
* bit or CRC is marked by END event.
*/
#if !defined(CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER)
#define HAL_SW_SWITCH_TIMER_CLEAR_PPI 24
#else /* CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */
#if defined(CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER)
#define HAL_SW_SWITCH_TIMER_CLEAR_PPI HAL_RADIO_END_TIME_CAPTURE_PPI
#endif /* CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */
#else /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */
#define HAL_SW_SWITCH_TIMER_CLEAR_PPI 24
#endif /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */

/* Wire a SW SWITCH TIMER EVENTS_COMPARE[<cc_offset>] event
* to a PPI GROUP TASK DISABLE task (PPI group with index <index>).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ static inline void hal_radio_enable_on_tick_ppi_config_and_enable(uint8_t trx)
if (trx) {
nrf_ppi_channel_endpoint_setup(NRF_PPI,
HAL_RADIO_ENABLE_TX_ON_TICK_PPI,
(uint32_t)&(EVENT_TIMER->EVENTS_COMPARE[0]),
(uint32_t)&(EVENT_TIMER->EVENTS_COMPARE[HAL_EVENT_TIMER_TRX_CC_OFFSET]),
(uint32_t)&(NRF_RADIO->TASKS_TXEN));

#if defined(CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER)
Expand All @@ -80,7 +80,7 @@ static inline void hal_radio_enable_on_tick_ppi_config_and_enable(uint8_t trx)
} else {
nrf_ppi_channel_endpoint_setup(NRF_PPI,
HAL_RADIO_ENABLE_RX_ON_TICK_PPI,
(uint32_t)&(EVENT_TIMER->EVENTS_COMPARE[0]),
(uint32_t)&(EVENT_TIMER->EVENTS_COMPARE[HAL_EVENT_TIMER_TRX_CC_OFFSET]),
(uint32_t)&(NRF_RADIO->TASKS_RXEN));

#if defined(CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER)
Expand Down Expand Up @@ -122,7 +122,7 @@ static inline void hal_radio_recv_timeout_cancel_ppi_config(void)
NRF_PPI,
HAL_RADIO_RECV_TIMEOUT_CANCEL_PPI,
(uint32_t)&(NRF_RADIO->EVENTS_ADDRESS),
(uint32_t)&(EVENT_TIMER->TASKS_CAPTURE[1]));
(uint32_t)&(EVENT_TIMER->TASKS_CAPTURE[HAL_EVENT_TIMER_HCTO_CC_OFFSET]));
}

#endif /* (EVENT_TIMER_ID == 0) */
Expand All @@ -149,7 +149,7 @@ static inline void hal_radio_disable_on_hcto_ppi_config(void)
nrf_ppi_channel_endpoint_setup(
NRF_PPI,
HAL_RADIO_DISABLE_ON_HCTO_PPI,
(uint32_t)&(EVENT_TIMER->EVENTS_COMPARE[1]),
(uint32_t)&(EVENT_TIMER->EVENTS_COMPARE[HAL_EVENT_TIMER_HCTO_CC_OFFSET]),
(uint32_t)&(NRF_RADIO->TASKS_DISABLE));
}

Expand Down Expand Up @@ -177,8 +177,8 @@ static inline void hal_radio_end_time_capture_ppi_config(void)
nrf_ppi_channel_endpoint_setup(
NRF_PPI,
HAL_RADIO_END_TIME_CAPTURE_PPI,
(uint32_t)&(NRF_RADIO->NRF_RADIO_TRX_END_EVENT),
(uint32_t)&(EVENT_TIMER->TASKS_CAPTURE[2]));
(uint32_t)&(NRF_RADIO->HAL_RADIO_TRX_EVENTS_END),
(uint32_t)&(EVENT_TIMER->TASKS_CAPTURE[HAL_EVENT_TIMER_TRX_END_CC_OFFSET]));
}

#endif /* (EVENT_TIMER_ID == 0) */
Expand Down Expand Up @@ -207,7 +207,7 @@ static inline void hal_radio_ready_time_capture_ppi_config(void)
NRF_PPI,
HAL_RADIO_READY_TIME_CAPTURE_PPI,
(uint32_t)&(NRF_RADIO->EVENTS_READY),
(uint32_t)&(EVENT_TIMER->TASKS_CAPTURE[0]));
(uint32_t)&(EVENT_TIMER->TASKS_CAPTURE[HAL_EVENT_TIMER_TRX_CC_OFFSET]));
}

/*******************************************************************************
Expand Down Expand Up @@ -303,7 +303,7 @@ static inline void hal_sw_switch_timer_clear_ppi_config(void)
nrf_ppi_channel_endpoint_setup(
NRF_PPI,
HAL_SW_SWITCH_TIMER_CLEAR_PPI,
(uint32_t)&(NRF_RADIO->NRF_RADIO_TRX_END_EVENT),
(uint32_t)&(NRF_RADIO->HAL_RADIO_TRX_EVENTS_END),
(uint32_t)&(SW_SWITCH_TIMER->TASKS_CLEAR));
}

Expand Down Expand Up @@ -364,7 +364,7 @@ static inline void hal_sw_switch_timer_clear_ppi_config(void)
* 'index' must be 0 or 1.
*/
#define HAL_SW_SWITCH_GROUP_TASK_ENABLE_PPI_EVT \
((uint32_t)&(NRF_RADIO->NRF_RADIO_TRX_END_EVENT))
((uint32_t)&(NRF_RADIO->HAL_RADIO_TRX_EVENTS_END))
#define HAL_SW_SWITCH_GROUP_TASK_ENABLE_PPI_TASK(index) \
((uint32_t)&(NRF_PPI->TASKS_CHG[SW_SWITCH_TIMER_TASK_GROUP(index)].EN))

Expand Down
Loading

0 comments on commit 06b7503

Please sign in to comment.