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
  • Thanks Hakon for your excellent reply.  This makes a lot of sense.    

    I had managed to get an event to occur and print something out the UART when a pin changed, but was mystified how it does it.  I used the nrf_drv_gpiote driver functions in the SDK.  I'm trying to start from an SDK example and modify it for our application.  So understanding how things actually work is very useful.

    In the meantime I had traced through the code for the nrf gpiote driver and saw that the event handler function pointer ends up in an array of function pointers in a gpiote_control_block_t structure, not in the IN[n] register.  So there was a clue!

    I found the level of abstraction in the GPIOTE driver documentation so high that I couldn't understand at all what it was doing.  Therefore I had a look at the nRF51 hardware reference manual and came up against a brick wall.  Your answer has clarified everything.

    I would suggest a couple of things in the nRF51 Reference Manual:

    1. In CH15 CPIO Task and Events there should be register descriptions for the IN[n] and OUT[n] registers

    2. CH15 should include a reference to CH10 and in particular to 10.1.3, and 10.1.4.

    Thanks for your help.  Now I won't be posting my other question: "What exactly are the GPIOTE OUT[n] registers?"

  • Hi,

     

    Thanks for the feedback, I'll make sure that this is reported back to our technical writers.

    The nRF5-series in general share similar peripherals, such as GPIOTE, so it could be beneficial to look at nRF52-series docs for it as well:

    https://infocenter.nordicsemi.com/topic/ps_nrf52840/gpiote.html?cp=4_0_0_5_9

    Kind regards,

    Håkon

Reply Children
No Data
Related