bluetooth: controller: nrf5: Reorder used PPI channels
The channels assigned to the controller are reordered so that the ones previously used and now available for other purposes have continuous numbers. When the controller can take advantage of the pre-programmed PPI channels (when TIMER0 is used as the event timer), the now free channels are 0-4, when it cannot, it is the channel 0. Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
This commit is contained in:
parent
589b65e72d
commit
4750cf3b7b
2 changed files with 35 additions and 35 deletions
|
@ -235,10 +235,10 @@ static int pwm_nrf5_sw_init(struct device *dev)
|
|||
}
|
||||
|
||||
#define PWM_0_MAP_SIZE 3
|
||||
/* NOTE: nRF51x BLE controller use HW tIFS hence using only PPI channels 0-6.
|
||||
/* NOTE: nRF51x BLE controller use HW tIFS hence using only PPI channels 1-6.
|
||||
* nRF52x BLE controller implements SW tIFS and uses addition 6 PPI channels.
|
||||
* Also, nRF52x requires one additional PPI channel for decryption rate boost.
|
||||
* Hence, nRF52x BLE controller uses PPI channels 0-13.
|
||||
* Hence, nRF52x BLE controller uses PPI channels 1-13.
|
||||
*
|
||||
* NOTE: If PA/LNA feature is enabled for nRF52x, then additional two PPI
|
||||
* channels 14-15 are used by BLE controller.
|
||||
|
|
|
@ -44,7 +44,7 @@ static inline void hal_radio_enable_on_tick_ppi_config_and_enable(u8_t trx)
|
|||
|
||||
#else
|
||||
|
||||
#define HAL_RADIO_ENABLE_ON_TICK_PPI 0
|
||||
#define HAL_RADIO_ENABLE_ON_TICK_PPI 1
|
||||
#define HAL_RADIO_ENABLE_TX_ON_TICK_PPI HAL_RADIO_ENABLE_ON_TICK_PPI
|
||||
#define HAL_RADIO_ENABLE_RX_ON_TICK_PPI HAL_RADIO_ENABLE_ON_TICK_PPI
|
||||
|
||||
|
@ -61,35 +61,6 @@ static inline void hal_radio_enable_on_tick_ppi_config_and_enable(u8_t trx)
|
|||
|
||||
#endif /* (EVENT_TIMER_ID == 0) */
|
||||
|
||||
/*******************************************************************************
|
||||
* Start event timer on RTC tick:
|
||||
* wire the RTC0 EVENTS_COMPARE[2] event to EVENT_TIMER TASKS_START task.
|
||||
*/
|
||||
#define HAL_EVENT_TIMER_START_PPI 1
|
||||
|
||||
static inline void hal_event_timer_start_ppi_config(void)
|
||||
{
|
||||
nrf_ppi_channel_endpoint_setup(
|
||||
HAL_EVENT_TIMER_START_PPI,
|
||||
(u32_t)&(NRF_RTC0->EVENTS_COMPARE[2]),
|
||||
(u32_t)&(EVENT_TIMER->TASKS_START));
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Capture event timer on Radio ready:
|
||||
* wire the RADIO EVENTS_READY event to the
|
||||
* EVENT_TIMER TASKS_CAPTURE[<radio ready timer>] task.
|
||||
*/
|
||||
#define HAL_RADIO_READY_TIME_CAPTURE_PPI 2
|
||||
|
||||
static inline void hal_radio_ready_time_capture_ppi_config(void)
|
||||
{
|
||||
nrf_ppi_channel_endpoint_setup(
|
||||
HAL_RADIO_READY_TIME_CAPTURE_PPI,
|
||||
(u32_t)&(NRF_RADIO->EVENTS_READY),
|
||||
(u32_t)&(EVENT_TIMER->TASKS_CAPTURE[0]));
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Capture event timer on Address reception:
|
||||
* wire the RADIO EVENTS_ADDRESS event to the
|
||||
|
@ -113,7 +84,7 @@ static inline void hal_radio_recv_timeout_cancel_ppi_config(void)
|
|||
|
||||
#else
|
||||
|
||||
#define HAL_RADIO_RECV_TIMEOUT_CANCEL_PPI 3
|
||||
#define HAL_RADIO_RECV_TIMEOUT_CANCEL_PPI 2
|
||||
|
||||
static inline void hal_radio_recv_timeout_cancel_ppi_config(void)
|
||||
{
|
||||
|
@ -148,7 +119,7 @@ static inline void hal_radio_disable_on_hcto_ppi_config(void)
|
|||
|
||||
#else
|
||||
|
||||
#define HAL_RADIO_DISABLE_ON_HCTO_PPI 4
|
||||
#define HAL_RADIO_DISABLE_ON_HCTO_PPI 3
|
||||
|
||||
static inline void hal_radio_disable_on_hcto_ppi_config(void)
|
||||
{
|
||||
|
@ -183,7 +154,7 @@ static inline void hal_radio_end_time_capture_ppi_config(void)
|
|||
|
||||
#else
|
||||
|
||||
#define HAL_RADIO_END_TIME_CAPTURE_PPI 5
|
||||
#define HAL_RADIO_END_TIME_CAPTURE_PPI 4
|
||||
|
||||
static inline void hal_radio_end_time_capture_ppi_config(void)
|
||||
{
|
||||
|
@ -195,6 +166,35 @@ static inline void hal_radio_end_time_capture_ppi_config(void)
|
|||
|
||||
#endif /* (EVENT_TIMER_ID == 0) */
|
||||
|
||||
/*******************************************************************************
|
||||
* Start event timer on RTC tick:
|
||||
* wire the RTC0 EVENTS_COMPARE[2] event to EVENT_TIMER TASKS_START task.
|
||||
*/
|
||||
#define HAL_EVENT_TIMER_START_PPI 5
|
||||
|
||||
static inline void hal_event_timer_start_ppi_config(void)
|
||||
{
|
||||
nrf_ppi_channel_endpoint_setup(
|
||||
HAL_EVENT_TIMER_START_PPI,
|
||||
(u32_t)&(NRF_RTC0->EVENTS_COMPARE[2]),
|
||||
(u32_t)&(EVENT_TIMER->TASKS_START));
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Capture event timer on Radio ready:
|
||||
* wire the RADIO EVENTS_READY event to the
|
||||
* EVENT_TIMER TASKS_CAPTURE[<radio ready timer>] task.
|
||||
*/
|
||||
#define HAL_RADIO_READY_TIME_CAPTURE_PPI 6
|
||||
|
||||
static inline void hal_radio_ready_time_capture_ppi_config(void)
|
||||
{
|
||||
nrf_ppi_channel_endpoint_setup(
|
||||
HAL_RADIO_READY_TIME_CAPTURE_PPI,
|
||||
(u32_t)&(NRF_RADIO->EVENTS_READY),
|
||||
(u32_t)&(EVENT_TIMER->TASKS_CAPTURE[0]));
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Trigger encryption task upon address reception:
|
||||
* wire the RADIO EVENTS_ADDRESS event to the CCM TASKS_CRYPT task.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue