Other Parts Discussed in Thread: SK-TDA4VM
Tool/software:
Hi,
I can set the direction of a GPIO in the terminal by directly writing to the GPIO_DIRXX register:
# set direction of GPIO0_15, 17, 19, 21 to output root@j722s-evm:~# devmem2 0x00600010 w 0xFFD757FF /dev/mem opened. Memory mapped at address 0xffffaa850000. Read at address 0x00600010 (0xffffaa850010): 0xFFFFFFFF Write at address 0x00600010 (0xffffaa850010): 0xFFD757FF, readback 0xFFD757FF
In the sysfs interface, I can do that in an application by writing to the direction directory.
... snprintf(buffer, sizeof(buffer), "/sys/class/gpio/gpio%d/direction", gpio); gpioSysDir = open(buffer, O_WRONLY); write(gpioSysDir, "out", strlen("out")); ...
How can I do the same (writing to GPIO_DIRXX, GPIO_SET_FAL_TRIGXX, etc..), in an application using the chardev interface?
Thank you,
Jin