Bluetooth: Controller: nRF54Lx: Use nrfx interface for bsim use (3/4)
Use nrfx interface for register access with sideeffects to facilitate bsim use. 4 part commits: 1. Add nrf_grtc interface. 2. Remove CMSIS interface use. 3. Add nrf_grtc interface, once missing bsim port available. 4. Remove CMSIS interface use, replaced by bsim port. Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
parent
d5e75ce755
commit
da6bd08df0
3 changed files with 13 additions and 0 deletions
|
@ -51,6 +51,7 @@
|
|||
|
||||
#if defined(CONFIG_BT_CTLR_NRF_GRTC)
|
||||
#include <hal/nrf_grtc.h>
|
||||
#include <hal/nrf_ppib.h>
|
||||
#else /* !CONFIG_BT_CTLR_NRF_GRTC */
|
||||
#include <hal/nrf_rtc.h>
|
||||
#endif /* !CONFIG_BT_CTLR_NRF_GRTC */
|
||||
|
|
|
@ -109,17 +109,25 @@ static inline void hal_event_timer_start_ppi_config(void)
|
|||
((GRTC_PUBLISH_COMPARE_EN_Enabled <<
|
||||
GRTC_PUBLISH_COMPARE_EN_Pos) &
|
||||
GRTC_PUBLISH_COMPARE_EN_Msk);
|
||||
nrf_grtc_publish_set(NRF_GRTC, HAL_CNTR_GRTC_EVENT_COMPARE_RADIO,
|
||||
HAL_EVENT_TIMER_START_PPI);
|
||||
|
||||
/* Enable same DPPI in Global domain */
|
||||
NRF_DPPIC20->CHENSET = BIT(HAL_EVENT_TIMER_START_PPI);
|
||||
nrf_dppi_channels_enable(NRF_DPPIC20,
|
||||
BIT(HAL_EVENT_TIMER_START_PPI));
|
||||
|
||||
/* Setup PPIB send subscribe */
|
||||
NRF_PPIB21->SUBSCRIBE_SEND[HAL_EVENT_TIMER_START_PPI] =
|
||||
BIT(HAL_EVENT_TIMER_START_PPI) | PPIB_SUBSCRIBE_SEND_EN_Msk;
|
||||
nrf_ppib_subscribe_set(NRF_PPIB21, HAL_PPIB_SEND_EVENT_TIMER_START_PPI,
|
||||
HAL_EVENT_TIMER_START_PPI);
|
||||
|
||||
/* Setup PPIB receive publish */
|
||||
NRF_PPIB11->PUBLISH_RECEIVE[HAL_EVENT_TIMER_START_PPI] =
|
||||
BIT(HAL_EVENT_TIMER_START_PPI) | PPIB_PUBLISH_RECEIVE_EN_Msk;
|
||||
nrf_ppib_publish_set(NRF_PPIB11, HAL_PPIB_RECEIVE_EVENT_TIMER_START_PPI,
|
||||
HAL_EVENT_TIMER_START_PPI);
|
||||
|
||||
#else /* !CONFIG_BT_CTLR_NRF_GRTC */
|
||||
nrf_rtc_publish_set(NRF_RTC, NRF_RTC_EVENT_COMPARE_2, HAL_EVENT_TIMER_START_PPI);
|
||||
|
|
|
@ -37,6 +37,10 @@
|
|||
* wire the RTC0 EVENTS_COMPARE[2] event to EVENT_TIMER TASKS_START task.
|
||||
*/
|
||||
#define HAL_EVENT_TIMER_START_PPI 7
|
||||
#define HAL_PPIB_SEND_EVENT_TIMER_START_PPI \
|
||||
_CONCAT(NRF_PPIB_TASK_SEND_, HAL_EVENT_TIMER_START_PPI)
|
||||
#define HAL_PPIB_RECEIVE_EVENT_TIMER_START_PPI \
|
||||
_CONCAT(NRF_PPIB_EVENT_RECEIVE_, HAL_EVENT_TIMER_START_PPI)
|
||||
|
||||
/*******************************************************************************
|
||||
* Capture event timer on Radio ready:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue