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

nrf_gpiote_task_enable keeps triggering port event

In SDK 11.0 it seems that in case pin 31 is configured as a button (using port events), nrf_gpiote_task_enable keeps triggering the port event due too a work around for OUTINIT PAN.

Parents
  • The workaround is not needed for nRF52. The following implementation should be used:

    __STATIC_INLINE void nrf_gpiote_task_enable(uint32_t idx)
    {
        uint32_t final_config = NRF_GPIOTE->CONFIG[idx] | GPIOTE_CONFIG_MODE_Task;
    #ifdef NRF51
        /* Workaround for the OUTINIT PAN. When nrf_gpiote_task_config() is called a glitch happens
        on the GPIO if the GPIO in question is already assigned to GPIOTE and the pin is in the
        correct state in GPIOTE but not in the OUT register. */
        /* Configure channel to not existing, not connected to the pin, and configure as a tasks that will set it to proper level */
        NRF_GPIOTE->CONFIG[idx] = final_config | (((31) << GPIOTE_CONFIG_PSEL_Pos) & GPIOTE_CONFIG_PORT_PIN_Msk);
        __NOP();
        __NOP();
        __NOP();
    #endif
        NRF_GPIOTE->CONFIG[idx] = final_config;
    }
    

    This will be used in the next SDK release.

Reply Children
No Data
Related