In the nrf_drv_gpiote in SDK 11.0, I can only find a function to get the address of the out task for a gpiote channel. Shouldn't there be a similar function to get the addresses of the set and clear tasks, or am I missing something?
In the nrf_drv_gpiote in SDK 11.0, I can only find a function to get the address of the out task for a gpiote channel. Shouldn't there be a similar function to get the addresses of the set and clear tasks, or am I missing something?
Hi,
The function nrf_drv_gpiote_out_task_addr_get()
return the address of the task, which you can use to configure PPI or control the task manually. You can take a look at the function led_blinking_setup()
in the GPIOTE example. Here GPIOTE is used to connect a timer to a GPIO port, using PPI, to toggle a LED. Toggle is selected by configuring the GPIOTE pin using GPIOTE_CONFIG_OUT_TASK_TOGGLE
. It would also have been possible to set or clear the GPIO by configuring the pin using GPIOTE_CONFIG_OUT_TASK_LOW
or GPIOTE_CONFIG_OUT_TASK_HIGH
.
Best regards,
Jørgen
I ran across this same problem and also noticed that the nrf_drv_gpio_ driver doesn't address those set and clr tasks. I just managed to successfully use this as a way to get those addresses:
uint32 pin_out_task_addr = nrf_drv_gpiote_out_task_addr_get(PIN_OUT);
uint32 pin_set_task_addr = pin_out_task_addr + 0x30;
uint32 pin_clear_task_addr = pin_out_task_addr + 0x60;
Ie, just adding the register offsets from here:
infocenter.nordicsemi.com/index.jsp
It's not a perfect method, but is working great for me.
I ran across this same problem and also noticed that the nrf_drv_gpio_ driver doesn't address those set and clr tasks. I just managed to successfully use this as a way to get those addresses:
uint32 pin_out_task_addr = nrf_drv_gpiote_out_task_addr_get(PIN_OUT);
uint32 pin_set_task_addr = pin_out_task_addr + 0x30;
uint32 pin_clear_task_addr = pin_out_task_addr + 0x60;
Ie, just adding the register offsets from here:
infocenter.nordicsemi.com/index.jsp
It's not a perfect method, but is working great for me.