asf/sam/drivers/pwm/pwm.c
void pwm_stepper_motor_init(Pwm *p_pwm, pwm_stepper_motor_pair_t pair,
		bool b_enable_gray, bool b_down)
{
	uint32_t motor = p_pwm->PWM_SMMR;

	motor &= ~((PWM_SMMR_GCEN0 | PWM_SMMR_DOWN0) << pair);
	motor |= ((b_enable_gray | (b_down << 16)) << pair);

	p_pwm->PWM_SMMR = motor;
}
/**
 * \brief Initialize PWM stepper motor mode.
 *
 * \param p_pwm Pointer to a PWM instance.
 * \param pair PWM channels used by stepper motor.
 * \param b_enable_gray Set true to enable gray count generation. Set false to disable it.
 * \param b_down Set true to use down counter. Set false to use up counter.
 */
\brief Initialize PWM stepper motor mode.
\param p_pwm Pointer to a PWM instance.
\param pair PWM channels used by stepper motor.
\param b_enable_gray Set true to enable gray count generation. Set false to disable it.
\param b_down Set true to use down counter. Set false to use up counter.
\ brief Initialize PWM stepper motor mode . \ param p_pwm Pointer to a PWM instance . \ param pair PWM channels used by stepper motor . \ param b_enable_gray Set true to enable gray count generation . Set false to disable it . \ param b_down Set true to use down counter . Set false to use up counter .
void pwm_stepper_motor_init(Pwm *p_pwm, pwm_stepper_motor_pair_t pair,
		bool b_enable_gray, bool b_down)
{
	uint32_t motor = p_pwm->PWM_SMMR;
	motor &= ~((PWM_SMMR_GCEN0 | PWM_SMMR_DOWN0) << pair);
	motor |= ((b_enable_gray | (b_down << 16)) << pair);
	p_pwm->PWM_SMMR = motor;
}
void pwm_stepper_motor_init ( Pwm * p_pwm , pwm_stepper_motor_pair_t pair , bool b_enable_gray , bool b_down ) { uint32_t motor = p_pwm -> PWM_SMMR ; motor &= ~ ( ( PWM_SMMR_GCEN0 | PWM_SMMR_DOWN0 ) << pair ) ; motor |= ( ( b_enable_gray | ( b_down << 16 ) ) << pair ) ; p_pwm -> PWM_SMMR = motor ; }
\brief Initialize PWM stepper motor mode.
\ brief Initialize PWM stepper motor mode .