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

Understanding sense mechanisms in GPIO HAL and GPIOTE driver

I am working on nRF51-DK with nRF51422 with softdevice S130 and SDK 12.3.0.

I see that GPIOTE driver provides sensing for signal transitions like NRF_GPIOTE_POLARITY_LOTOHI, NRF_GPIOTE_POLARITY_HITOLO, NRF_GPIOTE_POLARITY_TOGGLE. While GPIO HAL provides sensing signal level like NRF_GPIO_PIN_SENSE_LOW, NRF_GPIO_PIN_SENSE_HIGH. 

My question is when to use signal level sensing one signal transition sensing and vice versa ?

Also calling the functions nrf_drv_gpiote_in_event_enable and nrf_drv_gpiote_in_event_disable 

  • for a GPIO input pin configured with high accuracy (IN_Event), will enable/disable the interrupts
  • for a GPIO input pin configured with low accuracy (Port Event), will enable/disable the sense mechanism and will have no effect on interrupt as interrupt mechanism for Port event is always enabled

My question is if I use the low accuracy mode for a GPIO input pin, does disabling the sense mechanism via call to nrf_drv_gpiote_in_event_disable will not generate an interrupt even though interrupt is always enabled ?

Parents
  • Hello,

    The main difference between high accuracy enabled or not is that the high accuracy creates an event containing the pin number and push state, while the low accuracy just creates the event that "something happened", but you would have to read the state of the GPIO figure out what pin that triggered the event (but the driver typically does this for you).

    If you only need a few pins, you can use the hi_accuracy, but if you need a lot of pins, you need to use the false accuracy (as there is a limit for the number of hi accuracy pins).

    Best regards,

    Edvin

Reply
  • Hello,

    The main difference between high accuracy enabled or not is that the high accuracy creates an event containing the pin number and push state, while the low accuracy just creates the event that "something happened", but you would have to read the state of the GPIO figure out what pin that triggered the event (but the driver typically does this for you).

    If you only need a few pins, you can use the hi_accuracy, but if you need a lot of pins, you need to use the false accuracy (as there is a limit for the number of hi accuracy pins).

    Best regards,

    Edvin

Children
No Data
Related