kickpi@kickpi:~$ gpio mode 0 in
kickpi@kickpi:~$ gpio mode 0 down
kickpi@kickpi:~$ gpio read 0
0
kickpi@kickpi:~$ // Short pins 3 and 4
kickpi@kickpi:~$ gpio read 0
1
root@kickpi:~# gpio mode 3 pwm #Default output frequency 23475Hz Square wave with duty cycle 50%
gpio pwmr 3 2048 //Set ARR to 2048 Duty cycle to 512/2048=25%
gpio pwm 3 1024 //Set CCR to 1024 Duty cycle to 1024/2048=50%
gpio mode 3 pwm //The default output frequency is 23475Hz
//Set the frequency division coefficient to 5, then the output frequency is 23475/5=4695Hz, the actual frequency is 4688Hz, the error can be ignored
gpio pwmc 3 5
gpio pwmTone 3 20000 //Directly set the frequency to 20000Hz
vim longan/device/config/chips/h618/configs/p2/linux-5.4/board-*.dts // Android
vim source/kernel/linux-5.4-h618/arch/arm64/boot/dts/sunxi/sun50iw9-kickpi-k2b.dts // Linux