sam3x8e-pac 0.1.6-dev

Peripheral Access Crate (PAC) for the Atmel SAM3X8E.
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum CmrCpre {
    #[doc = "Master clock"]
    MCK = 0x0,
    #[doc = "Master clock/2"]
    MCK_DIV_2 = 0x01,
    #[doc = "Master clock/4"]
    MCK_DIV_4 = 0x02,
    #[doc = "Master clock/8"]
    MCK_DIV_8 = 0x03,
    #[doc = "Master clock/16"]
    MCK_DIV_16 = 0x04,
    #[doc = "Master clock/32"]
    MCK_DIV_32 = 0x05,
    #[doc = "Master clock/64"]
    MCK_DIV_64 = 0x06,
    #[doc = "Master clock/128"]
    MCK_DIV_128 = 0x07,
    #[doc = "Master clock/256"]
    MCK_DIV_256 = 0x08,
    #[doc = "Master clock/512"]
    MCK_DIV_512 = 0x09,
    #[doc = "Master clock/1024"]
    MCK_DIV_1024 = 0x0a,
    #[doc = "Clock A"]
    CLKA = 0x0b,
    #[doc = "Clock B"]
    CLKB = 0x0c,
    _RESERVED_d = 0x0d,
    _RESERVED_e = 0x0e,
    _RESERVED_f = 0x0f,
}
impl CmrCpre {
    #[inline(always)]
    pub const fn from_bits(val: u8) -> CmrCpre {
        unsafe { core::mem::transmute(val & 0x0f) }
    }
    #[inline(always)]
    pub const fn to_bits(self) -> u8 {
        unsafe { core::mem::transmute(self) }
    }
}
impl From<u8> for CmrCpre {
    #[inline(always)]
    fn from(val: u8) -> CmrCpre {
        CmrCpre::from_bits(val)
    }
}
impl From<CmrCpre> for u8 {
    #[inline(always)]
    fn from(val: CmrCpre) -> u8 {
        CmrCpre::to_bits(val)
    }
}
#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Updm {
    #[doc = "Manual write of double buffer registers and manual update of synchronous channels"]
    MODE0 = 0x0,
    #[doc = "Manual write of double buffer registers and automatic update of synchronous channels"]
    MODE1 = 0x01,
    #[doc = "Automatic write of duty-cycle update registers by the PDC and automatic update of synchronous channels"]
    MODE2 = 0x02,
    _RESERVED_3 = 0x03,
}
impl Updm {
    #[inline(always)]
    pub const fn from_bits(val: u8) -> Updm {
        unsafe { core::mem::transmute(val & 0x03) }
    }
    #[inline(always)]
    pub const fn to_bits(self) -> u8 {
        unsafe { core::mem::transmute(self) }
    }
}
impl From<u8> for Updm {
    #[inline(always)]
    fn from(val: u8) -> Updm {
        Updm::from_bits(val)
    }
}
impl From<Updm> for u8 {
    #[inline(always)]
    fn from(val: Updm) -> u8 {
        Updm::to_bits(val)
    }
}