I'm trying to use the Linux /sys/class/gpio interface described in the Red Pitaya Github repository. I can successfully export GPIO 907, 908, 909 and so on. Changing the direction works as well (e.g., "echo out > /sys/class/gpio/gpio908/direction"). Changing the value, however, does not work. When I write
Code: Select all
echo 1 > /sys/class/gpio/gpio908/value
Code: Select all
cat /sys/class/gpio/gpio908/value
I know of the hacky way of accessing the GPIOs via the redpitaya C library which works. However, I'd like to use the standard Linux interface for GPIO access since it makes my code more portable. Ideally, I'd also like to access the GPIOs in a Linux kernel module via gpio_request, gpio_direction_output, etc. How can that be achieved? Currently, I'm writing directly to a memory address (found in housekeeping.h) but that is not portable at all.
Thanks in advance!
~Frederik