asf/sam/drivers/pwm/pwm.c
void pwm_channel_update_polarity_mode(Pwm *p_pwm, pwm_channel_t *p_channel,
		bool polarity_inversion_flag, pwm_level_t polarity_value)
{
	if (polarity_inversion_flag) {
		/* Set polarity inversion to the update register */
		p_pwm->PWM_CH_NUM_0X400[p_channel->channel].PWM_CMUPD =
				PWM_CMUPD_CPOLINVUP;
	} else {
		/* Save new polarity value */
		p_channel->polarity = polarity_value;

		/* Write new polarity value to update register */
		if (polarity_value == PWM_HIGH) {
			p_pwm->PWM_CH_NUM_0X400[p_channel->channel].PWM_CMUPD =
					PWM_CMUPD_CPOLUP;
		} else {
			p_pwm->PWM_CH_NUM_0X400[p_channel->channel].PWM_CMUPD = 0;
		}
	}
}
/**
 * \brief Change polarity mode.
 *
 * \param p_pwm Pointer to a PWM instance.
 * \param p_channel Configurations of the specified PWM channel.
 * \param polarity_inversion_flag Polarity invertion.
 * \param polarity_flag Polarity value.
 */
\brief Change polarity mode.
\param p_pwm Pointer to a PWM instance.
\param p_channel Configurations of the specified PWM channel.
\param polarity_inversion_flag Polarity invertion.
\param polarity_flag Polarity value.
\ brief Change polarity mode . \ param p_pwm Pointer to a PWM instance . \ param p_channel Configurations of the specified PWM channel . \ param polarity_inversion_flag Polarity invertion . \ param polarity_flag Polarity value .
void pwm_channel_update_polarity_mode(Pwm *p_pwm, pwm_channel_t *p_channel,
		bool polarity_inversion_flag, pwm_level_t polarity_value)
{
	if (polarity_inversion_flag) {
		p_pwm->PWM_CH_NUM_0X400[p_channel->channel].PWM_CMUPD =
				PWM_CMUPD_CPOLINVUP;
	} else {
		p_channel->polarity = polarity_value;
		if (polarity_value == PWM_HIGH) {
			p_pwm->PWM_CH_NUM_0X400[p_channel->channel].PWM_CMUPD =
					PWM_CMUPD_CPOLUP;
		} else {
			p_pwm->PWM_CH_NUM_0X400[p_channel->channel].PWM_CMUPD = 0;
		}
	}
}
void pwm_channel_update_polarity_mode ( Pwm * p_pwm , pwm_channel_t * p_channel , bool polarity_inversion_flag , pwm_level_t polarity_value ) { if ( polarity_inversion_flag ) { p_pwm -> PWM_CH_NUM_0X400 [ p_channel -> channel ] . PWM_CMUPD = PWM_CMUPD_CPOLINVUP ; } else { p_channel -> polarity = polarity_value ; if ( polarity_value == PWM_HIGH ) { p_pwm -> PWM_CH_NUM_0X400 [ p_channel -> channel ] . PWM_CMUPD = PWM_CMUPD_CPOLUP ; } else { p_pwm -> PWM_CH_NUM_0X400 [ p_channel -> channel ] . PWM_CMUPD = 0 ; } } }
\brief Change polarity mode.
\ brief Change polarity mode .
/* Set polarity inversion to the update register */ /* Save new polarity value */ /* Write new polarity value to update register */