#[doc = r" Value read from the register"] pub struct R { bits: u16, } #[doc = r" Value to write to the register"] pub struct W { bits: u16, } impl super::CEXCTL1 { #[doc = r" Modifies the contents of the register"] #[inline] pub fn modify(&self, f: F) where for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, { let bits = self.register.get(); let r = R { bits: bits }; let mut w = W { bits: bits }; f(&r, &mut w); self.register.set(w.bits); } #[doc = r" Reads the contents of the register"] #[inline] pub fn read(&self) -> R { R { bits: self.register.get(), } } #[doc = r" Writes to the register"] #[inline] pub fn write(&self, f: F) where F: FnOnce(&mut W) -> &mut W, { let mut w = W::reset_value(); f(&mut w); self.register.set(w.bits); } #[doc = r" Writes the reset value to the register"] #[inline] pub fn reset(&self) { self.write(|w| w) } } #[doc = r" Value of the field"] pub struct CEOUTR { bits: bool, } impl CEOUTR { #[doc = r" Value of the field as raw bits"] #[inline] pub fn bit(&self) -> bool { self.bits } #[doc = r" Returns `true` if the bit is clear (0)"] #[inline] pub fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = r" Returns `true` if the bit is set (1)"] #[inline] pub fn bit_is_set(&self) -> bool { self.bit() } } #[doc = "Possible values of the field `CEOUTPOL`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum CEOUTPOLR { #[doc = "Noninverted"] CEOUTPOL_0, #[doc = "Inverted"] CEOUTPOL_1, } impl CEOUTPOLR { #[doc = r" Returns `true` if the bit is clear (0)"] #[inline] pub fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = r" Returns `true` if the bit is set (1)"] #[inline] pub fn bit_is_set(&self) -> bool { self.bit() } #[doc = r" Value of the field as raw bits"] #[inline] pub fn bit(&self) -> bool { match *self { CEOUTPOLR::CEOUTPOL_0 => false, CEOUTPOLR::CEOUTPOL_1 => true, } } #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _from(value: bool) -> CEOUTPOLR { match value { false => CEOUTPOLR::CEOUTPOL_0, true => CEOUTPOLR::CEOUTPOL_1, } } #[doc = "Checks if the value of the field is `CEOUTPOL_0`"] #[inline] pub fn is_ceoutpol_0(&self) -> bool { *self == CEOUTPOLR::CEOUTPOL_0 } #[doc = "Checks if the value of the field is `CEOUTPOL_1`"] #[inline] pub fn is_ceoutpol_1(&self) -> bool { *self == CEOUTPOLR::CEOUTPOL_1 } } #[doc = "Possible values of the field `CEF`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum CEFR { #[doc = "Comparator output is not filtered"] CEF_0, #[doc = "Comparator output is filtered"] CEF_1, } impl CEFR { #[doc = r" Returns `true` if the bit is clear (0)"] #[inline] pub fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = r" Returns `true` if the bit is set (1)"] #[inline] pub fn bit_is_set(&self) -> bool { self.bit() } #[doc = r" Value of the field as raw bits"] #[inline] pub fn bit(&self) -> bool { match *self { CEFR::CEF_0 => false, CEFR::CEF_1 => true, } } #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _from(value: bool) -> CEFR { match value { false => CEFR::CEF_0, true => CEFR::CEF_1, } } #[doc = "Checks if the value of the field is `CEF_0`"] #[inline] pub fn is_cef_0(&self) -> bool { *self == CEFR::CEF_0 } #[doc = "Checks if the value of the field is `CEF_1`"] #[inline] pub fn is_cef_1(&self) -> bool { *self == CEFR::CEF_1 } } #[doc = "Possible values of the field `CEIES`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum CEIESR { #[doc = "Rising edge for CEIFG, falling edge for CEIIFG"] CEIES_0, #[doc = "Falling edge for CEIFG, rising edge for CEIIFG"] CEIES_1, } impl CEIESR { #[doc = r" Returns `true` if the bit is clear (0)"] #[inline] pub fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = r" Returns `true` if the bit is set (1)"] #[inline] pub fn bit_is_set(&self) -> bool { self.bit() } #[doc = r" Value of the field as raw bits"] #[inline] pub fn bit(&self) -> bool { match *self { CEIESR::CEIES_0 => false, CEIESR::CEIES_1 => true, } } #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _from(value: bool) -> CEIESR { match value { false => CEIESR::CEIES_0, true => CEIESR::CEIES_1, } } #[doc = "Checks if the value of the field is `CEIES_0`"] #[inline] pub fn is_ceies_0(&self) -> bool { *self == CEIESR::CEIES_0 } #[doc = "Checks if the value of the field is `CEIES_1`"] #[inline] pub fn is_ceies_1(&self) -> bool { *self == CEIESR::CEIES_1 } } #[doc = "Possible values of the field `CESHORT`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum CESHORTR { #[doc = "Inputs not shorted"] CESHORT_0, #[doc = "Inputs shorted"] CESHORT_1, } impl CESHORTR { #[doc = r" Returns `true` if the bit is clear (0)"] #[inline] pub fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = r" Returns `true` if the bit is set (1)"] #[inline] pub fn bit_is_set(&self) -> bool { self.bit() } #[doc = r" Value of the field as raw bits"] #[inline] pub fn bit(&self) -> bool { match *self { CESHORTR::CESHORT_0 => false, CESHORTR::CESHORT_1 => true, } } #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _from(value: bool) -> CESHORTR { match value { false => CESHORTR::CESHORT_0, true => CESHORTR::CESHORT_1, } } #[doc = "Checks if the value of the field is `CESHORT_0`"] #[inline] pub fn is_ceshort_0(&self) -> bool { *self == CESHORTR::CESHORT_0 } #[doc = "Checks if the value of the field is `CESHORT_1`"] #[inline] pub fn is_ceshort_1(&self) -> bool { *self == CESHORTR::CESHORT_1 } } #[doc = r" Value of the field"] pub struct CEEXR { bits: bool, } impl CEEXR { #[doc = r" Value of the field as raw bits"] #[inline] pub fn bit(&self) -> bool { self.bits } #[doc = r" Returns `true` if the bit is clear (0)"] #[inline] pub fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = r" Returns `true` if the bit is set (1)"] #[inline] pub fn bit_is_set(&self) -> bool { self.bit() } } #[doc = "Possible values of the field `CEFDLY`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum CEFDLYR { #[doc = "Typical filter delay of TBD (450) ns"] CEFDLY_0, #[doc = "Typical filter delay of TBD (900) ns"] CEFDLY_1, #[doc = "Typical filter delay of TBD (1800) ns"] CEFDLY_2, #[doc = "Typical filter delay of TBD (3600) ns"] CEFDLY_3, } impl CEFDLYR { #[doc = r" Value of the field as raw bits"] #[inline] pub fn bits(&self) -> u8 { match *self { CEFDLYR::CEFDLY_0 => 0, CEFDLYR::CEFDLY_1 => 1, CEFDLYR::CEFDLY_2 => 2, CEFDLYR::CEFDLY_3 => 3, } } #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _from(value: u8) -> CEFDLYR { match value { 0 => CEFDLYR::CEFDLY_0, 1 => CEFDLYR::CEFDLY_1, 2 => CEFDLYR::CEFDLY_2, 3 => CEFDLYR::CEFDLY_3, _ => unreachable!(), } } #[doc = "Checks if the value of the field is `CEFDLY_0`"] #[inline] pub fn is_cefdly_0(&self) -> bool { *self == CEFDLYR::CEFDLY_0 } #[doc = "Checks if the value of the field is `CEFDLY_1`"] #[inline] pub fn is_cefdly_1(&self) -> bool { *self == CEFDLYR::CEFDLY_1 } #[doc = "Checks if the value of the field is `CEFDLY_2`"] #[inline] pub fn is_cefdly_2(&self) -> bool { *self == CEFDLYR::CEFDLY_2 } #[doc = "Checks if the value of the field is `CEFDLY_3`"] #[inline] pub fn is_cefdly_3(&self) -> bool { *self == CEFDLYR::CEFDLY_3 } } #[doc = "Possible values of the field `CEPWRMD`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum CEPWRMDR { #[doc = "High-speed mode"] CEPWRMD_0, #[doc = "Normal mode"] CEPWRMD_1, #[doc = "Ultra-low power mode"] CEPWRMD_2, #[doc = r" Reserved"] _Reserved(u8), } impl CEPWRMDR { #[doc = r" Value of the field as raw bits"] #[inline] pub fn bits(&self) -> u8 { match *self { CEPWRMDR::CEPWRMD_0 => 0, CEPWRMDR::CEPWRMD_1 => 1, CEPWRMDR::CEPWRMD_2 => 2, CEPWRMDR::_Reserved(bits) => bits, } } #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _from(value: u8) -> CEPWRMDR { match value { 0 => CEPWRMDR::CEPWRMD_0, 1 => CEPWRMDR::CEPWRMD_1, 2 => CEPWRMDR::CEPWRMD_2, i => CEPWRMDR::_Reserved(i), } } #[doc = "Checks if the value of the field is `CEPWRMD_0`"] #[inline] pub fn is_cepwrmd_0(&self) -> bool { *self == CEPWRMDR::CEPWRMD_0 } #[doc = "Checks if the value of the field is `CEPWRMD_1`"] #[inline] pub fn is_cepwrmd_1(&self) -> bool { *self == CEPWRMDR::CEPWRMD_1 } #[doc = "Checks if the value of the field is `CEPWRMD_2`"] #[inline] pub fn is_cepwrmd_2(&self) -> bool { *self == CEPWRMDR::CEPWRMD_2 } } #[doc = "Possible values of the field `CEON`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum CEONR { #[doc = "Off"] CEON_0, #[doc = "On"] CEON_1, } impl CEONR { #[doc = r" Returns `true` if the bit is clear (0)"] #[inline] pub fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = r" Returns `true` if the bit is set (1)"] #[inline] pub fn bit_is_set(&self) -> bool { self.bit() } #[doc = r" Value of the field as raw bits"] #[inline] pub fn bit(&self) -> bool { match *self { CEONR::CEON_0 => false, CEONR::CEON_1 => true, } } #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _from(value: bool) -> CEONR { match value { false => CEONR::CEON_0, true => CEONR::CEON_1, } } #[doc = "Checks if the value of the field is `CEON_0`"] #[inline] pub fn is_ceon_0(&self) -> bool { *self == CEONR::CEON_0 } #[doc = "Checks if the value of the field is `CEON_1`"] #[inline] pub fn is_ceon_1(&self) -> bool { *self == CEONR::CEON_1 } } #[doc = "Possible values of the field `CEMRVL`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum CEMRVLR { #[doc = "VREF0 is selected if CERS = 00, 01, or 10"] CEMRVL_0, #[doc = "VREF1 is selected if CERS = 00, 01, or 10"] CEMRVL_1, } impl CEMRVLR { #[doc = r" Returns `true` if the bit is clear (0)"] #[inline] pub fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = r" Returns `true` if the bit is set (1)"] #[inline] pub fn bit_is_set(&self) -> bool { self.bit() } #[doc = r" Value of the field as raw bits"] #[inline] pub fn bit(&self) -> bool { match *self { CEMRVLR::CEMRVL_0 => false, CEMRVLR::CEMRVL_1 => true, } } #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _from(value: bool) -> CEMRVLR { match value { false => CEMRVLR::CEMRVL_0, true => CEMRVLR::CEMRVL_1, } } #[doc = "Checks if the value of the field is `CEMRVL_0`"] #[inline] pub fn is_cemrvl_0(&self) -> bool { *self == CEMRVLR::CEMRVL_0 } #[doc = "Checks if the value of the field is `CEMRVL_1`"] #[inline] pub fn is_cemrvl_1(&self) -> bool { *self == CEMRVLR::CEMRVL_1 } } #[doc = "Possible values of the field `CEMRVS`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum CEMRVSR { #[doc = "Comparator output state selects between VREF0 or VREF1"] CEMRVS_0, #[doc = "CEMRVL selects between VREF0 or VREF1"] CEMRVS_1, } impl CEMRVSR { #[doc = r" Returns `true` if the bit is clear (0)"] #[inline] pub fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = r" Returns `true` if the bit is set (1)"] #[inline] pub fn bit_is_set(&self) -> bool { self.bit() } #[doc = r" Value of the field as raw bits"] #[inline] pub fn bit(&self) -> bool { match *self { CEMRVSR::CEMRVS_0 => false, CEMRVSR::CEMRVS_1 => true, } } #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _from(value: bool) -> CEMRVSR { match value { false => CEMRVSR::CEMRVS_0, true => CEMRVSR::CEMRVS_1, } } #[doc = "Checks if the value of the field is `CEMRVS_0`"] #[inline] pub fn is_cemrvs_0(&self) -> bool { *self == CEMRVSR::CEMRVS_0 } #[doc = "Checks if the value of the field is `CEMRVS_1`"] #[inline] pub fn is_cemrvs_1(&self) -> bool { *self == CEMRVSR::CEMRVS_1 } } #[doc = r" Proxy"] pub struct _CEOUTW<'a> { w: &'a mut W, } impl<'a> _CEOUTW<'a> { #[doc = r" Sets the field bit"] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r" Clears the field bit"] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r" Writes raw bits to the field"] #[inline] pub fn bit(self, value: bool) -> &'a mut W { const MASK: bool = true; const OFFSET: u8 = 0; self.w.bits &= !((MASK as u16) << OFFSET); self.w.bits |= ((value & MASK) as u16) << OFFSET; self.w } } #[doc = "Values that can be written to the field `CEOUTPOL`"] pub enum CEOUTPOLW { #[doc = "Noninverted"] CEOUTPOL_0, #[doc = "Inverted"] CEOUTPOL_1, } impl CEOUTPOLW { #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _bits(&self) -> bool { match *self { CEOUTPOLW::CEOUTPOL_0 => false, CEOUTPOLW::CEOUTPOL_1 => true, } } } #[doc = r" Proxy"] pub struct _CEOUTPOLW<'a> { w: &'a mut W, } impl<'a> _CEOUTPOLW<'a> { #[doc = r" Writes `variant` to the field"] #[inline] pub fn variant(self, variant: CEOUTPOLW) -> &'a mut W { { self.bit(variant._bits()) } } #[doc = "Noninverted"] #[inline] pub fn ceoutpol_0(self) -> &'a mut W { self.variant(CEOUTPOLW::CEOUTPOL_0) } #[doc = "Inverted"] #[inline] pub fn ceoutpol_1(self) -> &'a mut W { self.variant(CEOUTPOLW::CEOUTPOL_1) } #[doc = r" Sets the field bit"] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r" Clears the field bit"] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r" Writes raw bits to the field"] #[inline] pub fn bit(self, value: bool) -> &'a mut W { const MASK: bool = true; const OFFSET: u8 = 1; self.w.bits &= !((MASK as u16) << OFFSET); self.w.bits |= ((value & MASK) as u16) << OFFSET; self.w } } #[doc = "Values that can be written to the field `CEF`"] pub enum CEFW { #[doc = "Comparator output is not filtered"] CEF_0, #[doc = "Comparator output is filtered"] CEF_1, } impl CEFW { #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _bits(&self) -> bool { match *self { CEFW::CEF_0 => false, CEFW::CEF_1 => true, } } } #[doc = r" Proxy"] pub struct _CEFW<'a> { w: &'a mut W, } impl<'a> _CEFW<'a> { #[doc = r" Writes `variant` to the field"] #[inline] pub fn variant(self, variant: CEFW) -> &'a mut W { { self.bit(variant._bits()) } } #[doc = "Comparator output is not filtered"] #[inline] pub fn cef_0(self) -> &'a mut W { self.variant(CEFW::CEF_0) } #[doc = "Comparator output is filtered"] #[inline] pub fn cef_1(self) -> &'a mut W { self.variant(CEFW::CEF_1) } #[doc = r" Sets the field bit"] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r" Clears the field bit"] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r" Writes raw bits to the field"] #[inline] pub fn bit(self, value: bool) -> &'a mut W { const MASK: bool = true; const OFFSET: u8 = 2; self.w.bits &= !((MASK as u16) << OFFSET); self.w.bits |= ((value & MASK) as u16) << OFFSET; self.w } } #[doc = "Values that can be written to the field `CEIES`"] pub enum CEIESW { #[doc = "Rising edge for CEIFG, falling edge for CEIIFG"] CEIES_0, #[doc = "Falling edge for CEIFG, rising edge for CEIIFG"] CEIES_1, } impl CEIESW { #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _bits(&self) -> bool { match *self { CEIESW::CEIES_0 => false, CEIESW::CEIES_1 => true, } } } #[doc = r" Proxy"] pub struct _CEIESW<'a> { w: &'a mut W, } impl<'a> _CEIESW<'a> { #[doc = r" Writes `variant` to the field"] #[inline] pub fn variant(self, variant: CEIESW) -> &'a mut W { { self.bit(variant._bits()) } } #[doc = "Rising edge for CEIFG, falling edge for CEIIFG"] #[inline] pub fn ceies_0(self) -> &'a mut W { self.variant(CEIESW::CEIES_0) } #[doc = "Falling edge for CEIFG, rising edge for CEIIFG"] #[inline] pub fn ceies_1(self) -> &'a mut W { self.variant(CEIESW::CEIES_1) } #[doc = r" Sets the field bit"] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r" Clears the field bit"] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r" Writes raw bits to the field"] #[inline] pub fn bit(self, value: bool) -> &'a mut W { const MASK: bool = true; const OFFSET: u8 = 3; self.w.bits &= !((MASK as u16) << OFFSET); self.w.bits |= ((value & MASK) as u16) << OFFSET; self.w } } #[doc = "Values that can be written to the field `CESHORT`"] pub enum CESHORTW { #[doc = "Inputs not shorted"] CESHORT_0, #[doc = "Inputs shorted"] CESHORT_1, } impl CESHORTW { #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _bits(&self) -> bool { match *self { CESHORTW::CESHORT_0 => false, CESHORTW::CESHORT_1 => true, } } } #[doc = r" Proxy"] pub struct _CESHORTW<'a> { w: &'a mut W, } impl<'a> _CESHORTW<'a> { #[doc = r" Writes `variant` to the field"] #[inline] pub fn variant(self, variant: CESHORTW) -> &'a mut W { { self.bit(variant._bits()) } } #[doc = "Inputs not shorted"] #[inline] pub fn ceshort_0(self) -> &'a mut W { self.variant(CESHORTW::CESHORT_0) } #[doc = "Inputs shorted"] #[inline] pub fn ceshort_1(self) -> &'a mut W { self.variant(CESHORTW::CESHORT_1) } #[doc = r" Sets the field bit"] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r" Clears the field bit"] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r" Writes raw bits to the field"] #[inline] pub fn bit(self, value: bool) -> &'a mut W { const MASK: bool = true; const OFFSET: u8 = 4; self.w.bits &= !((MASK as u16) << OFFSET); self.w.bits |= ((value & MASK) as u16) << OFFSET; self.w } } #[doc = r" Proxy"] pub struct _CEEXW<'a> { w: &'a mut W, } impl<'a> _CEEXW<'a> { #[doc = r" Sets the field bit"] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r" Clears the field bit"] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r" Writes raw bits to the field"] #[inline] pub fn bit(self, value: bool) -> &'a mut W { const MASK: bool = true; const OFFSET: u8 = 5; self.w.bits &= !((MASK as u16) << OFFSET); self.w.bits |= ((value & MASK) as u16) << OFFSET; self.w } } #[doc = "Values that can be written to the field `CEFDLY`"] pub enum CEFDLYW { #[doc = "Typical filter delay of TBD (450) ns"] CEFDLY_0, #[doc = "Typical filter delay of TBD (900) ns"] CEFDLY_1, #[doc = "Typical filter delay of TBD (1800) ns"] CEFDLY_2, #[doc = "Typical filter delay of TBD (3600) ns"] CEFDLY_3, } impl CEFDLYW { #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _bits(&self) -> u8 { match *self { CEFDLYW::CEFDLY_0 => 0, CEFDLYW::CEFDLY_1 => 1, CEFDLYW::CEFDLY_2 => 2, CEFDLYW::CEFDLY_3 => 3, } } } #[doc = r" Proxy"] pub struct _CEFDLYW<'a> { w: &'a mut W, } impl<'a> _CEFDLYW<'a> { #[doc = r" Writes `variant` to the field"] #[inline] pub fn variant(self, variant: CEFDLYW) -> &'a mut W { { self.bits(variant._bits()) } } #[doc = "Typical filter delay of TBD (450) ns"] #[inline] pub fn cefdly_0(self) -> &'a mut W { self.variant(CEFDLYW::CEFDLY_0) } #[doc = "Typical filter delay of TBD (900) ns"] #[inline] pub fn cefdly_1(self) -> &'a mut W { self.variant(CEFDLYW::CEFDLY_1) } #[doc = "Typical filter delay of TBD (1800) ns"] #[inline] pub fn cefdly_2(self) -> &'a mut W { self.variant(CEFDLYW::CEFDLY_2) } #[doc = "Typical filter delay of TBD (3600) ns"] #[inline] pub fn cefdly_3(self) -> &'a mut W { self.variant(CEFDLYW::CEFDLY_3) } #[doc = r" Writes raw bits to the field"] #[inline] pub fn bits(self, value: u8) -> &'a mut W { const MASK: u8 = 3; const OFFSET: u8 = 6; self.w.bits &= !((MASK as u16) << OFFSET); self.w.bits |= ((value & MASK) as u16) << OFFSET; self.w } } #[doc = "Values that can be written to the field `CEPWRMD`"] pub enum CEPWRMDW { #[doc = "High-speed mode"] CEPWRMD_0, #[doc = "Normal mode"] CEPWRMD_1, #[doc = "Ultra-low power mode"] CEPWRMD_2, } impl CEPWRMDW { #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _bits(&self) -> u8 { match *self { CEPWRMDW::CEPWRMD_0 => 0, CEPWRMDW::CEPWRMD_1 => 1, CEPWRMDW::CEPWRMD_2 => 2, } } } #[doc = r" Proxy"] pub struct _CEPWRMDW<'a> { w: &'a mut W, } impl<'a> _CEPWRMDW<'a> { #[doc = r" Writes `variant` to the field"] #[inline] pub fn variant(self, variant: CEPWRMDW) -> &'a mut W { unsafe { self.bits(variant._bits()) } } #[doc = "High-speed mode"] #[inline] pub fn cepwrmd_0(self) -> &'a mut W { self.variant(CEPWRMDW::CEPWRMD_0) } #[doc = "Normal mode"] #[inline] pub fn cepwrmd_1(self) -> &'a mut W { self.variant(CEPWRMDW::CEPWRMD_1) } #[doc = "Ultra-low power mode"] #[inline] pub fn cepwrmd_2(self) -> &'a mut W { self.variant(CEPWRMDW::CEPWRMD_2) } #[doc = r" Writes raw bits to the field"] #[inline] pub unsafe fn bits(self, value: u8) -> &'a mut W { const MASK: u8 = 3; const OFFSET: u8 = 8; self.w.bits &= !((MASK as u16) << OFFSET); self.w.bits |= ((value & MASK) as u16) << OFFSET; self.w } } #[doc = "Values that can be written to the field `CEON`"] pub enum CEONW { #[doc = "Off"] CEON_0, #[doc = "On"] CEON_1, } impl CEONW { #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _bits(&self) -> bool { match *self { CEONW::CEON_0 => false, CEONW::CEON_1 => true, } } } #[doc = r" Proxy"] pub struct _CEONW<'a> { w: &'a mut W, } impl<'a> _CEONW<'a> { #[doc = r" Writes `variant` to the field"] #[inline] pub fn variant(self, variant: CEONW) -> &'a mut W { { self.bit(variant._bits()) } } #[doc = "Off"] #[inline] pub fn ceon_0(self) -> &'a mut W { self.variant(CEONW::CEON_0) } #[doc = "On"] #[inline] pub fn ceon_1(self) -> &'a mut W { self.variant(CEONW::CEON_1) } #[doc = r" Sets the field bit"] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r" Clears the field bit"] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r" Writes raw bits to the field"] #[inline] pub fn bit(self, value: bool) -> &'a mut W { const MASK: bool = true; const OFFSET: u8 = 10; self.w.bits &= !((MASK as u16) << OFFSET); self.w.bits |= ((value & MASK) as u16) << OFFSET; self.w } } #[doc = "Values that can be written to the field `CEMRVL`"] pub enum CEMRVLW { #[doc = "VREF0 is selected if CERS = 00, 01, or 10"] CEMRVL_0, #[doc = "VREF1 is selected if CERS = 00, 01, or 10"] CEMRVL_1, } impl CEMRVLW { #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _bits(&self) -> bool { match *self { CEMRVLW::CEMRVL_0 => false, CEMRVLW::CEMRVL_1 => true, } } } #[doc = r" Proxy"] pub struct _CEMRVLW<'a> { w: &'a mut W, } impl<'a> _CEMRVLW<'a> { #[doc = r" Writes `variant` to the field"] #[inline] pub fn variant(self, variant: CEMRVLW) -> &'a mut W { { self.bit(variant._bits()) } } #[doc = "VREF0 is selected if CERS = 00, 01, or 10"] #[inline] pub fn cemrvl_0(self) -> &'a mut W { self.variant(CEMRVLW::CEMRVL_0) } #[doc = "VREF1 is selected if CERS = 00, 01, or 10"] #[inline] pub fn cemrvl_1(self) -> &'a mut W { self.variant(CEMRVLW::CEMRVL_1) } #[doc = r" Sets the field bit"] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r" Clears the field bit"] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r" Writes raw bits to the field"] #[inline] pub fn bit(self, value: bool) -> &'a mut W { const MASK: bool = true; const OFFSET: u8 = 11; self.w.bits &= !((MASK as u16) << OFFSET); self.w.bits |= ((value & MASK) as u16) << OFFSET; self.w } } #[doc = "Values that can be written to the field `CEMRVS`"] pub enum CEMRVSW { #[doc = "Comparator output state selects between VREF0 or VREF1"] CEMRVS_0, #[doc = "CEMRVL selects between VREF0 or VREF1"] CEMRVS_1, } impl CEMRVSW { #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _bits(&self) -> bool { match *self { CEMRVSW::CEMRVS_0 => false, CEMRVSW::CEMRVS_1 => true, } } } #[doc = r" Proxy"] pub struct _CEMRVSW<'a> { w: &'a mut W, } impl<'a> _CEMRVSW<'a> { #[doc = r" Writes `variant` to the field"] #[inline] pub fn variant(self, variant: CEMRVSW) -> &'a mut W { { self.bit(variant._bits()) } } #[doc = "Comparator output state selects between VREF0 or VREF1"] #[inline] pub fn cemrvs_0(self) -> &'a mut W { self.variant(CEMRVSW::CEMRVS_0) } #[doc = "CEMRVL selects between VREF0 or VREF1"] #[inline] pub fn cemrvs_1(self) -> &'a mut W { self.variant(CEMRVSW::CEMRVS_1) } #[doc = r" Sets the field bit"] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r" Clears the field bit"] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r" Writes raw bits to the field"] #[inline] pub fn bit(self, value: bool) -> &'a mut W { const MASK: bool = true; const OFFSET: u8 = 12; self.w.bits &= !((MASK as u16) << OFFSET); self.w.bits |= ((value & MASK) as u16) << OFFSET; self.w } } impl R { #[doc = r" Value of the register as raw bits"] #[inline] pub fn bits(&self) -> u16 { self.bits } #[doc = "Bit 0 - Comparator output value"] #[inline] pub fn ceout(&self) -> CEOUTR { let bits = { const MASK: bool = true; const OFFSET: u8 = 0; ((self.bits >> OFFSET) & MASK as u16) != 0 }; CEOUTR { bits } } #[doc = "Bit 1 - Comparator output polarity"] #[inline] pub fn ceoutpol(&self) -> CEOUTPOLR { CEOUTPOLR::_from({ const MASK: bool = true; const OFFSET: u8 = 1; ((self.bits >> OFFSET) & MASK as u16) != 0 }) } #[doc = "Bit 2 - Comparator output filter"] #[inline] pub fn cef(&self) -> CEFR { CEFR::_from({ const MASK: bool = true; const OFFSET: u8 = 2; ((self.bits >> OFFSET) & MASK as u16) != 0 }) } #[doc = "Bit 3 - Interrupt edge select for CEIIFG and CEIFG"] #[inline] pub fn ceies(&self) -> CEIESR { CEIESR::_from({ const MASK: bool = true; const OFFSET: u8 = 3; ((self.bits >> OFFSET) & MASK as u16) != 0 }) } #[doc = "Bit 4 - Input short"] #[inline] pub fn ceshort(&self) -> CESHORTR { CESHORTR::_from({ const MASK: bool = true; const OFFSET: u8 = 4; ((self.bits >> OFFSET) & MASK as u16) != 0 }) } #[doc = "Bit 5 - Exchange"] #[inline] pub fn ceex(&self) -> CEEXR { let bits = { const MASK: bool = true; const OFFSET: u8 = 5; ((self.bits >> OFFSET) & MASK as u16) != 0 }; CEEXR { bits } } #[doc = "Bits 6:7 - Filter delay"] #[inline] pub fn cefdly(&self) -> CEFDLYR { CEFDLYR::_from({ const MASK: u8 = 3; const OFFSET: u8 = 6; ((self.bits >> OFFSET) & MASK as u16) as u8 }) } #[doc = "Bits 8:9 - Power Mode"] #[inline] pub fn cepwrmd(&self) -> CEPWRMDR { CEPWRMDR::_from({ const MASK: u8 = 3; const OFFSET: u8 = 8; ((self.bits >> OFFSET) & MASK as u16) as u8 }) } #[doc = "Bit 10 - Comparator On"] #[inline] pub fn ceon(&self) -> CEONR { CEONR::_from({ const MASK: bool = true; const OFFSET: u8 = 10; ((self.bits >> OFFSET) & MASK as u16) != 0 }) } #[doc = "Bit 11 - This bit is valid of CEMRVS is set to 1"] #[inline] pub fn cemrvl(&self) -> CEMRVLR { CEMRVLR::_from({ const MASK: bool = true; const OFFSET: u8 = 11; ((self.bits >> OFFSET) & MASK as u16) != 0 }) } #[doc = "Bit 12 - This bit defines if the comparator output selects between VREF0 or VREF1 if CERS = 00, 01, or 10."] #[inline] pub fn cemrvs(&self) -> CEMRVSR { CEMRVSR::_from({ const MASK: bool = true; const OFFSET: u8 = 12; ((self.bits >> OFFSET) & MASK as u16) != 0 }) } } impl W { #[doc = r" Reset value of the register"] #[inline] pub fn reset_value() -> W { W { bits: 0 } } #[doc = r" Writes raw bits to the register"] #[inline] pub unsafe fn bits(&mut self, bits: u16) -> &mut Self { self.bits = bits; self } #[doc = "Bit 0 - Comparator output value"] #[inline] pub fn ceout(&mut self) -> _CEOUTW { _CEOUTW { w: self } } #[doc = "Bit 1 - Comparator output polarity"] #[inline] pub fn ceoutpol(&mut self) -> _CEOUTPOLW { _CEOUTPOLW { w: self } } #[doc = "Bit 2 - Comparator output filter"] #[inline] pub fn cef(&mut self) -> _CEFW { _CEFW { w: self } } #[doc = "Bit 3 - Interrupt edge select for CEIIFG and CEIFG"] #[inline] pub fn ceies(&mut self) -> _CEIESW { _CEIESW { w: self } } #[doc = "Bit 4 - Input short"] #[inline] pub fn ceshort(&mut self) -> _CESHORTW { _CESHORTW { w: self } } #[doc = "Bit 5 - Exchange"] #[inline] pub fn ceex(&mut self) -> _CEEXW { _CEEXW { w: self } } #[doc = "Bits 6:7 - Filter delay"] #[inline] pub fn cefdly(&mut self) -> _CEFDLYW { _CEFDLYW { w: self } } #[doc = "Bits 8:9 - Power Mode"] #[inline] pub fn cepwrmd(&mut self) -> _CEPWRMDW { _CEPWRMDW { w: self } } #[doc = "Bit 10 - Comparator On"] #[inline] pub fn ceon(&mut self) -> _CEONW { _CEONW { w: self } } #[doc = "Bit 11 - This bit is valid of CEMRVS is set to 1"] #[inline] pub fn cemrvl(&mut self) -> _CEMRVLW { _CEMRVLW { w: self } } #[doc = "Bit 12 - This bit defines if the comparator output selects between VREF0 or VREF1 if CERS = 00, 01, or 10."] #[inline] pub fn cemrvs(&mut self) -> _CEMRVSW { _CEMRVSW { w: self } } }