How can set the GPIO pin to output high or low?

I define a P_RST at jetson tx1,I need set it to output ,and i need set it to high or low,
How can set the GPIO pin to output high or low?

#define P_RST TEGRA_GPIO(S, 4)

sensor_test,

Please make sure that pin is not in use.

sudo -s
cd /sys/class/gpio
#identify the number of GPIO(S,4)
echo <your number> > export 
cd gpiochip<your number>
echo out > direction && echo 1 > value #(as output high)

Hi sensor_test,

Check out this github repo and this article for interacting with the GPIO from C.

Can you help me understand the TEGRA_GPIO(bank, offset) macro? Which pin does TEGRA_GPIO(S, 4) refer to? I can’t seem to find any documentation or cross-references relating it to the pinmux tables.