pub type R = crate::R<CCIPR2rs>;
pub type W = crate::W<CCIPR2rs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum I2C4SEL {
        Pclk = 0,
        System = 1,
        Hsi16 = 2,
}
impl From<I2C4SEL> for u8 {
    #[inline(always)]
    fn from(variant: I2C4SEL) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for I2C4SEL {
    type Ux = u8;
}
impl crate::IsEnum for I2C4SEL {}
pub type I2C4SEL_R = crate::FieldReader<I2C4SEL>;
impl I2C4SEL_R {
        #[inline(always)]
    pub const fn variant(&self) -> Option<I2C4SEL> {
        match self.bits {
            0 => Some(I2C4SEL::Pclk),
            1 => Some(I2C4SEL::System),
            2 => Some(I2C4SEL::Hsi16),
            _ => None,
        }
    }
        #[inline(always)]
    pub fn is_pclk(&self) -> bool {
        *self == I2C4SEL::Pclk
    }
        #[inline(always)]
    pub fn is_system(&self) -> bool {
        *self == I2C4SEL::System
    }
        #[inline(always)]
    pub fn is_hsi16(&self) -> bool {
        *self == I2C4SEL::Hsi16
    }
}
pub type I2C4SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, I2C4SEL>;
impl<'a, REG> I2C4SEL_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
        #[inline(always)]
    pub fn pclk(self) -> &'a mut crate::W<REG> {
        self.variant(I2C4SEL::Pclk)
    }
        #[inline(always)]
    pub fn system(self) -> &'a mut crate::W<REG> {
        self.variant(I2C4SEL::System)
    }
        #[inline(always)]
    pub fn hsi16(self) -> &'a mut crate::W<REG> {
        self.variant(I2C4SEL::Hsi16)
    }
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum QSPISEL {
        System = 0,
        Hsi16 = 1,
        Pllq = 2,
}
impl From<QSPISEL> for u8 {
    #[inline(always)]
    fn from(variant: QSPISEL) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for QSPISEL {
    type Ux = u8;
}
impl crate::IsEnum for QSPISEL {}
pub type QSPISEL_R = crate::FieldReader<QSPISEL>;
impl QSPISEL_R {
        #[inline(always)]
    pub const fn variant(&self) -> Option<QSPISEL> {
        match self.bits {
            0 => Some(QSPISEL::System),
            1 => Some(QSPISEL::Hsi16),
            2 => Some(QSPISEL::Pllq),
            _ => None,
        }
    }
        #[inline(always)]
    pub fn is_system(&self) -> bool {
        *self == QSPISEL::System
    }
        #[inline(always)]
    pub fn is_hsi16(&self) -> bool {
        *self == QSPISEL::Hsi16
    }
        #[inline(always)]
    pub fn is_pllq(&self) -> bool {
        *self == QSPISEL::Pllq
    }
}
pub type QSPISEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, QSPISEL>;
impl<'a, REG> QSPISEL_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
        #[inline(always)]
    pub fn system(self) -> &'a mut crate::W<REG> {
        self.variant(QSPISEL::System)
    }
        #[inline(always)]
    pub fn hsi16(self) -> &'a mut crate::W<REG> {
        self.variant(QSPISEL::Hsi16)
    }
        #[inline(always)]
    pub fn pllq(self) -> &'a mut crate::W<REG> {
        self.variant(QSPISEL::Pllq)
    }
}
impl R {
        #[inline(always)]
    pub fn i2c4sel(&self) -> I2C4SEL_R {
        I2C4SEL_R::new((self.bits & 3) as u8)
    }
        #[inline(always)]
    pub fn qspisel(&self) -> QSPISEL_R {
        QSPISEL_R::new(((self.bits >> 20) & 3) as u8)
    }
}
impl core::fmt::Debug for R {
    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
        f.debug_struct("CCIPR2")
            .field("i2c4sel", &self.i2c4sel())
            .field("qspisel", &self.qspisel())
            .finish()
    }
}
impl W {
        #[inline(always)]
    pub fn i2c4sel(&mut self) -> I2C4SEL_W<CCIPR2rs> {
        I2C4SEL_W::new(self, 0)
    }
        #[inline(always)]
    pub fn qspisel(&mut self) -> QSPISEL_W<CCIPR2rs> {
        QSPISEL_W::new(self, 20)
    }
}
pub struct CCIPR2rs;
impl crate::RegisterSpec for CCIPR2rs {
    type Ux = u32;
}
impl crate::Readable for CCIPR2rs {}
impl crate::Writable for CCIPR2rs {
    type Safety = crate::Unsafe;
}
impl crate::Resettable for CCIPR2rs {}