Example #1
0
EHRPWM2::EHRPWM2(MAP& map, double frequency)
	: map(map)
{
#ifdef WITH_HW
	uint32_t* pwm_map = map.getMap();

	if (pwm_map != 0){
		// set period to user interface value
		setPeriod(1000000.0 / frequency);
		
        // duty cycle of PWM1 and PWM2
        setDuty(0.0, PWM1);
        setDuty(0.0, PWM2);

	} else {
		printf("Error \n");
		exit(EXIT_FAILURE);
	}
#endif
}