On Wed, Feb 21, 2018 at 8:19 PM, James Fitzsimons
<
james.fi...@gmail.com> wrote:
> Hi Robert,
>
> Thanks so much for your speedy response!
>
> Just to confirm then - I understand from the comment at the top of that file
> "#PWM's change on every bootup:" that my C++ driver code is going to have to
> list the contents of each of the epwmss device directories (e.g.
> /sys/devices/platform/ocp/48300000.epwmss/48300200.pwm/pwm/) to get the
> pwmchipXX mapping to use on each boot?
Actually you don't have to fall back to "/sys/class/pwm/pwmchipX" just
keep moving down the path:
"/sys/devices/platform/ocp/48300000.epwmss/48300200.pwm/pwm/pwmchip*/<here>"
PS, borrow what you can from this project, it's a python project with
c files doing the low level.
https://github.com/adafruit/adafruit-beaglebone-io-python/blob/master/source/c_pwm.c
and just watch out for the
pwmchip0/pwm1 -> pwmchip0/pwm-0:1
that occurs in all our v4.11.x+ kernels and some of the newest
"v4.9.x" based kernels.. (it was done so udev would work on giving
the normal user permissions)..