How to set two gpio at same time imx7d

I am working on some real time application where i have to set two gpio at the same time without any function call delay.
like we do in microcontrollers: P1OUT |= 0x3;

Could you please help me on this?

Thank you.

Hi @neeraj.verma

What exactly are your requirements?

Do you have to set the two GPIOs only once or regularly with a specified frequency?

Did you try already setting two pins one after one? Have you seen any delay?

Best regards,

Hi @jaski.tx ,
Exactly requirement is to control two pins (High to start two peripherals, Low to stop the same) but same time, based on the system condition (no frequency).
I used gpio export, direction, value to toggle, one after another I see around (50 us) time difference. it’s not always same, seems it depends on other code execution (7 uarts, few gpio as INT) and few timers.

Thank You

I used gpio export, direction, value to toggle, one after another

Which pins are you talking about? Are the pins on the same GPIO Bank?
You could try to export the pins before and do setting output afterwards.

Best regards,

Hi @jaski.tx,
These pins are GPIO1_IO0 and GPIO1_IO1 (SODIMM 43, 45), This approach worked for me, I see almost no time delay when I make all the settings ready before I set HIGH or low for both GPIOs, like below:
write(fd0, “1”, 1);
write(fd1, “1”, 1);

Thank you.

Perfect that it works. Thanks for the feedback.