#[doc = "Register `POWER_CTRL` reader"]
pub struct R(crate::R<POWER_CTRL_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<POWER_CTRL_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::convert::From<crate::R<POWER_CTRL_SPEC>> for R {
    fn from(reader: crate::R<POWER_CTRL_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `POWER_CTRL` writer"]
pub struct W(crate::W<POWER_CTRL_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<POWER_CTRL_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::ops::DerefMut for W {
    #[inline(always)]
    fn deref_mut(&mut self) -> &mut Self::Target {
        &mut self.0
    }
}
impl core::convert::From<crate::W<POWER_CTRL_SPEC>> for W {
    fn from(writer: crate::W<POWER_CTRL_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `VBUS_VALID_OVR` reader - Overrides the value received from the GPIO input buffer connected to VBUS:?0: Force vbus_valid=0?1: Force vbus_valid=1?2: Use vbus_valid signal from GPIO input?3: Use vbus_valid signal from PHY detector"]
pub struct VBUS_VALID_OVR_R(crate::FieldReader<u8, u8>);
impl VBUS_VALID_OVR_R {
    pub(crate) fn new(bits: u8) -> Self {
        VBUS_VALID_OVR_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for VBUS_VALID_OVR_R {
    type Target = crate::FieldReader<u8, u8>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `VBUS_VALID_OVR` writer - Overrides the value received from the GPIO input buffer connected to VBUS:?0: Force vbus_valid=0?1: Force vbus_valid=1?2: Use vbus_valid signal from GPIO input?3: Use vbus_valid signal from PHY detector"]
pub struct VBUS_VALID_OVR_W<'a> {
    w: &'a mut W,
}
impl<'a> VBUS_VALID_OVR_W<'a> {
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03);
        self.w
    }
}
#[doc = "Field `SUSPEND` reader - Put PHY into Suspend mode. If the PHY is enabled, this bit MUST be set before entering a low power mode (DeepSleep/Hibernate)."]
pub struct SUSPEND_R(crate::FieldReader<bool, bool>);
impl SUSPEND_R {
    pub(crate) fn new(bits: bool) -> Self {
        SUSPEND_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for SUSPEND_R {
    type Target = crate::FieldReader<bool, bool>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `SUSPEND` writer - Put PHY into Suspend mode. If the PHY is enabled, this bit MUST be set before entering a low power mode (DeepSleep/Hibernate)."]
pub struct SUSPEND_W<'a> {
    w: &'a mut W,
}
impl<'a> SUSPEND_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2);
        self.w
    }
}
#[doc = "Field `SUSPEND_DEL` reader - Delayed version of SUSPEND. Always set SUSPEND and SUSPEND_DEL together in a single register write. When taking PHY out of suspend mode, first clear SUSPEND, then clear SUSPEND_DEL at least 2us later."]
pub struct SUSPEND_DEL_R(crate::FieldReader<bool, bool>);
impl SUSPEND_DEL_R {
    pub(crate) fn new(bits: bool) -> Self {
        SUSPEND_DEL_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for SUSPEND_DEL_R {
    type Target = crate::FieldReader<bool, bool>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `SUSPEND_DEL` writer - Delayed version of SUSPEND. Always set SUSPEND and SUSPEND_DEL together in a single register write. When taking PHY out of suspend mode, first clear SUSPEND, then clear SUSPEND_DEL at least 2us later."]
pub struct SUSPEND_DEL_W<'a> {
    w: &'a mut W,
}
impl<'a> SUSPEND_DEL_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3);
        self.w
    }
}
#[doc = "Field `ISOLATE` reader - Isolates the PHY outputs. Clear this bit at least 2us after vbus is known to be valid (vbus_valid=1). Isolation will be forced when vbus_valid goes low (see VBUS_VALID_OVR)."]
pub struct ISOLATE_R(crate::FieldReader<bool, bool>);
impl ISOLATE_R {
    pub(crate) fn new(bits: bool) -> Self {
        ISOLATE_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for ISOLATE_R {
    type Target = crate::FieldReader<bool, bool>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `ISOLATE` writer - Isolates the PHY outputs. Clear this bit at least 2us after vbus is known to be valid (vbus_valid=1). Isolation will be forced when vbus_valid goes low (see VBUS_VALID_OVR)."]
pub struct ISOLATE_W<'a> {
    w: &'a mut W,
}
impl<'a> ISOLATE_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4);
        self.w
    }
}
#[doc = "Field `CHDET_PWR_CTL` reader - Power programmability for bandgap voltage buffer in the charger detect block. See s8bg_vrefbuf public cell for more information. Default '0' is low power mode."]
pub struct CHDET_PWR_CTL_R(crate::FieldReader<u8, u8>);
impl CHDET_PWR_CTL_R {
    pub(crate) fn new(bits: u8) -> Self {
        CHDET_PWR_CTL_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for CHDET_PWR_CTL_R {
    type Target = crate::FieldReader<u8, u8>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `CHDET_PWR_CTL` writer - Power programmability for bandgap voltage buffer in the charger detect block. See s8bg_vrefbuf public cell for more information. Default '0' is low power mode."]
pub struct CHDET_PWR_CTL_W<'a> {
    w: &'a mut W,
}
impl<'a> CHDET_PWR_CTL_W<'a> {
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x03 << 5)) | ((value as u32 & 0x03) << 5);
        self.w
    }
}
#[doc = "Field `ENABLE_DM_PULLDOWN` reader - Enables the ~15k pull down on the DM, default off. The 15k pull down is needed for Data Contact Detection (DCD)."]
pub struct ENABLE_DM_PULLDOWN_R(crate::FieldReader<bool, bool>);
impl ENABLE_DM_PULLDOWN_R {
    pub(crate) fn new(bits: bool) -> Self {
        ENABLE_DM_PULLDOWN_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for ENABLE_DM_PULLDOWN_R {
    type Target = crate::FieldReader<bool, bool>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `ENABLE_DM_PULLDOWN` writer - Enables the ~15k pull down on the DM, default off. The 15k pull down is needed for Data Contact Detection (DCD)."]
pub struct ENABLE_DM_PULLDOWN_W<'a> {
    w: &'a mut W,
}
impl<'a> ENABLE_DM_PULLDOWN_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25);
        self.w
    }
}
#[doc = "Field `ENABLE_VBUS_PULLDOWN` reader - Enables the weak pull down on the VBUS, default on, to prevent floating node crow bar currents."]
pub struct ENABLE_VBUS_PULLDOWN_R(crate::FieldReader<bool, bool>);
impl ENABLE_VBUS_PULLDOWN_R {
    pub(crate) fn new(bits: bool) -> Self {
        ENABLE_VBUS_PULLDOWN_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for ENABLE_VBUS_PULLDOWN_R {
    type Target = crate::FieldReader<bool, bool>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `ENABLE_VBUS_PULLDOWN` writer - Enables the weak pull down on the VBUS, default on, to prevent floating node crow bar currents."]
pub struct ENABLE_VBUS_PULLDOWN_W<'a> {
    w: &'a mut W,
}
impl<'a> ENABLE_VBUS_PULLDOWN_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26);
        self.w
    }
}
#[doc = "Field `ENABLE_RCVR` reader - Enables the differential USB receiver."]
pub struct ENABLE_RCVR_R(crate::FieldReader<bool, bool>);
impl ENABLE_RCVR_R {
    pub(crate) fn new(bits: bool) -> Self {
        ENABLE_RCVR_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for ENABLE_RCVR_R {
    type Target = crate::FieldReader<bool, bool>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `ENABLE_RCVR` writer - Enables the differential USB receiver."]
pub struct ENABLE_RCVR_W<'a> {
    w: &'a mut W,
}
impl<'a> ENABLE_RCVR_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27);
        self.w
    }
}
#[doc = "Field `ENABLE_DPO` reader - Enables the single ended receiver on D+."]
pub struct ENABLE_DPO_R(crate::FieldReader<bool, bool>);
impl ENABLE_DPO_R {
    pub(crate) fn new(bits: bool) -> Self {
        ENABLE_DPO_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for ENABLE_DPO_R {
    type Target = crate::FieldReader<bool, bool>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `ENABLE_DPO` writer - Enables the single ended receiver on D+."]
pub struct ENABLE_DPO_W<'a> {
    w: &'a mut W,
}
impl<'a> ENABLE_DPO_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28);
        self.w
    }
}
#[doc = "Field `ENABLE_DMO` reader - Enables the signle ended receiver on D-."]
pub struct ENABLE_DMO_R(crate::FieldReader<bool, bool>);
impl ENABLE_DMO_R {
    pub(crate) fn new(bits: bool) -> Self {
        ENABLE_DMO_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for ENABLE_DMO_R {
    type Target = crate::FieldReader<bool, bool>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `ENABLE_DMO` writer - Enables the signle ended receiver on D-."]
pub struct ENABLE_DMO_W<'a> {
    w: &'a mut W,
}
impl<'a> ENABLE_DMO_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29);
        self.w
    }
}
#[doc = "Field `ENABLE_CHGDET` reader - Enables the charger detection circuitry. After USB has connected, this circuitry can be disabled to save power."]
pub struct ENABLE_CHGDET_R(crate::FieldReader<bool, bool>);
impl ENABLE_CHGDET_R {
    pub(crate) fn new(bits: bool) -> Self {
        ENABLE_CHGDET_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for ENABLE_CHGDET_R {
    type Target = crate::FieldReader<bool, bool>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `ENABLE_CHGDET` writer - Enables the charger detection circuitry. After USB has connected, this circuitry can be disabled to save power."]
pub struct ENABLE_CHGDET_W<'a> {
    w: &'a mut W,
}
impl<'a> ENABLE_CHGDET_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30);
        self.w
    }
}
#[doc = "Field `ENABLE` reader - Mast enable of PHY and Charger Detector. Nothing will work until this bit is set."]
pub struct ENABLE_R(crate::FieldReader<bool, bool>);
impl ENABLE_R {
    pub(crate) fn new(bits: bool) -> Self {
        ENABLE_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for ENABLE_R {
    type Target = crate::FieldReader<bool, bool>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `ENABLE` writer - Mast enable of PHY and Charger Detector. Nothing will work until this bit is set."]
pub struct ENABLE_W<'a> {
    w: &'a mut W,
}
impl<'a> ENABLE_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31);
        self.w
    }
}
impl R {
    #[doc = "Bits 0:1 - Overrides the value received from the GPIO input buffer connected to VBUS:?0: Force vbus_valid=0?1: Force vbus_valid=1?2: Use vbus_valid signal from GPIO input?3: Use vbus_valid signal from PHY detector"]
    #[inline(always)]
    pub fn vbus_valid_ovr(&self) -> VBUS_VALID_OVR_R {
        VBUS_VALID_OVR_R::new((self.bits & 0x03) as u8)
    }
    #[doc = "Bit 2 - Put PHY into Suspend mode. If the PHY is enabled, this bit MUST be set before entering a low power mode (DeepSleep/Hibernate)."]
    #[inline(always)]
    pub fn suspend(&self) -> SUSPEND_R {
        SUSPEND_R::new(((self.bits >> 2) & 0x01) != 0)
    }
    #[doc = "Bit 3 - Delayed version of SUSPEND. Always set SUSPEND and SUSPEND_DEL together in a single register write. When taking PHY out of suspend mode, first clear SUSPEND, then clear SUSPEND_DEL at least 2us later."]
    #[inline(always)]
    pub fn suspend_del(&self) -> SUSPEND_DEL_R {
        SUSPEND_DEL_R::new(((self.bits >> 3) & 0x01) != 0)
    }
    #[doc = "Bit 4 - Isolates the PHY outputs. Clear this bit at least 2us after vbus is known to be valid (vbus_valid=1). Isolation will be forced when vbus_valid goes low (see VBUS_VALID_OVR)."]
    #[inline(always)]
    pub fn isolate(&self) -> ISOLATE_R {
        ISOLATE_R::new(((self.bits >> 4) & 0x01) != 0)
    }
    #[doc = "Bits 5:6 - Power programmability for bandgap voltage buffer in the charger detect block. See s8bg_vrefbuf public cell for more information. Default '0' is low power mode."]
    #[inline(always)]
    pub fn chdet_pwr_ctl(&self) -> CHDET_PWR_CTL_R {
        CHDET_PWR_CTL_R::new(((self.bits >> 5) & 0x03) as u8)
    }
    #[doc = "Bit 25 - Enables the ~15k pull down on the DM, default off. The 15k pull down is needed for Data Contact Detection (DCD)."]
    #[inline(always)]
    pub fn enable_dm_pulldown(&self) -> ENABLE_DM_PULLDOWN_R {
        ENABLE_DM_PULLDOWN_R::new(((self.bits >> 25) & 0x01) != 0)
    }
    #[doc = "Bit 26 - Enables the weak pull down on the VBUS, default on, to prevent floating node crow bar currents."]
    #[inline(always)]
    pub fn enable_vbus_pulldown(&self) -> ENABLE_VBUS_PULLDOWN_R {
        ENABLE_VBUS_PULLDOWN_R::new(((self.bits >> 26) & 0x01) != 0)
    }
    #[doc = "Bit 27 - Enables the differential USB receiver."]
    #[inline(always)]
    pub fn enable_rcvr(&self) -> ENABLE_RCVR_R {
        ENABLE_RCVR_R::new(((self.bits >> 27) & 0x01) != 0)
    }
    #[doc = "Bit 28 - Enables the single ended receiver on D+."]
    #[inline(always)]
    pub fn enable_dpo(&self) -> ENABLE_DPO_R {
        ENABLE_DPO_R::new(((self.bits >> 28) & 0x01) != 0)
    }
    #[doc = "Bit 29 - Enables the signle ended receiver on D-."]
    #[inline(always)]
    pub fn enable_dmo(&self) -> ENABLE_DMO_R {
        ENABLE_DMO_R::new(((self.bits >> 29) & 0x01) != 0)
    }
    #[doc = "Bit 30 - Enables the charger detection circuitry. After USB has connected, this circuitry can be disabled to save power."]
    #[inline(always)]
    pub fn enable_chgdet(&self) -> ENABLE_CHGDET_R {
        ENABLE_CHGDET_R::new(((self.bits >> 30) & 0x01) != 0)
    }
    #[doc = "Bit 31 - Mast enable of PHY and Charger Detector. Nothing will work until this bit is set."]
    #[inline(always)]
    pub fn enable(&self) -> ENABLE_R {
        ENABLE_R::new(((self.bits >> 31) & 0x01) != 0)
    }
}
impl W {
    #[doc = "Bits 0:1 - Overrides the value received from the GPIO input buffer connected to VBUS:?0: Force vbus_valid=0?1: Force vbus_valid=1?2: Use vbus_valid signal from GPIO input?3: Use vbus_valid signal from PHY detector"]
    #[inline(always)]
    pub fn vbus_valid_ovr(&mut self) -> VBUS_VALID_OVR_W {
        VBUS_VALID_OVR_W { w: self }
    }
    #[doc = "Bit 2 - Put PHY into Suspend mode. If the PHY is enabled, this bit MUST be set before entering a low power mode (DeepSleep/Hibernate)."]
    #[inline(always)]
    pub fn suspend(&mut self) -> SUSPEND_W {
        SUSPEND_W { w: self }
    }
    #[doc = "Bit 3 - Delayed version of SUSPEND. Always set SUSPEND and SUSPEND_DEL together in a single register write. When taking PHY out of suspend mode, first clear SUSPEND, then clear SUSPEND_DEL at least 2us later."]
    #[inline(always)]
    pub fn suspend_del(&mut self) -> SUSPEND_DEL_W {
        SUSPEND_DEL_W { w: self }
    }
    #[doc = "Bit 4 - Isolates the PHY outputs. Clear this bit at least 2us after vbus is known to be valid (vbus_valid=1). Isolation will be forced when vbus_valid goes low (see VBUS_VALID_OVR)."]
    #[inline(always)]
    pub fn isolate(&mut self) -> ISOLATE_W {
        ISOLATE_W { w: self }
    }
    #[doc = "Bits 5:6 - Power programmability for bandgap voltage buffer in the charger detect block. See s8bg_vrefbuf public cell for more information. Default '0' is low power mode."]
    #[inline(always)]
    pub fn chdet_pwr_ctl(&mut self) -> CHDET_PWR_CTL_W {
        CHDET_PWR_CTL_W { w: self }
    }
    #[doc = "Bit 25 - Enables the ~15k pull down on the DM, default off. The 15k pull down is needed for Data Contact Detection (DCD)."]
    #[inline(always)]
    pub fn enable_dm_pulldown(&mut self) -> ENABLE_DM_PULLDOWN_W {
        ENABLE_DM_PULLDOWN_W { w: self }
    }
    #[doc = "Bit 26 - Enables the weak pull down on the VBUS, default on, to prevent floating node crow bar currents."]
    #[inline(always)]
    pub fn enable_vbus_pulldown(&mut self) -> ENABLE_VBUS_PULLDOWN_W {
        ENABLE_VBUS_PULLDOWN_W { w: self }
    }
    #[doc = "Bit 27 - Enables the differential USB receiver."]
    #[inline(always)]
    pub fn enable_rcvr(&mut self) -> ENABLE_RCVR_W {
        ENABLE_RCVR_W { w: self }
    }
    #[doc = "Bit 28 - Enables the single ended receiver on D+."]
    #[inline(always)]
    pub fn enable_dpo(&mut self) -> ENABLE_DPO_W {
        ENABLE_DPO_W { w: self }
    }
    #[doc = "Bit 29 - Enables the signle ended receiver on D-."]
    #[inline(always)]
    pub fn enable_dmo(&mut self) -> ENABLE_DMO_W {
        ENABLE_DMO_W { w: self }
    }
    #[doc = "Bit 30 - Enables the charger detection circuitry. After USB has connected, this circuitry can be disabled to save power."]
    #[inline(always)]
    pub fn enable_chgdet(&mut self) -> ENABLE_CHGDET_W {
        ENABLE_CHGDET_W { w: self }
    }
    #[doc = "Bit 31 - Mast enable of PHY and Charger Detector. Nothing will work until this bit is set."]
    #[inline(always)]
    pub fn enable(&mut self) -> ENABLE_W {
        ENABLE_W { w: self }
    }
    #[doc = "Writes raw bits to the register."]
    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
        self.0.bits(bits);
        self
    }
}
#[doc = "Power Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [power_ctrl](index.html) module"]
pub struct POWER_CTRL_SPEC;
impl crate::RegisterSpec for POWER_CTRL_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [power_ctrl::R](R) reader structure"]
impl crate::Readable for POWER_CTRL_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [power_ctrl::W](W) writer structure"]
impl crate::Writable for POWER_CTRL_SPEC {
    type Writer = W;
}
#[doc = "`reset()` method sets POWER_CTRL to value 0"]
impl crate::Resettable for POWER_CTRL_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0
    }
}
