HAL Hardware Timer Library Development

@peekay123
How about

int pwmON(int id)
int pwmOFF(int id)

to pause/continue the PWM, instead of stop.

Also, in the context of Infrared remote control, it is neccessary to get at least 0.1uSec granularity on timer periods vs 1 uSec granuality. If you plan to use onchip hardware PWM via timers then this is less relevant. If you are generating the PWM via your other callbacks then it is likely an issue (for IR), but better than what we have on Photon today.

Have you condidered using nanoseconds for your period, with a minimum value, of course.

You have defined duty as long, normally it is expressed as a % - or are you using uSecs as the units for duty(HIGH).

A final note, it is useful to start a burst of PWM with a full period/cycle always starting on High. If you just suspend PWM with stop, the PWM may continue on iwhere it left off(?) when resumed , possibly on a LOW. The output needs to go to a known state (LOW?) when suspended and if possible when started/resumed.

I fully understand there may be limitations preventing the above.

cant wait :smile: