mirror of
https://github.com/sipeed/sipeed_wiki.git
synced 2026-09-11 00:22:49 -05:00
Merge pull request #784 from Pairman/patch-1
Also update and correct PWM fan operations for ENG
This commit is contained in:
@@ -65,13 +65,23 @@ If it boots successfully, then you can check the following values to confirm tha
|
||||
|
||||
## PWM
|
||||
|
||||
Take PWM1 which is connected to the cooling fan as an example, you can enable the fan with the following code:
|
||||
Take PWM1 which is connected to the cooling fan as an example, you can get the fan speed with the following code:
|
||||
|
||||
```bash
|
||||
echo 1 > /sys/class/pwm/pwmchip0/export
|
||||
echo 1000000 > /sys/class/pwm/pwmchip0/pwm1/period
|
||||
echo 1000000 > /sys/class/pwm/pwmchip0/pwm1/duty_cycle
|
||||
echo 1 > /sys/class/pwm/pwmchip0/pwm1/enable
|
||||
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):
|
||||
|
||||
```
|
||||
echo 0 > /sys/class/hwmon/hwmon0/pwm1_enable
|
||||
echo 0 > /sys/class/hwmon/hwmon0/pwm1
|
||||
```
|
||||
|
||||
Or you can enable automatic speed regulation with the following code:
|
||||
|
||||
```bash
|
||||
echo 1 > /sys/class/hwmon/hwmon0/pwm1_enable
|
||||
```
|
||||
|
||||
## GPIO
|
||||
@@ -1155,4 +1165,4 @@ At this point, the HHB environment is preliminarily built. You can try the follo
|
||||
For further infomation please check [hhb-tools doc](https://www.yuque.com/za4k4z).
|
||||
|
||||
## Other
|
||||
Contributions are welcome~ You can get ¥5~150 ($1~20) coupon if your contribution is accepted!
|
||||
Contributions are welcome~ You can get ¥5~150 ($1~20) coupon if your contribution is accepted!
|
||||
|
||||
Reference in New Issue
Block a user