How to operate the gpio

Yuan, Yao yao.yuan at hxt-semitech.com
Tue Dec 11 18:40:49 AEDT 2018


Hi All,

I have a scripts to enable console, it will write the gpio:
#Control UART mux for obmc-console-client
echo 325 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio325/direction
cat /sys/class/gpio/gpio325/direction
echo 0 > /sys/class/gpio/gpio325/value
obmc-console-client
echo 1 > /sys/class/gpio/gpio325/value

It seems very tedious that I have to do export every time in the scripts.

In openbmc, if I want to operate the gpio,
I have to
1, echo the gpio num to /sys.class/gpio/export
2, echo the direction to /sys.class/gpio/gpio*.direction
3, read or write the value from the value.

So it seems I need a script use to export some of the gpios at first?

And I also find a python scripts in obmc: gpioutil
But it need import obmc_system_config
>>> import obmc_system_config
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named obmc_system_config

Does anyone know how to install this module in obmc?

Or does anyone know a better way to operate the gpio?

Thanks.

Best Regards,
Yao.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20181211/480088d8/attachment.html>


More information about the openbmc mailing list