asf/sam/drivers/pwm/pwm.c
bool pwm_get_protect_status(Pwm *p_pwm, pwm_protect_t *p_protect)
{
	uint32_t wpsr = p_pwm->PWM_WPSR;

	p_protect->ul_hw_status = (wpsr >> 8) & 0x3F;
	/** Bitmask of PWM register group for write protect software status */
	p_protect->ul_sw_status = (wpsr & 0x3F);

	if ((PWM_WPSR_WPVS & wpsr) == PWM_WPSR_WPVS) {
		p_protect->ul_offset =
				(wpsr & PWM_WPSR_WPVSRC_Msk) >>
				PWM_WPSR_WPVSRC_Pos;
		return true;
	} else {
		return false;
	}
}
/**
 * \brief Get PWM write protect status.
 *
 * \param p_pwm Pointer to a PWM instance.
 * \param p_protect Pointer to a structure stored PWM protect status.
 *
 * \retval 0 Protection disabled.
 * \retval 1 Protection enabled.
 */
\brief Get PWM write protect status.
\param p_pwm Pointer to a PWM instance.
\param p_protect Pointer to a structure stored PWM protect status.

\retval 0 Protection disabled.
\retval 1 Protection enabled.
\ brief Get PWM write protect status . \ param p_pwm Pointer to a PWM instance . \ param p_protect Pointer to a structure stored PWM protect status . \ retval 0 Protection disabled . \ retval 1 Protection enabled .
bool pwm_get_protect_status(Pwm *p_pwm, pwm_protect_t *p_protect)
{
	uint32_t wpsr = p_pwm->PWM_WPSR;
	p_protect->ul_hw_status = (wpsr >> 8) & 0x3F;
	p_protect->ul_sw_status = (wpsr & 0x3F);
	if ((PWM_WPSR_WPVS & wpsr) == PWM_WPSR_WPVS) {
		p_protect->ul_offset =
				(wpsr & PWM_WPSR_WPVSRC_Msk) >>
				PWM_WPSR_WPVSRC_Pos;
		return true;
	} else {
		return false;
	}
}
bool pwm_get_protect_status ( Pwm * p_pwm , pwm_protect_t * p_protect ) { uint32_t wpsr = p_pwm -> PWM_WPSR ; p_protect -> ul_hw_status = ( wpsr >> 8 ) & 0x3F ; p_protect -> ul_sw_status = ( wpsr & 0x3F ) ; if ( ( PWM_WPSR_WPVS & wpsr ) == PWM_WPSR_WPVS ) { p_protect -> ul_offset = ( wpsr & PWM_WPSR_WPVSRC_Msk ) >> PWM_WPSR_WPVSRC_Pos ; return true ; } else { return false ; } }
\brief Get PWM write protect status.
\ brief Get PWM write protect status .
/** Bitmask of PWM register group for write protect software status */