Hello,
I’m just starting with Milk-V Duo. I spent some time searching for this information so after I found everything I needed I decided to collect it in a table. I hope it will save time for somebody else.
= GPIO pins and numbers
One of the first things you would do with your new Milk-V Duo is turning the onboard LED on and off.
There is an easy-to-follow tutorial which allows you to do this from your shell session: https://www.spotpear.com/index.php/index/study/detail/id/1096.html
The tutorial simply states
====
The group number value of XGPIOC is 416, so the GPIO number is 416+24=440.
====
But what if I want to use other GPIO pins?
How do I calculate the numbers for them?
After exploring the Milk-V Duo file system I found the numbers that I needed in the `/sys/class/gpio` directory.
Later I found them in the link:https://doc.sophgo.com/cvitek-develop-docs/master/docs_latest_release/CV180x_CV181x/en/01.software/OSDRV/Peripheral_Driver_Operation_Guide/build/html/7_GPIO_Operation_Guide.html[Peripheral Driver Operation Guide]
* GPIOA is controlled by `gpiochip0` and its group number is 480.
* GPIOC (that is used in the example and that controls the onboard LED) is controlled by `gpiochip2` and its group number is 416
* PWR_GPIO is controlled by `gpiochip4` and its group number is 352
This file has been truncated. show original
Please let me know if anything else should be added.