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
Hi,
as I understand these functions, nrf_drv_gpiote_out_task_addr_get() gives the address of the OUT task. And the OUT task can be configured to toggle, set or clear a pin. But there are also dedicated SET and CLR tasks with their own address for PPI usage. I need these addresses in PPI to configure different events triggering set and clear tasks through the same GPIOTE channel. This seems to work if I enter the addresses manually, but I could'nt find any function to get these addresses in the SDK.
Can you post an example of how you do it with entering the address manually? And explain in more detail what you try to achieve?
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.