With a little shell script I can switch gpio6 on/off:
#!/bin/sh # PWM1 / GPIOA6 P=6 G="/sys/class/gpio/gpio${P}" if [ ! -d "${G}" ]; then echo "Exporting GPIO${P}" echo ${P} > /sys/class/gpio/export echo out > ${G}/direction fi i=100 while [ "$i" -gt 0 ]; do i=`expr $i - 1` sleep .2 echo 1 > ${G}/value sleep .1 echo 0 > ${G}/value done if [ -d "${G}" ]; then echo "Unexporting GPIO${P}" echo ${P} > /sys/class/gpio/unexport fi
but I dont see anything which could enable PWM on this pin:
root@nanopineo:~# ll /sys/class/gpio/gpio6/ total 0 -rw-r--r-- 1 root root 4096 Feb 21 11:38 active_low lrwxrwxrwx 1 root root 0 Feb 21 11:38 device -> ../../../sunxi-pinctrl -rw-r--r-- 1 root root 4096 Feb 21 11:37 direction -rw-r--r-- 1 root root 4096 Feb 21 11:38 edge drwxr-xr-x 2 root root 0 Feb 21 11:38 power lrwxrwxrwx 1 root root 0 Feb 21 11:38 subsystem -> ../../../../../class/gpio -rw-r--r-- 1 root root 4096 Feb 21 11:37 uevent -rw-r--r-- 1 root root 4096 Feb 21 11:38 value
Is it possibe to enable PWM on the NanoPi Neo via sysfs?