Closed SpenceKonde closed 3 years ago
Done - both pins will output pwm if you don't turn one off with digitalWrite before turning on another. Turned out to be easy to tack on.
Oh, and it statically assigns the pins to channels. You can;t get independent PWM from WOA and WOC (both on WOA) or WOB and WOD (Both on WOB), but you can from other combinations.
Make analogWrite() to any of the 4 pins that TCD0 can drive in the current PORTMUX setting flip on the appropriate bit.
What should happen if someone has two PWM outputs running from TCD0 (the maximum it can drive) and then analogWrite()'s a non 0/255 value to a third? a) it turns off an existing output b) it mirrors one of the current pins, changing the output of that pin c) it does nothing