@@ -620,7 +620,7 @@ uint32_t radio_is_done(void)
620
620
* Note: this depends on the function being called exactly once
621
621
* in the ISR function.
622
622
*/
623
- last_pdu_end_us += EVENT_TIMER -> CC [2 ];
623
+ last_pdu_end_us += EVENT_TIMER -> CC [HAL_EVENT_TIMER_TRX_END_CC_OFFSET ];
624
624
return 1 ;
625
625
} else {
626
626
return 0 ;
@@ -1362,7 +1362,7 @@ uint32_t radio_tmr_start(uint8_t trx, uint32_t ticks_start, uint32_t remainder)
1362
1362
EVENT_TIMER -> PRESCALER = HAL_EVENT_TIMER_PRESCALER_VALUE ;
1363
1363
EVENT_TIMER -> BITMODE = 2 ; /* 24 - bit */
1364
1364
1365
- nrf_timer_cc_set (EVENT_TIMER , 0 , remainder );
1365
+ nrf_timer_cc_set (EVENT_TIMER , HAL_EVENT_TIMER_TRX_CC_OFFSET , remainder );
1366
1366
1367
1367
#if defined(CONFIG_BT_CTLR_NRF_GRTC )
1368
1368
uint32_t cntr_l , cntr_h , cntr_h_overflow , stale ;
@@ -1486,7 +1486,7 @@ uint32_t radio_tmr_start_tick(uint8_t trx, uint32_t ticks_start)
1486
1486
nrf_timer_task_trigger (EVENT_TIMER , NRF_TIMER_TASK_STOP );
1487
1487
nrf_timer_task_trigger (EVENT_TIMER , NRF_TIMER_TASK_CLEAR );
1488
1488
1489
- nrf_timer_cc_set (EVENT_TIMER , 0 , remainder_us );
1489
+ nrf_timer_cc_set (EVENT_TIMER , HAL_EVENT_TIMER_TRX_CC_OFFSET , remainder_us );
1490
1490
1491
1491
#if defined(CONFIG_BT_CTLR_NRF_GRTC )
1492
1492
uint32_t cntr_l , cntr_h , cntr_h_overflow , stale ;
@@ -1624,15 +1624,15 @@ uint32_t radio_tmr_start_us(uint8_t trx, uint32_t start_us)
1624
1624
actual_us += latency_us ;
1625
1625
#endif /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */
1626
1626
1627
- nrf_timer_event_clear (EVENT_TIMER , NRF_TIMER_EVENT_COMPARE0 );
1628
- nrf_timer_cc_set (EVENT_TIMER , 0 , actual_us );
1627
+ nrf_timer_event_clear (EVENT_TIMER , HAL_EVENT_TIMER_TRX_EVENT );
1628
+ nrf_timer_cc_set (EVENT_TIMER , HAL_EVENT_TIMER_TRX_CC_OFFSET , actual_us );
1629
1629
1630
1630
/* Capture the current time */
1631
- nrf_timer_task_trigger (EVENT_TIMER ,
1632
- HAL_EVENT_TIMER_SAMPLE_TASK );
1631
+ nrf_timer_task_trigger (EVENT_TIMER , HAL_EVENT_TIMER_SAMPLE_TASK );
1633
1632
1634
1633
now_us = EVENT_TIMER -> CC [HAL_EVENT_TIMER_SAMPLE_CC_OFFSET ];
1635
- } while ((now_us > start_us ) && (EVENT_TIMER -> EVENTS_COMPARE [0 ] == 0U ));
1634
+ } while ((now_us > start_us ) &&
1635
+ (EVENT_TIMER -> EVENTS_COMPARE [HAL_EVENT_TIMER_TRX_CC_OFFSET ] == 0U ));
1636
1636
1637
1637
return actual_us ;
1638
1638
}
@@ -1688,7 +1688,7 @@ void radio_tmr_stop(void)
1688
1688
1689
1689
void radio_tmr_hcto_configure (uint32_t hcto )
1690
1690
{
1691
- nrf_timer_cc_set (EVENT_TIMER , 1 , hcto );
1691
+ nrf_timer_cc_set (EVENT_TIMER , HAL_EVENT_TIMER_HCTO_CC_OFFSET , hcto );
1692
1692
1693
1693
hal_radio_recv_timeout_cancel_ppi_config ();
1694
1694
hal_radio_disable_on_hcto_ppi_config ();
@@ -1708,7 +1708,7 @@ void radio_tmr_aa_capture(void)
1708
1708
1709
1709
uint32_t radio_tmr_aa_get (void )
1710
1710
{
1711
- return EVENT_TIMER -> CC [1 ];
1711
+ return EVENT_TIMER -> CC [HAL_EVENT_TIMER_HCTO_CC_OFFSET ];
1712
1712
}
1713
1713
1714
1714
static uint32_t radio_tmr_aa ;
@@ -1726,7 +1726,7 @@ uint32_t radio_tmr_aa_restore(void)
1726
1726
1727
1727
uint32_t radio_tmr_ready_get (void )
1728
1728
{
1729
- return EVENT_TIMER -> CC [0 ];
1729
+ return EVENT_TIMER -> CC [HAL_EVENT_TIMER_TRX_CC_OFFSET ];
1730
1730
}
1731
1731
1732
1732
static uint32_t radio_tmr_ready ;
@@ -1765,7 +1765,7 @@ uint32_t radio_tmr_end_get(void)
1765
1765
#if defined(CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER )
1766
1766
return last_pdu_end_us ;
1767
1767
#else /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */
1768
- return EVENT_TIMER -> CC [2 ];
1768
+ return EVENT_TIMER -> CC [HAL_EVENT_TIMER_TRX_END_CC_OFFSET ];
1769
1769
#endif /* !CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER */
1770
1770
}
1771
1771
@@ -1909,9 +1909,10 @@ void radio_gpio_lna_off(void)
1909
1909
1910
1910
void radio_gpio_pa_lna_enable (uint32_t trx_us )
1911
1911
{
1912
- nrf_timer_cc_set (EVENT_TIMER , 2 , trx_us );
1912
+ nrf_timer_cc_set (EVENT_TIMER , HAL_EVENT_TIMER_PA_LNA_CC_OFFSET , trx_us );
1913
1913
#if defined(HAL_RADIO_FEM_IS_NRF21540 ) && DT_NODE_HAS_PROP (FEM_NODE , pdn_gpios )
1914
- nrf_timer_cc_set (EVENT_TIMER , 3 , (trx_us - NRF_GPIO_PDN_OFFSET ));
1914
+ nrf_timer_cc_set (EVENT_TIMER , HAL_EVENT_TIMER_PA_LNA_PDN_CC_OFFSET ,
1915
+ (trx_us - NRF_GPIO_PDN_OFFSET ));
1915
1916
hal_radio_nrf_ppi_channels_enable (BIT (HAL_ENABLE_PALNA_PPI ) |
1916
1917
BIT (HAL_DISABLE_PALNA_PPI ) |
1917
1918
BIT (HAL_ENABLE_FEM_PPI ) |
0 commit comments