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

confusing gpiote sdk driver

Hi Nordic,
I've read chapters of GPIOTE/PPI in the reference manual of nRF51_Series, and have a basic understanding of these modules. But when I tried to read the SDK code v10.0.0, I'm puzzled. I see APIs in Nrf_drv_gpiote.c like:

 1. __STATIC_INLINE bool pin_in_use_by_gpiote(uint32_t pin);
 2. __STATIC_INLINE bool pin_in_use_by_port(uint32_t pin);
 3. __STATIC_INLINE bool pin_in_use_by_te(uint32_t pin);

I can understand _by_port and _by_gpiote, but I still cannot understand _by_te, what's that mean? No helpful comments available.

There is another question about gpiote API, see below:

__STATIC_INLINE void pin_in_use_by_te_set(uint32_t pin,
                                          uint32_t channel_id,
                                          nrf_drv_gpiote_evt_handler_t handler,
                                          bool is_channel)
{
    m_cb.pin_assignments[pin] = channel_id;
    m_cb.handlers[channel_id] = handler;
    if (!is_channel)
    {
        m_cb.port_handlers_pins[channel_id-NUMBER_OF_GPIO_TE] = (int8_t)pin;
    }
}

I'm totally puzzled with the difference of channle_id and pin variable, still no comments available for the API. BTW, I'm personally think that the SDK driver is a little too complicated and not clear.

Need your kindly help, thanks!
Best regards!

Parents Reply Children
No Data
Related