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

Some questions about the nrf_drv_gpiote_in_config_t struct members.

Hello there,

I am experimenting with with the gpiote and ppi examples, and have a couple questions regarding the member variables of the nrf_drv_gpiote_in_config_t struct.

1) As I understand, the hi_accuracy mode uses the IN_EVENT interrupt, while not using hi_accuracy mode uses a lower frequency clock and fires a DETECT signal which can lead to a PORT interrupt. As all pins would fire an identical DETECT signal that is merged into one, this prevents us from detecting multiple input changes simultaneously. Is this understanding correct?

2) The comment associated with the is_watcher  variable is " True when the input pin is tracking an output pin. "  Could you elaborate on what this means?

3) What does the skip_gpio_setup variable do? Does it skip the default pull and sense configuration of the pin and leave them floating/unused?

Apologies if these seem like simple questions. 

Thank you,
Angry Oatmeal.

Parents
  • Hi,

    1) As I understand, the hi_accuracy mode uses the IN_EVENT interrupt, while not using hi_accuracy mode uses a lower frequency clock and fires a DETECT signal which can lead to a PORT interrupt. As all pins would fire an identical DETECT signal that is merged into one, this prevents us from detecting multiple input changes simultaneously. Is this understanding correct?

    Yes, that is correct. You must read the pin-state of all pins to know which pin(s) triggered the PORT event. The GPIO LATCH register will retain the detection of a SENSE match even after the pin has again changed its state.

    2) The comment associated with the is_watcher  variable is " True when the input pin is tracking an output pin. "  Could you elaborate on what this means?

    A pin configured as an output will not generate any events when it is toggled. If you want to monitor the state change of a GPIO, you can configure a second pin as watcher, and physically connect these two pins together. The is_watcher flag will simply limit the GPIO configuration to connect the input buffer, to prevent the pin from changing the load on the output pin.

    3) What does the skip_gpio_setup variable do? Does it skip the default pull and sense configuration of the pin and leave them floating/unused?

    Yes, this parameter will prevent configuration of the GPIO, leaving this to your application. This allows you to set you own desired configuration is place of the default one, for instance if you want to configure the GPIO for higher drive-strength, etc. If you set this parameter and does not configure the GPIO in your application, it will be left unconfigured/floating.

    Best regards,
    Jørgen

Reply
  • Hi,

    1) As I understand, the hi_accuracy mode uses the IN_EVENT interrupt, while not using hi_accuracy mode uses a lower frequency clock and fires a DETECT signal which can lead to a PORT interrupt. As all pins would fire an identical DETECT signal that is merged into one, this prevents us from detecting multiple input changes simultaneously. Is this understanding correct?

    Yes, that is correct. You must read the pin-state of all pins to know which pin(s) triggered the PORT event. The GPIO LATCH register will retain the detection of a SENSE match even after the pin has again changed its state.

    2) The comment associated with the is_watcher  variable is " True when the input pin is tracking an output pin. "  Could you elaborate on what this means?

    A pin configured as an output will not generate any events when it is toggled. If you want to monitor the state change of a GPIO, you can configure a second pin as watcher, and physically connect these two pins together. The is_watcher flag will simply limit the GPIO configuration to connect the input buffer, to prevent the pin from changing the load on the output pin.

    3) What does the skip_gpio_setup variable do? Does it skip the default pull and sense configuration of the pin and leave them floating/unused?

    Yes, this parameter will prevent configuration of the GPIO, leaving this to your application. This allows you to set you own desired configuration is place of the default one, for instance if you want to configure the GPIO for higher drive-strength, etc. If you set this parameter and does not configure the GPIO in your application, it will be left unconfigured/floating.

    Best regards,
    Jørgen

Children
Related