Skip to content

Commit 613b999

Browse files
committed
[nrf fromlist] subsys: bluetooth: nordic: align to nrfx_gpiote with extracted cb
GPIOTE driver instances are no longer defined within nrfx. Upstream PR #: 98527 Signed-off-by: Nikodem Kastelik <[email protected]>
1 parent af54df3 commit 613b999

File tree

3 files changed

+23
-22
lines changed

3 files changed

+23
-22
lines changed

subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <soc.h>
1212

1313
#include <nrfx_gpiote.h>
14+
#include <gpiote_nrfx.h>
1415

1516
#include "util/mem.h"
1617

@@ -66,8 +67,8 @@ BUILD_ASSERT(!HAL_RADIO_GPIO_LNA_OFFSET_MISSING,
6667
#endif /* FEM_NODE */
6768

6869
#if defined(HAL_RADIO_GPIO_HAVE_PA_PIN) || defined(HAL_RADIO_GPIO_HAVE_LNA_PIN)
69-
static const nrfx_gpiote_t gpiote_palna = NRFX_GPIOTE_INSTANCE(
70-
NRF_DT_GPIOTE_INST(FEM_NODE, HAL_RADIO_GPIO_PA_PROP));
70+
static nrfx_gpiote_t * const gpiote_palna =
71+
&GPIOTE_NRFX_INST_BY_NODE(NRF_DT_GPIOTE_NODE(FEM_NODE, HAL_RADIO_GPIO_PA_PROP));
7172
static uint8_t gpiote_ch_palna;
7273

7374
BUILD_ASSERT(NRF_DT_GPIOTE_INST(FEM_NODE, HAL_RADIO_GPIO_PA_PROP) ==
@@ -77,8 +78,8 @@ BUILD_ASSERT(NRF_DT_GPIOTE_INST(FEM_NODE, HAL_RADIO_GPIO_PA_PROP) ==
7778
#endif
7879

7980
#if defined(HAL_RADIO_FEM_IS_NRF21540)
80-
static const nrfx_gpiote_t gpiote_pdn = NRFX_GPIOTE_INSTANCE(
81-
NRF_DT_GPIOTE_INST(FEM_NODE, pdn_gpios));
81+
static nrfx_gpiote_t * const gpiote_pdn =
82+
&GPIOTE_NRFX_INST_BY_NODE(NRF_DT_GPIOTE_NODE(FEM_NODE, pdn_gpios));
8283
static uint8_t gpiote_ch_pdn;
8384
#endif
8485

@@ -1930,13 +1931,13 @@ uint32_t radio_tmr_sample_get(void)
19301931
int radio_gpio_pa_lna_init(void)
19311932
{
19321933
#if defined(HAL_RADIO_GPIO_HAVE_PA_PIN) || defined(HAL_RADIO_GPIO_HAVE_LNA_PIN)
1933-
if (nrfx_gpiote_channel_alloc(&gpiote_palna, &gpiote_ch_palna) != NRFX_SUCCESS) {
1934+
if (nrfx_gpiote_channel_alloc(gpiote_palna, &gpiote_ch_palna) != NRFX_SUCCESS) {
19341935
return -ENOMEM;
19351936
}
19361937
#endif
19371938

19381939
#if defined(NRF_GPIO_PDN_PIN)
1939-
if (nrfx_gpiote_channel_alloc(&gpiote_pdn, &gpiote_ch_pdn) != NRFX_SUCCESS) {
1940+
if (nrfx_gpiote_channel_alloc(gpiote_pdn, &gpiote_ch_pdn) != NRFX_SUCCESS) {
19401941
return -ENOMEM;
19411942
}
19421943
#endif
@@ -1947,18 +1948,18 @@ int radio_gpio_pa_lna_init(void)
19471948
void radio_gpio_pa_lna_deinit(void)
19481949
{
19491950
#if defined(HAL_RADIO_GPIO_HAVE_PA_PIN) || defined(HAL_RADIO_GPIO_HAVE_LNA_PIN)
1950-
(void)nrfx_gpiote_channel_free(&gpiote_palna, gpiote_ch_palna);
1951+
(void)nrfx_gpiote_channel_free(gpiote_palna, gpiote_ch_palna);
19511952
#endif
19521953

19531954
#if defined(NRF_GPIO_PDN_PIN)
1954-
(void)nrfx_gpiote_channel_free(&gpiote_pdn, gpiote_ch_pdn);
1955+
(void)nrfx_gpiote_channel_free(gpiote_pdn, gpiote_ch_pdn);
19551956
#endif
19561957
}
19571958

19581959
#if defined(HAL_RADIO_GPIO_HAVE_PA_PIN)
19591960
void radio_gpio_pa_setup(void)
19601961
{
1961-
gpiote_palna.p_reg->CONFIG[gpiote_ch_palna] =
1962+
gpiote_palna->p_reg->CONFIG[gpiote_ch_palna] =
19621963
(GPIOTE_CONFIG_MODE_Task <<
19631964
GPIOTE_CONFIG_MODE_Pos) |
19641965
(NRF_GPIO_PA_PSEL <<
@@ -1978,7 +1979,7 @@ void radio_gpio_pa_setup(void)
19781979
#if defined(HAL_RADIO_GPIO_HAVE_LNA_PIN)
19791980
void radio_gpio_lna_setup(void)
19801981
{
1981-
gpiote_palna.p_reg->CONFIG[gpiote_ch_palna] =
1982+
gpiote_palna->p_reg->CONFIG[gpiote_ch_palna] =
19821983
(GPIOTE_CONFIG_MODE_Task <<
19831984
GPIOTE_CONFIG_MODE_Pos) |
19841985
(NRF_GPIO_LNA_PSEL <<
@@ -1998,7 +1999,7 @@ void radio_gpio_pdn_setup(void)
19981999
{
19992000
/* Note: the pdn-gpios property is optional. */
20002001
#if defined(NRF_GPIO_PDN)
2001-
gpiote_pdn.p_reg->CONFIG[gpiote_ch_pdn] =
2002+
gpiote_pdn->p_reg->CONFIG[gpiote_ch_pdn] =
20022003
(GPIOTE_CONFIG_MODE_Task <<
20032004
GPIOTE_CONFIG_MODE_Pos) |
20042005
(NRF_GPIO_PDN_PSEL <<
@@ -2052,12 +2053,12 @@ void radio_gpio_pa_lna_disable(void)
20522053
BIT(HAL_DISABLE_PALNA_PPI) |
20532054
BIT(HAL_ENABLE_FEM_PPI) |
20542055
BIT(HAL_DISABLE_FEM_PPI));
2055-
gpiote_palna.p_reg->CONFIG[gpiote_ch_palna] = 0;
2056-
gpiote_pdn.p_reg->CONFIG[gpiote_ch_pdn] = 0;
2056+
gpiote_palna->p_reg->CONFIG[gpiote_ch_palna] = 0;
2057+
gpiote_pdn->p_reg->CONFIG[gpiote_ch_pdn] = 0;
20572058
#else
20582059
hal_radio_nrf_ppi_channels_disable(BIT(HAL_ENABLE_PALNA_PPI) |
20592060
BIT(HAL_DISABLE_PALNA_PPI));
2060-
gpiote_palna.p_reg->CONFIG[gpiote_ch_palna] = 0;
2061+
gpiote_palna->p_reg->CONFIG[gpiote_ch_palna] = 0;
20612062
#endif
20622063
}
20632064
#endif /* HAL_RADIO_GPIO_HAVE_PA_PIN || HAL_RADIO_GPIO_HAVE_LNA_PIN */

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ static inline void hal_palna_ppi_setup(void)
1818
nrf_gpiote_task_t task;
1919

2020
task = nrf_gpiote_out_task_get(gpiote_ch_palna);
21-
nrf_gpiote_subscribe_set(gpiote_palna.p_reg, task, HAL_DISABLE_PALNA_PPI);
21+
nrf_gpiote_subscribe_set(gpiote_palna->p_reg, task, HAL_DISABLE_PALNA_PPI);
2222
#endif
2323
}
2424
#endif /* defined(HAL_RADIO_GPIO_HAVE_PA_PIN) || defined(HAL_RADIO_GPIO_HAVE_LNA_PIN) */
@@ -44,14 +44,14 @@ static inline void hal_gpiote_tasks_setup(NRF_GPIOTE_Type *gpiote,
4444

4545
static inline void hal_pa_ppi_setup(void)
4646
{
47-
hal_gpiote_tasks_setup(gpiote_palna.p_reg, gpiote_ch_palna,
47+
hal_gpiote_tasks_setup(gpiote_palna->p_reg, gpiote_ch_palna,
4848
IS_ENABLED(HAL_RADIO_GPIO_PA_POL_INV),
4949
HAL_ENABLE_PALNA_PPI, HAL_DISABLE_PALNA_PPI);
5050
}
5151

5252
static inline void hal_lna_ppi_setup(void)
5353
{
54-
hal_gpiote_tasks_setup(gpiote_palna.p_reg, gpiote_ch_palna,
54+
hal_gpiote_tasks_setup(gpiote_palna->p_reg, gpiote_ch_palna,
5555
IS_ENABLED(HAL_RADIO_GPIO_LNA_POL_INV),
5656
HAL_ENABLE_PALNA_PPI, HAL_DISABLE_PALNA_PPI);
5757
}
@@ -63,7 +63,7 @@ static inline void hal_fem_ppi_setup(void)
6363
nrf_radio_publish_set(NRF_RADIO, NRF_RADIO_EVENT_DISABLED,
6464
HAL_DISABLE_FEM_PPI);
6565

66-
hal_gpiote_tasks_setup(gpiote_pdn.p_reg, gpiote_ch_pdn,
66+
hal_gpiote_tasks_setup(gpiote_pdn->p_reg, gpiote_ch_pdn,
6767
IS_ENABLED(HAL_RADIO_GPIO_NRF21540_PDN_POL_INV),
6868
HAL_ENABLE_FEM_PPI, HAL_DISABLE_FEM_PPI);
6969
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ static inline void hal_palna_ppi_setup(void)
1313
NRF_PPI,
1414
HAL_ENABLE_PALNA_PPI,
1515
(uint32_t)&(EVENT_TIMER->EVENTS_COMPARE[2]),
16-
(uint32_t)&(gpiote_palna.p_reg->TASKS_OUT[gpiote_ch_palna]));
16+
(uint32_t)&(gpiote_palna->p_reg->TASKS_OUT[gpiote_ch_palna]));
1717
nrf_ppi_channel_endpoint_setup(
1818
NRF_PPI,
1919
HAL_DISABLE_PALNA_PPI,
2020
(uint32_t)&(NRF_RADIO->EVENTS_DISABLED),
21-
(uint32_t)&(gpiote_palna.p_reg->TASKS_OUT[gpiote_ch_palna]));
21+
(uint32_t)&(gpiote_palna->p_reg->TASKS_OUT[gpiote_ch_palna]));
2222
}
2323
#endif /* defined(HAL_RADIO_GPIO_HAVE_PA_PIN) || defined(HAL_RADIO_GPIO_HAVE_LNA_PIN) */
2424

@@ -40,12 +40,12 @@ static inline void hal_fem_ppi_setup(void)
4040
NRF_PPI,
4141
HAL_ENABLE_FEM_PPI,
4242
(uint32_t)&(EVENT_TIMER->EVENTS_COMPARE[3]),
43-
(uint32_t)&(gpiote_pdn.p_reg->TASKS_OUT[gpiote_ch_pdn]));
43+
(uint32_t)&(gpiote_pdn->p_reg->TASKS_OUT[gpiote_ch_pdn]));
4444
nrf_ppi_channel_endpoint_setup(
4545
NRF_PPI,
4646
HAL_DISABLE_FEM_PPI,
4747
(uint32_t)&(NRF_RADIO->EVENTS_DISABLED),
48-
(uint32_t)&(gpiote_pdn.p_reg->TASKS_OUT[gpiote_ch_pdn]));
48+
(uint32_t)&(gpiote_pdn->p_reg->TASKS_OUT[gpiote_ch_pdn]));
4949
}
5050

5151
#endif /* HAL_RADIO_FEM_IS_NRF21540 */

0 commit comments

Comments
 (0)