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

Pin pull configuration using app_gpiote_user_register

I'm attempting to make a sense of app_gpiote.c (in SDK 11) to see if it's suitable for my application and I can't find a match between the documentation, the sample code and the actual code in the library. I want to use it to handle toggle events coming from a pin that needs to be configured as NRF_GPIO_PIN_PULLUP. The documentation on app_gpiote clearly states that the burden of the port configuration is on the user with the exception of the sense configuration which is recommended to be set at disabled. The sample code on GitHub ( github.com/.../nrf51_app_gpiote_example ) does configure the port before calling app_gpiote_user_register (even if in the case of the example the sense is configured as low). Still if one looks at what app_gpiote_user_register works in app_gpiote.c, there is clearly const nrf_drv_gpiote_in_config_t config = GPIOTE_CONFIG_IN_SENSE_TOGGLE(false); for the pins of interest which, clearly again resolves in a configuration that is forced to NRF_GPIO_PIN_NOPULL.

I don't want to base my code on this just to discover that it doesn't work. Has anybody experience with this? If it works, how does it work?

Parents
  • By reading the app_gpiote documentation that you refer to, I suspect it is old information for the app_gpiote library and does not apply anymore. It is clear that app_gpiote_user_register function uses the GPIOTE_CONFIG_IN_SENSE_TOGGLE in nrf_drv_gpiote.h where sense is enabled. Thanks for pointing this out. I will ask for documentation correction or clarification.

    Yes, the GPIOTE_CONFIG_IN_SENSE_TOGGLE will configure the pin with no pull. To configure a pullup on the pin you need to explicitly set that, as done in the system_off_wakeup_on_gpiote example on Github or in the pin_change_int peripheral example in the SDK. For SDK 11, the app_gpiote library is however deprecated and you should use the nrf_drv_gpiote driver directly instead if you have a new design.

Reply
  • By reading the app_gpiote documentation that you refer to, I suspect it is old information for the app_gpiote library and does not apply anymore. It is clear that app_gpiote_user_register function uses the GPIOTE_CONFIG_IN_SENSE_TOGGLE in nrf_drv_gpiote.h where sense is enabled. Thanks for pointing this out. I will ask for documentation correction or clarification.

    Yes, the GPIOTE_CONFIG_IN_SENSE_TOGGLE will configure the pin with no pull. To configure a pullup on the pin you need to explicitly set that, as done in the system_off_wakeup_on_gpiote example on Github or in the pin_change_int peripheral example in the SDK. For SDK 11, the app_gpiote library is however deprecated and you should use the nrf_drv_gpiote driver directly instead if you have a new design.

Children
No Data
Related