Skip to content

Commit

Permalink
Update LCD section
Browse files Browse the repository at this point in the history
  • Loading branch information
uist1idrju3i committed May 1, 2024
1 parent 119c618 commit 0b6fc1d
Showing 1 changed file with 48 additions and 9 deletions.
57 changes: 48 additions & 9 deletions docs/hardware/en/lichee/RV_Nano/5_peripheral.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,26 +177,65 @@ cat /sys/class/cvi-saradc/cvi-saradc0/device/cv_saradc

Connect the screen's ribbon cable to the board's MIPI interface, paying attention to the wire order.

Edit /opt/fb_load.sh on the board, and uncomment the specific model's initialization command.
Create or edit the uEnv.txt file in the first partition of the sdcard, add or modify the panel field:

Then execute:
Note: The image will have the first partition already mounted in the /boot directory and can be used directly in the terminal:
```shell
cd /boot
touch uEnv.txt
vi uEnv.txt
# Use 'i' to enter edit
# Use 'Esc',':wq' to save and quit
```

7-inch screen:

```
/opt/fb_load.sh # Initialize the screen driver
devmem # Test color bars
panel=zct2133v1
```

If it works, you can add it to the boot script:
5-inch screen:
```
panel=st7701_dxq5d0019b480854
```

3-inch screen:

```
echo /opt/fb_load.sh >> /etc/rc.local
panel=st7701_d300fpc9307a
```

The LCD will provide a framebuffer for user space programs to access.
2.3-inch screen:

It is recommended to use QT5, SDL1.2, or LVGL for UI development, or you can write directly to the Framebuffer.
```
panel=st7701_hd228001c31
```

For direct framebuffer writing, refer to /opt/src/vendortest in the board's filesystem.
If you want to use the framebuffer function, create a file named fb in the first partition of the sd card:

```
touch /boot/fb
```

Then load the driver:

```
/etc/init.d/S04fb start
```

Adjusting the Backlight Brightness:

```
echo 0 > /sys/class/pwm/pwmchip8/pwm2/enable
echo 5000 > /sys/class/pwm/pwmchip8/pwm2/duty_cycle # 50%
echo 1 > /sys/class/pwm/pwmchip8/pwm2/enable
# some example:
#echo 2000 > /sys/class/pwm/pwmchip8/pwm2/duty_cycle # 20%
#echo 4000 > /sys/class/pwm/pwmchip8/pwm2/duty_cycle # 40%
#echo 7000 > /sys/class/pwm/pwmchip8/pwm2/duty_cycle # 70%
#echo 9000 > /sys/class/pwm/pwmchip8/pwm2/duty_cycle # 90%
```

## Touch Screen

Expand Down

0 comments on commit 0b6fc1d

Please sign in to comment.