Added PWM channels and initial implementation of gates