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?
export GPIO
- Vonger
- Posts: 896
- Joined: Sun Oct 19, 2014 6:00 am
Re: export GPIO
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.![Smile :)](./images/smilies/icon_e_smile.gif)
And any process, please share with us.
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.
![Smile :)](./images/smilies/icon_e_smile.gif)
And any process, please share with us.
- kermit
- Posts: 6
- Joined: Sat Sep 23, 2017 10:54 pm
Re: export GPIO
Hi,
You can also give a try using python and library which i posted here:
https://github.com/krzysztofkrzeslak/vocore_gpio
Leave star on git if it do it`s work, or write if something went wrong
Greetings![Wink ;)](./images/smilies/icon_e_wink.gif)
You can also give a try using python and library which i posted here:
https://github.com/krzysztofkrzeslak/vocore_gpio
Leave star on git if it do it`s work, or write if something went wrong
Greetings
![Wink ;)](./images/smilies/icon_e_wink.gif)
- BryanBarbosa
- Posts: 12
- Joined: Fri May 14, 2021 2:40 am
Re: export GPIO
kermit wrote:Hi,
You can also give a try using python and library which i posted here:
https://github.com/krzysztofkrzeslak/vocore_gpio
Leave star on git if it do it`s work, or write if something went wrong
Greetings
Hi, could you give some instructions of how to install your library in Vocore 2? I've been trying that for one week and I still was not able to use it.
- Vonger
- Posts: 896
- Joined: Sun Oct 19, 2014 6:00 am
Re: export GPIO
BryanBarbosa wrote:kermit wrote:Hi,
You can also give a try using python and library which i posted here:
https://github.com/krzysztofkrzeslak/vocore_gpio
Leave star on git if it do it`s work, or write if something went wrong
Greetings
Hi, could you give some instructions of how to install your library in Vocore 2? I've been trying that for one week and I still was not able to use it.
If python can directly operate files, that will be simple, just write gpio number to /sys/bus/gpio/export, then it will map a new gpio folder, you can control it by write to file in that folder. detail you can check linux readme, a lot of tutorial online too.
5 posts
Page 1 of 1
Who is online
Users browsing this forum: No registered users and 170 guests