#[doc = "Register `GHWCFG4` reader"]
pub type R = crate::R<GHWCFG4_SPEC>;
#[doc = "Field `G_NUMDEVPERIOEPS` reader - "]
pub type G_NUMDEVPERIOEPS_R = crate::FieldReader;
#[doc = "Field `G_PARTIALPWRDN` reader - "]
pub type G_PARTIALPWRDN_R = crate::BitReader;
#[doc = "Field `G_AHBFREQ` reader - "]
pub type G_AHBFREQ_R = crate::BitReader;
#[doc = "Field `G_HIBERNATION` reader - "]
pub type G_HIBERNATION_R = crate::BitReader;
#[doc = "Field `G_EXTENDEDHIBERNATION` reader - "]
pub type G_EXTENDEDHIBERNATION_R = crate::BitReader;
#[doc = "Field `G_ACGSUPT` reader - "]
pub type G_ACGSUPT_R = crate::BitReader;
#[doc = "Field `G_ENHANCEDLPMSUPT` reader - "]
pub type G_ENHANCEDLPMSUPT_R = crate::BitReader;
#[doc = "Field `G_PHYDATAWIDTH` reader - "]
pub type G_PHYDATAWIDTH_R = crate::FieldReader;
#[doc = "Field `G_NUMCTLEPS` reader - "]
pub type G_NUMCTLEPS_R = crate::FieldReader;
#[doc = "Field `G_IDDQFLTR` reader - "]
pub type G_IDDQFLTR_R = crate::BitReader;
#[doc = "Field `G_VBUSVALIDFLTR` reader - "]
pub type G_VBUSVALIDFLTR_R = crate::BitReader;
#[doc = "Field `G_AVALIDFLTR` reader - "]
pub type G_AVALIDFLTR_R = crate::BitReader;
#[doc = "Field `G_BVALIDFLTR` reader - "]
pub type G_BVALIDFLTR_R = crate::BitReader;
#[doc = "Field `G_SESSENDFLTR` reader - "]
pub type G_SESSENDFLTR_R = crate::BitReader;
#[doc = "Field `G_DEDFIFOMODE` reader - "]
pub type G_DEDFIFOMODE_R = crate::BitReader;
#[doc = "Field `G_INEPS` reader - "]
pub type G_INEPS_R = crate::FieldReader;
#[doc = "Field `G_DESCDMAENABLED` reader - "]
pub type G_DESCDMAENABLED_R = crate::BitReader;
#[doc = "Field `G_DESCDMA` reader - "]
pub type G_DESCDMA_R = crate::BitReader;
impl R {
    #[doc = "Bits 0:3"]
    #[inline(always)]
    pub fn g_numdevperioeps(&self) -> G_NUMDEVPERIOEPS_R {
        G_NUMDEVPERIOEPS_R::new((self.bits & 0x0f) as u8)
    }
    #[doc = "Bit 4"]
    #[inline(always)]
    pub fn g_partialpwrdn(&self) -> G_PARTIALPWRDN_R {
        G_PARTIALPWRDN_R::new(((self.bits >> 4) & 1) != 0)
    }
    #[doc = "Bit 5"]
    #[inline(always)]
    pub fn g_ahbfreq(&self) -> G_AHBFREQ_R {
        G_AHBFREQ_R::new(((self.bits >> 5) & 1) != 0)
    }
    #[doc = "Bit 6"]
    #[inline(always)]
    pub fn g_hibernation(&self) -> G_HIBERNATION_R {
        G_HIBERNATION_R::new(((self.bits >> 6) & 1) != 0)
    }
    #[doc = "Bit 7"]
    #[inline(always)]
    pub fn g_extendedhibernation(&self) -> G_EXTENDEDHIBERNATION_R {
        G_EXTENDEDHIBERNATION_R::new(((self.bits >> 7) & 1) != 0)
    }
    #[doc = "Bit 12"]
    #[inline(always)]
    pub fn g_acgsupt(&self) -> G_ACGSUPT_R {
        G_ACGSUPT_R::new(((self.bits >> 12) & 1) != 0)
    }
    #[doc = "Bit 13"]
    #[inline(always)]
    pub fn g_enhancedlpmsupt(&self) -> G_ENHANCEDLPMSUPT_R {
        G_ENHANCEDLPMSUPT_R::new(((self.bits >> 13) & 1) != 0)
    }
    #[doc = "Bits 14:15"]
    #[inline(always)]
    pub fn g_phydatawidth(&self) -> G_PHYDATAWIDTH_R {
        G_PHYDATAWIDTH_R::new(((self.bits >> 14) & 3) as u8)
    }
    #[doc = "Bits 16:19"]
    #[inline(always)]
    pub fn g_numctleps(&self) -> G_NUMCTLEPS_R {
        G_NUMCTLEPS_R::new(((self.bits >> 16) & 0x0f) as u8)
    }
    #[doc = "Bit 20"]
    #[inline(always)]
    pub fn g_iddqfltr(&self) -> G_IDDQFLTR_R {
        G_IDDQFLTR_R::new(((self.bits >> 20) & 1) != 0)
    }
    #[doc = "Bit 21"]
    #[inline(always)]
    pub fn g_vbusvalidfltr(&self) -> G_VBUSVALIDFLTR_R {
        G_VBUSVALIDFLTR_R::new(((self.bits >> 21) & 1) != 0)
    }
    #[doc = "Bit 22"]
    #[inline(always)]
    pub fn g_avalidfltr(&self) -> G_AVALIDFLTR_R {
        G_AVALIDFLTR_R::new(((self.bits >> 22) & 1) != 0)
    }
    #[doc = "Bit 23"]
    #[inline(always)]
    pub fn g_bvalidfltr(&self) -> G_BVALIDFLTR_R {
        G_BVALIDFLTR_R::new(((self.bits >> 23) & 1) != 0)
    }
    #[doc = "Bit 24"]
    #[inline(always)]
    pub fn g_sessendfltr(&self) -> G_SESSENDFLTR_R {
        G_SESSENDFLTR_R::new(((self.bits >> 24) & 1) != 0)
    }
    #[doc = "Bit 25"]
    #[inline(always)]
    pub fn g_dedfifomode(&self) -> G_DEDFIFOMODE_R {
        G_DEDFIFOMODE_R::new(((self.bits >> 25) & 1) != 0)
    }
    #[doc = "Bits 26:29"]
    #[inline(always)]
    pub fn g_ineps(&self) -> G_INEPS_R {
        G_INEPS_R::new(((self.bits >> 26) & 0x0f) as u8)
    }
    #[doc = "Bit 30"]
    #[inline(always)]
    pub fn g_descdmaenabled(&self) -> G_DESCDMAENABLED_R {
        G_DESCDMAENABLED_R::new(((self.bits >> 30) & 1) != 0)
    }
    #[doc = "Bit 31"]
    #[inline(always)]
    pub fn g_descdma(&self) -> G_DESCDMA_R {
        G_DESCDMA_R::new(((self.bits >> 31) & 1) != 0)
    }
}
#[cfg(feature = "impl-register-debug")]
impl core::fmt::Debug for R {
    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
        f.debug_struct("GHWCFG4")
            .field("g_numdevperioeps", &self.g_numdevperioeps())
            .field("g_partialpwrdn", &self.g_partialpwrdn())
            .field("g_ahbfreq", &self.g_ahbfreq())
            .field("g_hibernation", &self.g_hibernation())
            .field("g_extendedhibernation", &self.g_extendedhibernation())
            .field("g_acgsupt", &self.g_acgsupt())
            .field("g_enhancedlpmsupt", &self.g_enhancedlpmsupt())
            .field("g_phydatawidth", &self.g_phydatawidth())
            .field("g_numctleps", &self.g_numctleps())
            .field("g_iddqfltr", &self.g_iddqfltr())
            .field("g_vbusvalidfltr", &self.g_vbusvalidfltr())
            .field("g_avalidfltr", &self.g_avalidfltr())
            .field("g_bvalidfltr", &self.g_bvalidfltr())
            .field("g_sessendfltr", &self.g_sessendfltr())
            .field("g_dedfifomode", &self.g_dedfifomode())
            .field("g_ineps", &self.g_ineps())
            .field("g_descdmaenabled", &self.g_descdmaenabled())
            .field("g_descdma", &self.g_descdma())
            .finish()
    }
}
#[doc = "\n\nYou can [`read`](crate::Reg::read) this register and get [`ghwcfg4::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct GHWCFG4_SPEC;
impl crate::RegisterSpec for GHWCFG4_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [`ghwcfg4::R`](R) reader structure"]
impl crate::Readable for GHWCFG4_SPEC {}
#[doc = "`reset()` method sets GHWCFG4 to value 0xd3f0_a030"]
impl crate::Resettable for GHWCFG4_SPEC {
    const RESET_VALUE: u32 = 0xd3f0_a030;
}
