This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Correct way to disable GPIOTE channel via INTENCLR

Hi, i am trying to disable a signle GPIOTE channel via the INTENCLR. Here is a simple test case:

void gpiote_set_clr_test(void)
{
    NRF_GPIOTE->INTENSET |= ((1<<3) | (1<<1) | (1<<0));
    NRF_LOG_INFO("GPIOTE INTEN SET 0x%X\n",NRF_GPIOTE->INTENSET);
    NRF_LOG_INFO("GPIOTE INTEN CLR 0x%X\n",NRF_GPIOTE->INTENCLR);
    NRF_LOG_INFO("\n");
    NRF_GPIOTE->INTENCLR |= (1<<1); //disable channel 1 IRQ
    NRF_LOG_INFO("GPIOTE INTEN SET 0x%X\n",NRF_GPIOTE->INTENSET);
    NRF_LOG_INFO("GPIOTE INTEN CLR 0x%X\n",NRF_GPIOTE->INTENCLR);
}

and this is the output:


<info> app: GPIOTE INTEN SET 0xB

<info> app: GPIOTE INTEN CLR 0xB

<info> app:

<info> app: GPIOTE INTEN SET 0x0

<info> app: GPIOTE INTEN CLR 0x0

NRF_GPIOTE->INTENCLR |= (1<<1); //disable channel 1 IRQ

This line clears the whole INTENCLR register not just the channel 1's  bit.

Is this the expected behavior?

 

 

Related