Hi,
I am using C blacklib to handle some i2c and spi devices. Also I have few PWM's P9_14 and 16 let's say.
I learned the hard way that P9_14 and P9_16 are to be found in '48302200'. For P9_14 for example
/sys/devices/platform/ocp/48302000.epwmss/48302200.pwm/pwm/pwmchipX
which is a link from
became available as pwm0 after echoing 0 to /sys/class/pwm/pwmchip3/export
as
root@beaglebone:/sys/class/pwm/pwmchip3/pwm0# pwd
/sys/class/pwm/pwmchip3/pwm0
root@beaglebone:/sys/class/pwm/pwmchip3/pwm0# ls -l
total 0
-rw-rw-r-- 1 root pwm 4096 Feb 22 03:14 capture
-rw-rw-r-- 1 root pwm 4096 Feb 22 03:14 duty_cycle
-rw-rw-r-- 1 root pwm 4096 Feb 22 03:14 enable
-rw-rw-r-- 1 root pwm 4096 Feb 22 03:14 period
-rw-rw-r-- 1 root pwm 4096 Feb 22 03:14 polarity
drwxrwxr-x 2 root pwm 0 Feb 22 03:14 power
-rw-rw-r-- 1 root pwm 4096 Feb 22 03:14 uevent
root@beaglebone:/sys/class/pwm/pwmchip3/pwm0#
The blacklib still doing old slot way of finding out which /sys/... files are matching for P9_14 pwm, going
from symbolic links to some hardcoded PXY->1,2,3 mapping finally to find out the /sys/class/.../pwm/period.. and such...
My question is:
How do I determine which X,Y from
/sys/class/pwm/pwmchipX/pwmY maps to (X,Y) of a pwm pin
PX_Y Thank you