drivers: gpio: nrfx: Use GPIOTE HAL for checking allocated channels
Replaces direct accesses to the peripheral registers structure with the proper GPIOTE HAL function added recently to nrfx. Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
This commit is contained in:
parent
1a8ac641d7
commit
61eb2a1c80
1 changed files with 1 additions and 5 deletions
|
@ -47,11 +47,7 @@ static inline const struct gpio_nrfx_cfg *get_port_cfg(struct device *port)
|
||||||
static int gpiote_channel_alloc(u32_t abs_pin, nrf_gpiote_polarity_t polarity)
|
static int gpiote_channel_alloc(u32_t abs_pin, nrf_gpiote_polarity_t polarity)
|
||||||
{
|
{
|
||||||
for (u8_t channel = 0; channel < GPIOTE_CH_NUM; ++channel) {
|
for (u8_t channel = 0; channel < GPIOTE_CH_NUM; ++channel) {
|
||||||
/* @TODO Add GPIOTE HAL function for checking
|
if (!nrf_gpiote_te_is_enabled(channel)) {
|
||||||
* if channel is enabled
|
|
||||||
*/
|
|
||||||
if ((NRF_GPIOTE->CONFIG[channel] & GPIOTE_CONFIG_MODE_Msk)
|
|
||||||
== GPIOTE_CONFIG_MODE_Disabled) {
|
|
||||||
nrf_gpiote_events_t evt =
|
nrf_gpiote_events_t evt =
|
||||||
offsetof(NRF_GPIOTE_Type, EVENTS_IN[channel]);
|
offsetof(NRF_GPIOTE_Type, EVENTS_IN[channel]);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue