Merge pull request #794 from Pairman/patch-1

[LPi4A / PWM]fix factual errors
This commit is contained in:
Caize Wu
2025-04-15 15:09:16 +08:00
committed by GitHub
2 changed files with 19 additions and 7 deletions

View File

@@ -71,17 +71,23 @@ Take PWM1 which is connected to the cooling fan as an example, you can get the f
cat /sys/class/hwmon/hwmon0/pwm1
```
The PWM speed value ranges from 0 to 255, where a higher value represents a higher fan speed. You can write ```0``` to the PWM enable control to disable automatic speed regulation, and manually set the fan speed (e.g., 255):
The PWM speed value ranges from 0 to 255, where a higher value represents a higher fan speed. You can write ```1``` to the PWM enable control for manual speed regulation, and set the fan speed (e.g., 255):
```
echo 0 > /sys/class/hwmon/hwmon0/pwm1_enable
echo 0 > /sys/class/hwmon/hwmon0/pwm1
echo 255 > /sys/class/hwmon/hwmon0/pwm1
```
Or you can enable automatic speed regulation with the following code:
You can enable automatic speed regulation with the following code:
```bash
echo 1 > /sys/class/hwmon/hwmon0/pwm1_enable
echo 2 > /sys/class/hwmon/hwmon0/pwm1_enable
```
Or stop the fan completely:
```bash
echo 0 > /sys/class/hwmon/hwmon0/pwm1_enable
```
## GPIO

View File

@@ -71,17 +71,23 @@ light-lpi4a-ddr2G.dtb #history dtb
cat /sys/class/hwmon/hwmon0/pwm1
```
风扇的PWM转速值范围在0到255之间值越大风扇转速越大。你可以向PWM使能写入```0```来关闭自动调速,并手动设置转速如255
风扇的PWM转速值范围在0到255之间值越大风扇转速越大。你可以向PWM使能写入```1```来启用手动调速并设置转速如255
```
echo 0 > /sys/class/hwmon/hwmon0/pwm1_enable
echo 0 > /sys/class/hwmon/hwmon0/pwm1
echo 255 > /sys/class/hwmon/hwmon0/pwm1
```
使用以下命令可以恢复自动调速:
```bash
echo 1 > /sys/class/hwmon/hwmon0/pwm1_enable
echo 2 > /sys/class/hwmon/hwmon0/pwm1_enable
```
或是完全禁用风扇:
```bash
echo 0 > /sys/class/hwmon/hwmon0/pwm1_enable
```
## GPIO