@@ -79,9 +79,6 @@ BUILD_ASSERT(NRF_DT_GPIOTE_INST(FEM_NODE, HAL_RADIO_GPIO_PA_PROP) ==
79
79
static const nrfx_gpiote_t gpiote_pdn = NRFX_GPIOTE_INSTANCE (
80
80
NRF_DT_GPIOTE_INST (FEM_NODE , pdn_gpios ));
81
81
static uint8_t gpiote_ch_pdn ;
82
- static const nrfx_gpiote_t gpiote_csn = NRFX_GPIOTE_INSTANCE (
83
- NRF_DT_GPIOTE_INST (DT_BUS (FEM_SPI_DEV_NODE ), cs_gpios ));
84
- static uint8_t gpiote_ch_csn ;
85
82
#endif
86
83
87
84
/* These headers require the above gpiote-related variables to be declared. */
@@ -134,20 +131,6 @@ BUILD_ASSERT(!BAD_FLAGS(NRF_GPIO_LNA_FLAGS),
134
131
NRF_DT_CHECK_GPIO_CTLR_IS_SOC (FEM_NODE , pdn_gpios , "pdn-gpios" );
135
132
#endif /* DT_NODE_HAS_PROP(FEM_NODE, pdn_gpios) */
136
133
137
- /* CSN is special because it comes from the spi-if property. */
138
- #if defined(HAL_RADIO_FEM_NRF21540_HAS_CSN )
139
- #define NRF_GPIO_CSN_CTLR DT_SPI_DEV_CS_GPIOS_CTLR(FEM_SPI_DEV_NODE)
140
- #define NRF_GPIO_CSN ((NRF_GPIO_Type *)DT_REG_ADDR(NRF_GPIO_CSN_CTLR))
141
- #define NRF_GPIO_CSN_PIN DT_SPI_DEV_CS_GPIOS_PIN(FEM_SPI_DEV_NODE)
142
- #define NRF_GPIO_CSN_FLAGS DT_SPI_DEV_CS_GPIOS_FLAGS(FEM_SPI_DEV_NODE)
143
- #define NRF_GPIO_CSN_PSEL (NRF_GPIO_CSN_PIN + \
144
- (DT_PROP(NRF_GPIO_CSN_CTLR, port) << 5))
145
- BUILD_ASSERT (DT_NODE_HAS_COMPAT (NRF_GPIO_CSN_CTLR , nordic_nrf_gpio ),
146
- "fem node " DT_NODE_PATH (FEM_NODE ) " has a spi-if property, "
147
- " but the chip select pin is not on the SoC. Check cs-gpios in "
148
- DT_NODE_PATH (DT_BUS (FEM_SPI_DEV_NODE )));
149
- #endif /* HAL_RADIO_FEM_NRF21540_HAS_CSN */
150
-
151
134
#endif /* HAL_RADIO_FEM_IS_NRF21540 */
152
135
153
136
/* CTEINLINE S0_MASK for periodic advertising PUDs. It allows to accept all types of extended
@@ -208,15 +191,6 @@ void radio_setup(void)
208
191
}
209
192
#endif /* NRF_GPIO_PDN_PIN */
210
193
211
- #if defined(NRF_GPIO_CSN_PIN )
212
- NRF_GPIO_CSN -> DIRSET = BIT (NRF_GPIO_CSN_PIN );
213
- if (ACTIVE_LOW (NRF_GPIO_CSN_FLAGS )) {
214
- NRF_GPIO_CSN -> OUTSET = BIT (NRF_GPIO_CSN_PIN );
215
- } else {
216
- NRF_GPIO_CSN -> OUTCLR = BIT (NRF_GPIO_CSN_PIN );
217
- }
218
- #endif /* NRF_GPIO_CSN_PIN */
219
-
220
194
hal_radio_ram_prio_setup ();
221
195
}
222
196
@@ -1841,12 +1815,6 @@ int radio_gpio_pa_lna_init(void)
1841
1815
}
1842
1816
#endif
1843
1817
1844
- #if defined(NRF_GPIO_CSN_PIN )
1845
- if (nrfx_gpiote_channel_alloc (& gpiote_csn , & gpiote_ch_csn ) != NRFX_SUCCESS ) {
1846
- return - ENOMEM ;
1847
- }
1848
- #endif
1849
-
1850
1818
return 0 ;
1851
1819
}
1852
1820
@@ -1859,10 +1827,6 @@ void radio_gpio_pa_lna_deinit(void)
1859
1827
#if defined(NRF_GPIO_PDN_PIN )
1860
1828
(void )nrfx_gpiote_channel_free (& gpiote_pdn , gpiote_ch_pdn );
1861
1829
#endif
1862
-
1863
- #if defined(NRF_GPIO_CSN_PIN )
1864
- (void )nrfx_gpiote_channel_free (& gpiote_csn , gpiote_ch_csn );
1865
- #endif
1866
1830
}
1867
1831
1868
1832
#if defined(HAL_RADIO_GPIO_HAVE_PA_PIN )
@@ -1881,7 +1845,6 @@ void radio_gpio_pa_setup(void)
1881
1845
#if defined(HAL_RADIO_FEM_IS_NRF21540 )
1882
1846
hal_pa_ppi_setup ();
1883
1847
radio_gpio_pdn_setup ();
1884
- radio_gpio_csn_setup ();
1885
1848
#endif
1886
1849
}
1887
1850
#endif /* HAL_RADIO_GPIO_HAVE_PA_PIN */
@@ -1902,7 +1865,6 @@ void radio_gpio_lna_setup(void)
1902
1865
#if defined(HAL_RADIO_FEM_IS_NRF21540 )
1903
1866
hal_lna_ppi_setup ();
1904
1867
radio_gpio_pdn_setup ();
1905
- radio_gpio_csn_setup ();
1906
1868
#endif
1907
1869
}
1908
1870
@@ -1922,22 +1884,6 @@ void radio_gpio_pdn_setup(void)
1922
1884
#endif /* NRF_GPIO_PDN_PIN */
1923
1885
}
1924
1886
1925
- void radio_gpio_csn_setup (void )
1926
- {
1927
- /* Note: the spi-if property is optional. */
1928
- #if defined(NRF_GPIO_CSN_PIN )
1929
- gpiote_csn .p_reg -> CONFIG [gpiote_ch_csn ] =
1930
- (GPIOTE_CONFIG_MODE_Task <<
1931
- GPIOTE_CONFIG_MODE_Pos ) |
1932
- (NRF_GPIO_CSN_PSEL <<
1933
- GPIOTE_CONFIG_PSEL_Pos ) |
1934
- (GPIOTE_CONFIG_POLARITY_Toggle <<
1935
- GPIOTE_CONFIG_POLARITY_Pos ) |
1936
- (OUTINIT_INACTIVE (NRF_GPIO_CSN_FLAGS ) <<
1937
- GPIOTE_CONFIG_OUTINIT_Pos );
1938
- #endif /* NRF_GPIO_CSN_PIN */
1939
- }
1940
-
1941
1887
void radio_gpio_lna_on (void )
1942
1888
{
1943
1889
if (ACTIVE_LOW (NRF_GPIO_LNA_FLAGS )) {
@@ -1981,7 +1927,6 @@ void radio_gpio_pa_lna_disable(void)
1981
1927
BIT (HAL_DISABLE_FEM_PPI ));
1982
1928
gpiote_palna .p_reg -> CONFIG [gpiote_ch_palna ] = 0 ;
1983
1929
gpiote_pdn .p_reg -> CONFIG [gpiote_ch_pdn ] = 0 ;
1984
- gpiote_csn .p_reg -> CONFIG [gpiote_ch_csn ] = 0 ;
1985
1930
#else
1986
1931
hal_radio_nrf_ppi_channels_disable (BIT (HAL_ENABLE_PALNA_PPI ) |
1987
1932
BIT (HAL_DISABLE_PALNA_PPI ));
0 commit comments