pwm_set_both_levels() function
Set PWM counter compare values Set the value of the PWM counter compare values, A and B. The counter compare register is double-buffered in hardware. This means that, when the PWM is running, a write to the counter compare values does not take effect until the next time the PWM slice wraps (or, in phase-correct mode, the next time the slice reaches 0). If the PWM is not running, the write is latched in immediately.
Arguments
slice_num
PWM slice number
level_a
Value to set compare A to. When the counter reaches this value the A output is deasserted
level_b
Value to set compare B to. When the counter reaches this value the B output is deasserted