Hello everyone,
I have a NXP/Freescale Sabre Board with i.MX6 and I run Linaro.
Question:
Has someone tried to control a Pin or any other hardware function over the UNIX-port (controller no matter)?
Anyone a idea to get this working?
I read something about "Linux Device Tree", is that the right way?
thanks in advance
UNIX-port and GPIO's?
Re: UNIX-port and GPIO's?
I think that in the true UNIX fashion, all those pins are exposed as files in the /dev subsystem, so you should be able to control them using regular file operations. Then again, not sure if this is the most efficient way of doing it.
Re: UNIX-port and GPIO's?
I've done it with non-micro python.
Under Linux, you write the ID of the GPIOs to export into /sys/class/gpio/export. In this context, "export" means from kernel-control to control of user processes.
Then files appear under /sys/class/gpio/gpioN (where N is the ID)
There are a bunch of other pseudo-files in there, which control the GPIO direction and output.
It's not the most efficient way, but it should work across different Linux GPIO implementations.
Under Linux, you write the ID of the GPIOs to export into /sys/class/gpio/export. In this context, "export" means from kernel-control to control of user processes.
Then files appear under /sys/class/gpio/gpioN (where N is the ID)
There are a bunch of other pseudo-files in there, which control the GPIO direction and output.
It's not the most efficient way, but it should work across different Linux GPIO implementations.
Re: UNIX-port and GPIO's?
You'll find documentation for sysfs access to gpio pins here:
https://www.kernel.org/doc/Documentation/gpio/sysfs.txt
https://www.kernel.org/doc/Documentation/gpio/sysfs.txt
Re: UNIX-port and GPIO's?
For example: http://forum.micropython.org/viewtopic. ... 137#p10744Tetraeder wrote: Has someone tried
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Re: UNIX-port and GPIO's?
thanks for the hints!!
Regarding "GPIO Sysfs Interface":
Also a good reference for setting GPIO's from User Space http://falsinsoft.blogspot.nl/2012/11/a ... space.html
It's works with my other Board, Phytec phyBOATD-Wega-AM335x, with kernel version 3.12.61 but with my i.MX6 board i can't control the output state, only read out the input state is possible. Well I keep trying.
NOTE
example to calculate the GPIO ID:
In my case every port has 32 pin's
Port=3
Pin=6
Port number * 32 + Pin = 3 x 32 + 6 = 106 = ID
Regarding "GPIO Sysfs Interface":
Also a good reference for setting GPIO's from User Space http://falsinsoft.blogspot.nl/2012/11/a ... space.html
It's works with my other Board, Phytec phyBOATD-Wega-AM335x, with kernel version 3.12.61 but with my i.MX6 board i can't control the output state, only read out the input state is possible. Well I keep trying.
NOTE
example to calculate the GPIO ID:
In my case every port has 32 pin's
Port=3
Pin=6
Port number * 32 + Pin = 3 x 32 + 6 = 106 = ID