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

How to use GPIOTE driver

Hello,

I'm using SDK12.2.0.

I opened the PPI example (in SES). I want to use the GPIOTE driver to trigger GPIO tasks on Timer events. So I #include "drivers_nrf/gpiote/nrf_drv_gpiote.h" and included the file drivers_nrf/gpiote/nrf_drv_gpiote.c for compilation.

Trying to call nrf_drv_gpiote_init(); in main, the implementation wasn't found. I looked in nrf_drv_gpiote.c, where it has#if NRF_MODULE_ENABLED(GPIOTE) for the whole file. Looked at its definition, and it appears that I need GPIOTE_ENABLED = 1 in the project-wide preprocessor definitions.

The next problem is that on line 35 in nrf_drv_gpiote.c, I get this error: ‘GPIOTE_CONFIG_IRQ_PRIORITY’ undeclared here (not in a function).

And I'm not sure what to do now. I looked in infocenter, and couldn't find anything on having to define GPIOTE_ENABLED = 1 in order to use the gpiote driver, nor on GPIOTE_CONFIG_IRQ_PRIORITY.

I would expect all this to be documented somewhere else than implicitly in the implementation file. Have I overlooked something?

Parents Reply Children
  • Looked in the info center. I tried the "CMSIS Configuration Wizard", and opened the sdk_config.h file for the PPI example. But it seems rather minimal, and there is not GPIOTE option I can check. In for example the peripheral/blinky example, sdk_config.h is more than 3000 lines long. How can I properly enable GPIOTE in the PPI example? And when I start a new project, where can I get a full sdk_config.h as a starting point, that I can edit with the "CMSIS Configuration Wizard"?

  • What I do in such situation is manually (text mode) merge sdk_config.h files from different projects. Ex. take GPIOTE part from one project and PPI from the other.

    But there should be full sdk_config.h file somewhere - maybe someone from Nordic could help finding/creating it.

Related