Is there a way to have 6 different GPIOs act in unison off one event/action? I need all 6 to go ON and OFF at EXACTLY the same time based of an event or action.
Is there a way to have 6 different GPIOs act in unison off one event/action? I need all 6 to go ON and OFF at EXACTLY the same time based of an event or action.
Hi Brian
The easiest way to do this is to write directly to the OUT, OUTSET or OUTCLR registers in the GPIO module. The last two in particular makes it very easy to set or clear multiple pins at the same time, simply by writing a pin mask into the register.
As an example, this code sets P0.02 and P0.05 at the same time:
NRF_GPIO->OUTSET = (1 << 2) | (1 << 5);
Best regards
Torbjørn
Hi Brian
The easiest way to do this is to write directly to the OUT, OUTSET or OUTCLR registers in the GPIO module. The last two in particular makes it very easy to set or clear multiple pins at the same time, simply by writing a pin mask into the register.
As an example, this code sets P0.02 and P0.05 at the same time:
NRF_GPIO->OUTSET = (1 << 2) | (1 << 5);
Best regards
Torbjørn