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

GPIOTE IN[n] register description

What exactly are the GPIOTE IN[n] registers?

Is the IN[n] register a function pointer of a function to call when the the input condition occurs on the associated pin?  If so, does this function interrupt the current program execution?

Is it the interrupt handler when a GPIOTE interrupt occurs?

The nRF51 Reference Manual Ch15 GPIOTE Tasks and Events makes no mention exactly what IN[n] is.  It is a 32-bit register, with no register description.  The GPIOTE general description says an event is generated when a rising edge, falling edge or change occurs on a pin associated with a GPIOTE channel.  What exactly is an event?

Parents
  • Hi,

     

    What exactly are the GPIOTE IN[n] registers?

    This is an event, which can be read with NRF_GPIOTE->EVENTS_IN[n]. I would recommend looking at chapter 10.1.4 in the nRF51 Ref. Manual for generic information about events and tasks. 

    Is the IN[n] register a function pointer of a function to call when the the input condition occurs on the associated pin?  If so, does this function interrupt the current program execution?

     The value of the register would be either 0 or 1. The interrupt vector for the GPIOTE should then check all GPIOTE events that can occur, clear and run the code accordingly. 

    Is it the interrupt handler when a GPIOTE interrupt occurs?

    If INTENSET is enabled for the given event, and you have enabled the GPIOTE_IRQHandler in NVIC, yes. If you're using any helper-libraries or drivers for gpiote, then they handle this for you.

     

    The GPIOTE general description says an event is generated when a rising edge, falling edge or change occurs on a pin associated with a GPIOTE channel.  What exactly is an event?

    The IN channel can be configured as per the CONFIG register, and when that condition occurs, an event is signaled from the hardware peripheral to the CPU core, and if the IRQ is enabled; the CPU fires up that interrupt vector and executes it.

     

    Kind regards,

    Håkon

Reply
  • Hi,

     

    What exactly are the GPIOTE IN[n] registers?

    This is an event, which can be read with NRF_GPIOTE->EVENTS_IN[n]. I would recommend looking at chapter 10.1.4 in the nRF51 Ref. Manual for generic information about events and tasks. 

    Is the IN[n] register a function pointer of a function to call when the the input condition occurs on the associated pin?  If so, does this function interrupt the current program execution?

     The value of the register would be either 0 or 1. The interrupt vector for the GPIOTE should then check all GPIOTE events that can occur, clear and run the code accordingly. 

    Is it the interrupt handler when a GPIOTE interrupt occurs?

    If INTENSET is enabled for the given event, and you have enabled the GPIOTE_IRQHandler in NVIC, yes. If you're using any helper-libraries or drivers for gpiote, then they handle this for you.

     

    The GPIOTE general description says an event is generated when a rising edge, falling edge or change occurs on a pin associated with a GPIOTE channel.  What exactly is an event?

    The IN channel can be configured as per the CONFIG register, and when that condition occurs, an event is signaled from the hardware peripheral to the CPU core, and if the IRQ is enabled; the CPU fires up that interrupt vector and executes it.

     

    Kind regards,

    Håkon

Children
No Data
Related