Add GPIO LED blinker and PUD test for VisionFive2 Lite#12
Conversation
Perform GPIO PUD verification on VisionFive 2 Lite
Performing an LED blink benchmark test on the VisionFive 2 Lite
Reviewer's GuideAdds two Chinese-language GPIO how-to documents for the VisionFive2 Lite board, covering an LED blink example and a GPIO pull-up/down verification, including full environment setup, code samples using Linux sysfs GPIO, compilation with the Ruyi gnu-plct toolchain, and run/teardown instructions. Sequence diagram for VisionFive2 Lite LED blink examplesequenceDiagram
actor User
participant led_blink
participant SysfsGPIO as Sysfs_GPIO
User->>led_blink: run led_blink
led_blink->>SysfsGPIO: gpio_export(GPIO_PIN)
led_blink->>SysfsGPIO: gpio_set_output(GPIO_PIN)
loop blink
led_blink->>SysfsGPIO: gpio_set_value(GPIO_PIN, 1)
led_blink->>User: print LED ON
led_blink->>SysfsGPIO: gpio_set_value(GPIO_PIN, 0)
led_blink->>User: print LED OFF
end
Sequence diagram for VisionFive2 Lite GPIO PUD verification examplesequenceDiagram
actor User
participant gpio_pud_test
participant SysfsGPIO as Sysfs_GPIO
User->>gpio_pud_test: run gpio_pud_test
gpio_pud_test->>SysfsGPIO: gpio_export(TEST_GPIO_PIN)
gpio_pud_test->>SysfsGPIO: gpio_set_dir_in(TEST_GPIO_PIN)
gpio_pud_test->>SysfsGPIO: gpio_set_pud_mode(TEST_GPIO_PIN, up)
gpio_pud_test->>SysfsGPIO: gpio_read_value(TEST_GPIO_PIN)
gpio_pud_test->>User: print Pull-Up Mode GPIO Level
gpio_pud_test->>SysfsGPIO: gpio_set_pud_mode(TEST_GPIO_PIN, down)
gpio_pud_test->>SysfsGPIO: gpio_read_value(TEST_GPIO_PIN)
gpio_pud_test->>User: print Pull-Down Mode GPIO Level
gpio_pud_test->>User: print PUD Demo Run Complete
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 3 issues, and left some high level feedback:
- In
VisionFive2Lite/GPIO_PUD/README_zh.md, the narrative mentions using libgpiod and GPIO31, but the example code uses the sysfs interface andTEST_GPIO_PIN 44; consider aligning the text, pin number, and described library with the actual code or updating the code to match the description. - In the PUD README, the file name in the instructions (
gpio_pud_test.cvsgpio_pud_test.cpp) is inconsistent; standardize on one name and extension so users can follow the steps without confusion. - In
VisionFive2Lite/GPIO_LED/README_zh.md, you installlibgpiod-devand the section title refers to compiling a GPIO PUD test, but the example uses the sysfs GPIO interface for LED blinking; adjust the dependency list and section heading so they accurately reflect the example’s implementation.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `VisionFive2Lite/GPIO_PUD/README_zh.md`, the narrative mentions using libgpiod and GPIO31, but the example code uses the sysfs interface and `TEST_GPIO_PIN 44`; consider aligning the text, pin number, and described library with the actual code or updating the code to match the description.
- In the PUD README, the file name in the instructions (`gpio_pud_test.c` vs `gpio_pud_test.cpp`) is inconsistent; standardize on one name and extension so users can follow the steps without confusion.
- In `VisionFive2Lite/GPIO_LED/README_zh.md`, you install `libgpiod-dev` and the section title refers to compiling a GPIO PUD test, but the example uses the sysfs GPIO interface for LED blinking; adjust the dependency list and section heading so they accurately reflect the example’s implementation.
## Individual Comments
### Comment 1
<location path="VisionFive2Lite/GPIO_PUD/README_zh.md" line_range="58" />
<code_context>
+ nano gpio_pud_test.c
+ ```
+
+ 将以下代码粘贴进`gpio_pud_test.cpp`:
+
+ ```c
</code_context>
<issue_to_address>
**issue (typo):** File extension in the text (`.cpp`) doesn’t match the file created with nano (`.c`).
You have users create `gpio_pud_test.c`, but then refer to `gpio_pud_test.cpp`. Please align the filename in both places to use the same extension.
```suggestion
将以下代码粘贴进`gpio_pud_test.c`:
```
</issue_to_address>
### Comment 2
<location path="VisionFive2Lite/GPIO_PUD/README_zh.md" line_range="9-18" />
<code_context>
+status: gpio
+last_update: 2026-05-24
+
+model: VisionFive2 Lite
+profile: GPIO_LED Blink
+
</code_context>
<issue_to_address>
**suggestion (typo):** Inconsistent spelling of the board name (`VisionFive2` vs `VisionFive 2`).
The front matter uses `VisionFive2 Lite`, while the section heading uses `VisionFive 2 Lite`. Please standardize on one spelling across the document for consistency and searchability.
Suggested implementation:
```
model: VisionFive 2 Lite
```
To fully implement the suggestion, update all other occurrences of the board name in this document (e.g. section headings, paragraphs, code comments) so they consistently use `VisionFive 2 Lite` instead of `VisionFive2 Lite`.
</issue_to_address>
### Comment 3
<location path="VisionFive2Lite/GPIO_LED/README_zh.md" line_range="49" />
<code_context>
+ . ~/led-env/bin/ruyi-activate
+ ```
+
+- #### 使用 ruyi 工具链编译 GPIO PUD 测试代码
+
+ 1. **创建测试代码目录并编写代码**
</code_context>
<issue_to_address>
**issue (typo):** Section title mentions "GPIO PUD" in an LED blink example, which looks like a copy-paste error.
Please update the header to match the LED blink example, for instance by renaming it to “GPIO LED 测试代码” or similar.
```suggestion
- #### 使用 ruyi 工具链编译 GPIO LED 测试代码
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| nano gpio_pud_test.c | ||
| ``` | ||
|
|
||
| 将以下代码粘贴进`gpio_pud_test.cpp`: |
There was a problem hiding this comment.
issue (typo): File extension in the text (.cpp) doesn’t match the file created with nano (.c).
You have users create gpio_pud_test.c, but then refer to gpio_pud_test.cpp. Please align the filename in both places to use the same extension.
| 将以下代码粘贴进`gpio_pud_test.cpp`: | |
| 将以下代码粘贴进`gpio_pud_test.c`: |
| model: VisionFive2 Lite | ||
| profile: GPIO_PUD | ||
|
|
||
| --- | ||
|
|
||
| # RuyiSDK GPIO功能示例 | ||
|
|
||
| - **安装依赖包** | ||
|
|
||
| ```bash |
There was a problem hiding this comment.
suggestion (typo): Inconsistent spelling of the board name (VisionFive2 vs VisionFive 2).
The front matter uses VisionFive2 Lite, while the section heading uses VisionFive 2 Lite. Please standardize on one spelling across the document for consistency and searchability.
Suggested implementation:
model: VisionFive 2 Lite
To fully implement the suggestion, update all other occurrences of the board name in this document (e.g. section headings, paragraphs, code comments) so they consistently use VisionFive 2 Lite instead of VisionFive2 Lite.
| . ~/led-env/bin/ruyi-activate | ||
| ``` | ||
|
|
||
| - #### 使用 ruyi 工具链编译 GPIO PUD 测试代码 |
There was a problem hiding this comment.
issue (typo): Section title mentions "GPIO PUD" in an LED blink example, which looks like a copy-paste error.
Please update the header to match the LED blink example, for instance by renaming it to “GPIO LED 测试代码” or similar.
| - #### 使用 ruyi 工具链编译 GPIO PUD 测试代码 | |
| - #### 使用 ruyi 工具链编译 GPIO LED 测试代码 |
Added explanation of restrictions on RuyiGCC
Added explanation of restrictions on RuyiGCC
Added LVGL Demo v9 example for ESP32-P4
Summary
This PR adds two GPIO-related documents for the VisionFive2 Lite board:
boards/VisionFive2 Lite/GPIO_LED_Blink/README_zh.md: LED blink example.boards/VisionFive2 Lite/GPIO_PUD/README_zh.md: GPIO pull-up/down test.Test Environment
gnu-plct(installed viaruyi install gnu-plct)Test Results
Both example programs were compiled and executed successfully on the board. The outputs match the documented results.
Summary by Sourcery
Add Chinese-language GPIO usage guides for the VisionFive2 Lite board, covering an LED blink demo and a GPIO pull-up/down verification demo using RuyiSDK and the gnu-plct toolchain.
Documentation: