beaglebone: pwm refactoring