Skip to content

Commit 35122d4

Browse files
cvinayakcarlescufi
authored andcommitted
Bluetooth: controller: GPIO PA/LNA support for nRF53x
Ported the GPIO PA/LNA support for nRF53x by using a DPPI channel. Fixes zephyrproject-rtos#24142. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent 0772890 commit 35122d4

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_dppi.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <hal/nrf_rtc.h>
1414
#include <hal/nrf_ccm.h>
1515
#include <hal/nrf_aar.h>
16+
#include <hal/nrf_gpiote.h>
1617

1718
static inline void hal_radio_nrf_ppi_channels_enable(uint32_t mask)
1819
{
@@ -168,6 +169,27 @@ static inline void hal_trigger_rateoverride_ppi_config(void)
168169
nrf_ccm_subscribe_set(NRF_CCM, NRF_CCM_TASK_RATEOVERRIDE, HAL_TRIGGER_RATEOVERRIDE_PPI);
169170
}
170171

172+
/******************************************************************************/
173+
#if defined(CONFIG_BT_CTLR_GPIO_PA_PIN) || defined(CONFIG_BT_CTLR_GPIO_LNA_PIN)
174+
175+
#define HAL_ENABLE_PALNA_PPI 5
176+
#define HAL_DISABLE_PALNA_PPI HAL_ENABLE_PALNA_PPI
177+
178+
static inline void hal_palna_ppi_setup(void)
179+
{
180+
nrf_gpiote_task_t task;
181+
182+
nrf_timer_publish_set(EVENT_TIMER, NRF_TIMER_EVENT_COMPARE2,
183+
HAL_ENABLE_PALNA_PPI);
184+
nrf_radio_publish_set(NRF_RADIO, NRF_RADIO_EVENT_DISABLED,
185+
HAL_DISABLE_PALNA_PPI);
186+
187+
task = nrf_gpiote_out_task_get(CONFIG_BT_CTLR_PA_LNA_GPIOTE_CHAN);
188+
nrf_gpiote_subscribe_set(NRF_GPIOTE, task, HAL_DISABLE_PALNA_PPI);
189+
}
190+
191+
#endif /* CONFIG_BT_CTLR_GPIO_PA_PIN || CONFIG_BT_CTLR_GPIO_LNA_PIN */
192+
171193
/******************************************************************************/
172194
#if !defined(CONFIG_BT_CTLR_TIFS_HW)
173195
/* DPPI setup used for SW-based auto-switching during TIFS. */

0 commit comments

Comments
 (0)