export GPIO

Posts: 1
Joined: Tue Mar 06, 2018 3:43 pm

export GPIO

Tue Mar 06, 2018 3:58 pm

VoCore2 has more than 40 GPIO.
I need 3 output pins and 1 input pin.

ls /sys/class/gpio
export gpio0 gpiochip0 gpiochip32 gpiochip64

Where are the GPIO pins? How can I configure the GPIO pins?

Posts: 714
Joined: Sun Oct 19, 2014 6:00 am

Re: export GPIO

Wed Mar 07, 2018 9:59 am

GPIO0~32 are using one register address, and GPIO 32~64 are using another register.
If you want to understand how it works, please read datasheet mt7628an.pdf GPIO register part and also check openwrt gpio and pinmux source code.

Normally first you must set VOCORE2.dts(device tree setting file in source code of openwrt) to set the pins you are using to GPIO mode(most pins are used to I2C, I2S, UART, SPI etc... so you must set it to GPIO mode to use it as GPIO)

After set pinmux(need to recompile the firmware or you have to use my hack tool "mem" directly modify its register, write a simple client side pinmux driver), you will able to directly use GPIO from /sys/....

If any problem you meet, please keep public under this ticket, I will follow. :)
And any process, please share with us.

Posts: 6
Joined: Sat Sep 23, 2017 10:54 pm

Re: export GPIO

Wed Mar 14, 2018 11:15 am

You can also give a try using python and library which i posted here:
Leave star on git if it do it`s work, or write if something went wrong
Greetings ;)

Return to VoCore2/Lite/Ultimate

Who is online

Users browsing this forum: Google [Bot] and 4 guests