Hello,
I am working on a project with the Onion Omega2S+ that requires the use of pin 33 (GPIO 6/SPI_CS1) to be used as a GPIO. However, the gpiomux default is to use the pin as SPI_CS1.
The overall goal is to be able to persistently use that pin as a GPIO, even after reboot. Additionally, I will be triggering the GPIO toggling through an embedded C program with the sysfs system. I have two possible solution paths that I've thought of, but don't know if possible to implement:
Ideal solution—Is it possible to accomplish the omega2-ctrl gpiomux set spi_cs1 gpio
command in a C program? Would a system()
call work (something like system(omega2-ctrl gpiomux set spi_cs1 gpio)
)? Is that the best way to accomplish it?
Secondary solution—If the above isn't possible, can I have the gpiomux command at least save my non-default setup so that it persists on reboot?
Thanks!