#[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::CEXCTL0 { #[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 = "Possible values of the field `CEIPSEL`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum CEIPSELR { #[doc = "Channel 0 selected"] CEIPSEL_0, #[doc = "Channel 1 selected"] CEIPSEL_1, #[doc = "Channel 2 selected"] CEIPSEL_2, #[doc = "Channel 3 selected"] CEIPSEL_3, #[doc = "Channel 4 selected"] CEIPSEL_4, #[doc = "Channel 5 selected"] CEIPSEL_5, #[doc = "Channel 6 selected"] CEIPSEL_6, #[doc = "Channel 7 selected"] CEIPSEL_7, #[doc = "Channel 8 selected"] CEIPSEL_8, #[doc = "Channel 9 selected"] CEIPSEL_9, #[doc = "Channel 10 selected"] CEIPSEL_10, #[doc = "Channel 11 selected"] CEIPSEL_11, #[doc = "Channel 12 selected"] CEIPSEL_12, #[doc = "Channel 13 selected"] CEIPSEL_13, #[doc = "Channel 14 selected"] CEIPSEL_14, #[doc = "Channel 15 selected"] CEIPSEL_15, } impl CEIPSELR { #[doc = r" Value of the field as raw bits"] #[inline] pub fn bits(&self) -> u8 { match *self { CEIPSELR::CEIPSEL_0 => 0, CEIPSELR::CEIPSEL_1 => 1, CEIPSELR::CEIPSEL_2 => 2, CEIPSELR::CEIPSEL_3 => 3, CEIPSELR::CEIPSEL_4 => 4, CEIPSELR::CEIPSEL_5 => 5, CEIPSELR::CEIPSEL_6 => 6, CEIPSELR::CEIPSEL_7 => 7, CEIPSELR::CEIPSEL_8 => 8, CEIPSELR::CEIPSEL_9 => 9, CEIPSELR::CEIPSEL_10 => 10, CEIPSELR::CEIPSEL_11 => 11, CEIPSELR::CEIPSEL_12 => 12, CEIPSELR::CEIPSEL_13 => 13, CEIPSELR::CEIPSEL_14 => 14, CEIPSELR::CEIPSEL_15 => 15, } } #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _from(value: u8) -> CEIPSELR { match value { 0 => CEIPSELR::CEIPSEL_0, 1 => CEIPSELR::CEIPSEL_1, 2 => CEIPSELR::CEIPSEL_2, 3 => CEIPSELR::CEIPSEL_3, 4 => CEIPSELR::CEIPSEL_4, 5 => CEIPSELR::CEIPSEL_5, 6 => CEIPSELR::CEIPSEL_6, 7 => CEIPSELR::CEIPSEL_7, 8 => CEIPSELR::CEIPSEL_8, 9 => CEIPSELR::CEIPSEL_9, 10 => CEIPSELR::CEIPSEL_10, 11 => CEIPSELR::CEIPSEL_11, 12 => CEIPSELR::CEIPSEL_12, 13 => CEIPSELR::CEIPSEL_13, 14 => CEIPSELR::CEIPSEL_14, 15 => CEIPSELR::CEIPSEL_15, _ => unreachable!(), } } #[doc = "Checks if the value of the field is `CEIPSEL_0`"] #[inline] pub fn is_ceipsel_0(&self) -> bool { *self == CEIPSELR::CEIPSEL_0 } #[doc = "Checks if the value of the field is `CEIPSEL_1`"] #[inline] pub fn is_ceipsel_1(&self) -> bool { *self == CEIPSELR::CEIPSEL_1 } #[doc = "Checks if the value of the field is `CEIPSEL_2`"] #[inline] pub fn is_ceipsel_2(&self) -> bool { *self == CEIPSELR::CEIPSEL_2 } #[doc = "Checks if the value of the field is `CEIPSEL_3`"] #[inline] pub fn is_ceipsel_3(&self) -> bool { *self == CEIPSELR::CEIPSEL_3 } #[doc = "Checks if the value of the field is `CEIPSEL_4`"] #[inline] pub fn is_ceipsel_4(&self) -> bool { *self == CEIPSELR::CEIPSEL_4 } #[doc = "Checks if the value of the field is `CEIPSEL_5`"] #[inline] pub fn is_ceipsel_5(&self) -> bool { *self == CEIPSELR::CEIPSEL_5 } #[doc = "Checks if the value of the field is `CEIPSEL_6`"] #[inline] pub fn is_ceipsel_6(&self) -> bool { *self == CEIPSELR::CEIPSEL_6 } #[doc = "Checks if the value of the field is `CEIPSEL_7`"] #[inline] pub fn is_ceipsel_7(&self) -> bool { *self == CEIPSELR::CEIPSEL_7 } #[doc = "Checks if the value of the field is `CEIPSEL_8`"] #[inline] pub fn is_ceipsel_8(&self) -> bool { *self == CEIPSELR::CEIPSEL_8 } #[doc = "Checks if the value of the field is `CEIPSEL_9`"] #[inline] pub fn is_ceipsel_9(&self) -> bool { *self == CEIPSELR::CEIPSEL_9 } #[doc = "Checks if the value of the field is `CEIPSEL_10`"] #[inline] pub fn is_ceipsel_10(&self) -> bool { *self == CEIPSELR::CEIPSEL_10 } #[doc = "Checks if the value of the field is `CEIPSEL_11`"] #[inline] pub fn is_ceipsel_11(&self) -> bool { *self == CEIPSELR::CEIPSEL_11 } #[doc = "Checks if the value of the field is `CEIPSEL_12`"] #[inline] pub fn is_ceipsel_12(&self) -> bool { *self == CEIPSELR::CEIPSEL_12 } #[doc = "Checks if the value of the field is `CEIPSEL_13`"] #[inline] pub fn is_ceipsel_13(&self) -> bool { *self == CEIPSELR::CEIPSEL_13 } #[doc = "Checks if the value of the field is `CEIPSEL_14`"] #[inline] pub fn is_ceipsel_14(&self) -> bool { *self == CEIPSELR::CEIPSEL_14 } #[doc = "Checks if the value of the field is `CEIPSEL_15`"] #[inline] pub fn is_ceipsel_15(&self) -> bool { *self == CEIPSELR::CEIPSEL_15 } } #[doc = "Possible values of the field `CEIPEN`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum CEIPENR { #[doc = "Selected analog input channel for V+ terminal is disabled"] CEIPEN_0, #[doc = "Selected analog input channel for V+ terminal is enabled"] CEIPEN_1, } impl CEIPENR { #[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 { CEIPENR::CEIPEN_0 => false, CEIPENR::CEIPEN_1 => true, } } #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _from(value: bool) -> CEIPENR { match value { false => CEIPENR::CEIPEN_0, true => CEIPENR::CEIPEN_1, } } #[doc = "Checks if the value of the field is `CEIPEN_0`"] #[inline] pub fn is_ceipen_0(&self) -> bool { *self == CEIPENR::CEIPEN_0 } #[doc = "Checks if the value of the field is `CEIPEN_1`"] #[inline] pub fn is_ceipen_1(&self) -> bool { *self == CEIPENR::CEIPEN_1 } } #[doc = "Possible values of the field `CEIMSEL`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum CEIMSELR { #[doc = "Channel 0 selected"] CEIMSEL_0, #[doc = "Channel 1 selected"] CEIMSEL_1, #[doc = "Channel 2 selected"] CEIMSEL_2, #[doc = "Channel 3 selected"] CEIMSEL_3, #[doc = "Channel 4 selected"] CEIMSEL_4, #[doc = "Channel 5 selected"] CEIMSEL_5, #[doc = "Channel 6 selected"] CEIMSEL_6, #[doc = "Channel 7 selected"] CEIMSEL_7, #[doc = "Channel 8 selected"] CEIMSEL_8, #[doc = "Channel 9 selected"] CEIMSEL_9, #[doc = "Channel 10 selected"] CEIMSEL_10, #[doc = "Channel 11 selected"] CEIMSEL_11, #[doc = "Channel 12 selected"] CEIMSEL_12, #[doc = "Channel 13 selected"] CEIMSEL_13, #[doc = "Channel 14 selected"] CEIMSEL_14, #[doc = "Channel 15 selected"] CEIMSEL_15, } impl CEIMSELR { #[doc = r" Value of the field as raw bits"] #[inline] pub fn bits(&self) -> u8 { match *self { CEIMSELR::CEIMSEL_0 => 0, CEIMSELR::CEIMSEL_1 => 1, CEIMSELR::CEIMSEL_2 => 2, CEIMSELR::CEIMSEL_3 => 3, CEIMSELR::CEIMSEL_4 => 4, CEIMSELR::CEIMSEL_5 => 5, CEIMSELR::CEIMSEL_6 => 6, CEIMSELR::CEIMSEL_7 => 7, CEIMSELR::CEIMSEL_8 => 8, CEIMSELR::CEIMSEL_9 => 9, CEIMSELR::CEIMSEL_10 => 10, CEIMSELR::CEIMSEL_11 => 11, CEIMSELR::CEIMSEL_12 => 12, CEIMSELR::CEIMSEL_13 => 13, CEIMSELR::CEIMSEL_14 => 14, CEIMSELR::CEIMSEL_15 => 15, } } #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _from(value: u8) -> CEIMSELR { match value { 0 => CEIMSELR::CEIMSEL_0, 1 => CEIMSELR::CEIMSEL_1, 2 => CEIMSELR::CEIMSEL_2, 3 => CEIMSELR::CEIMSEL_3, 4 => CEIMSELR::CEIMSEL_4, 5 => CEIMSELR::CEIMSEL_5, 6 => CEIMSELR::CEIMSEL_6, 7 => CEIMSELR::CEIMSEL_7, 8 => CEIMSELR::CEIMSEL_8, 9 => CEIMSELR::CEIMSEL_9, 10 => CEIMSELR::CEIMSEL_10, 11 => CEIMSELR::CEIMSEL_11, 12 => CEIMSELR::CEIMSEL_12, 13 => CEIMSELR::CEIMSEL_13, 14 => CEIMSELR::CEIMSEL_14, 15 => CEIMSELR::CEIMSEL_15, _ => unreachable!(), } } #[doc = "Checks if the value of the field is `CEIMSEL_0`"] #[inline] pub fn is_ceimsel_0(&self) -> bool { *self == CEIMSELR::CEIMSEL_0 } #[doc = "Checks if the value of the field is `CEIMSEL_1`"] #[inline] pub fn is_ceimsel_1(&self) -> bool { *self == CEIMSELR::CEIMSEL_1 } #[doc = "Checks if the value of the field is `CEIMSEL_2`"] #[inline] pub fn is_ceimsel_2(&self) -> bool { *self == CEIMSELR::CEIMSEL_2 } #[doc = "Checks if the value of the field is `CEIMSEL_3`"] #[inline] pub fn is_ceimsel_3(&self) -> bool { *self == CEIMSELR::CEIMSEL_3 } #[doc = "Checks if the value of the field is `CEIMSEL_4`"] #[inline] pub fn is_ceimsel_4(&self) -> bool { *self == CEIMSELR::CEIMSEL_4 } #[doc = "Checks if the value of the field is `CEIMSEL_5`"] #[inline] pub fn is_ceimsel_5(&self) -> bool { *self == CEIMSELR::CEIMSEL_5 } #[doc = "Checks if the value of the field is `CEIMSEL_6`"] #[inline] pub fn is_ceimsel_6(&self) -> bool { *self == CEIMSELR::CEIMSEL_6 } #[doc = "Checks if the value of the field is `CEIMSEL_7`"] #[inline] pub fn is_ceimsel_7(&self) -> bool { *self == CEIMSELR::CEIMSEL_7 } #[doc = "Checks if the value of the field is `CEIMSEL_8`"] #[inline] pub fn is_ceimsel_8(&self) -> bool { *self == CEIMSELR::CEIMSEL_8 } #[doc = "Checks if the value of the field is `CEIMSEL_9`"] #[inline] pub fn is_ceimsel_9(&self) -> bool { *self == CEIMSELR::CEIMSEL_9 } #[doc = "Checks if the value of the field is `CEIMSEL_10`"] #[inline] pub fn is_ceimsel_10(&self) -> bool { *self == CEIMSELR::CEIMSEL_10 } #[doc = "Checks if the value of the field is `CEIMSEL_11`"] #[inline] pub fn is_ceimsel_11(&self) -> bool { *self == CEIMSELR::CEIMSEL_11 } #[doc = "Checks if the value of the field is `CEIMSEL_12`"] #[inline] pub fn is_ceimsel_12(&self) -> bool { *self == CEIMSELR::CEIMSEL_12 } #[doc = "Checks if the value of the field is `CEIMSEL_13`"] #[inline] pub fn is_ceimsel_13(&self) -> bool { *self == CEIMSELR::CEIMSEL_13 } #[doc = "Checks if the value of the field is `CEIMSEL_14`"] #[inline] pub fn is_ceimsel_14(&self) -> bool { *self == CEIMSELR::CEIMSEL_14 } #[doc = "Checks if the value of the field is `CEIMSEL_15`"] #[inline] pub fn is_ceimsel_15(&self) -> bool { *self == CEIMSELR::CEIMSEL_15 } } #[doc = "Possible values of the field `CEIMEN`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum CEIMENR { #[doc = "Selected analog input channel for V- terminal is disabled"] CEIMEN_0, #[doc = "Selected analog input channel for V- terminal is enabled"] CEIMEN_1, } impl CEIMENR { #[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 { CEIMENR::CEIMEN_0 => false, CEIMENR::CEIMEN_1 => true, } } #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _from(value: bool) -> CEIMENR { match value { false => CEIMENR::CEIMEN_0, true => CEIMENR::CEIMEN_1, } } #[doc = "Checks if the value of the field is `CEIMEN_0`"] #[inline] pub fn is_ceimen_0(&self) -> bool { *self == CEIMENR::CEIMEN_0 } #[doc = "Checks if the value of the field is `CEIMEN_1`"] #[inline] pub fn is_ceimen_1(&self) -> bool { *self == CEIMENR::CEIMEN_1 } } #[doc = "Values that can be written to the field `CEIPSEL`"] pub enum CEIPSELW { #[doc = "Channel 0 selected"] CEIPSEL_0, #[doc = "Channel 1 selected"] CEIPSEL_1, #[doc = "Channel 2 selected"] CEIPSEL_2, #[doc = "Channel 3 selected"] CEIPSEL_3, #[doc = "Channel 4 selected"] CEIPSEL_4, #[doc = "Channel 5 selected"] CEIPSEL_5, #[doc = "Channel 6 selected"] CEIPSEL_6, #[doc = "Channel 7 selected"] CEIPSEL_7, #[doc = "Channel 8 selected"] CEIPSEL_8, #[doc = "Channel 9 selected"] CEIPSEL_9, #[doc = "Channel 10 selected"] CEIPSEL_10, #[doc = "Channel 11 selected"] CEIPSEL_11, #[doc = "Channel 12 selected"] CEIPSEL_12, #[doc = "Channel 13 selected"] CEIPSEL_13, #[doc = "Channel 14 selected"] CEIPSEL_14, #[doc = "Channel 15 selected"] CEIPSEL_15, } impl CEIPSELW { #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _bits(&self) -> u8 { match *self { CEIPSELW::CEIPSEL_0 => 0, CEIPSELW::CEIPSEL_1 => 1, CEIPSELW::CEIPSEL_2 => 2, CEIPSELW::CEIPSEL_3 => 3, CEIPSELW::CEIPSEL_4 => 4, CEIPSELW::CEIPSEL_5 => 5, CEIPSELW::CEIPSEL_6 => 6, CEIPSELW::CEIPSEL_7 => 7, CEIPSELW::CEIPSEL_8 => 8, CEIPSELW::CEIPSEL_9 => 9, CEIPSELW::CEIPSEL_10 => 10, CEIPSELW::CEIPSEL_11 => 11, CEIPSELW::CEIPSEL_12 => 12, CEIPSELW::CEIPSEL_13 => 13, CEIPSELW::CEIPSEL_14 => 14, CEIPSELW::CEIPSEL_15 => 15, } } } #[doc = r" Proxy"] pub struct _CEIPSELW<'a> { w: &'a mut W, } impl<'a> _CEIPSELW<'a> { #[doc = r" Writes `variant` to the field"] #[inline] pub fn variant(self, variant: CEIPSELW) -> &'a mut W { { self.bits(variant._bits()) } } #[doc = "Channel 0 selected"] #[inline] pub fn ceipsel_0(self) -> &'a mut W { self.variant(CEIPSELW::CEIPSEL_0) } #[doc = "Channel 1 selected"] #[inline] pub fn ceipsel_1(self) -> &'a mut W { self.variant(CEIPSELW::CEIPSEL_1) } #[doc = "Channel 2 selected"] #[inline] pub fn ceipsel_2(self) -> &'a mut W { self.variant(CEIPSELW::CEIPSEL_2) } #[doc = "Channel 3 selected"] #[inline] pub fn ceipsel_3(self) -> &'a mut W { self.variant(CEIPSELW::CEIPSEL_3) } #[doc = "Channel 4 selected"] #[inline] pub fn ceipsel_4(self) -> &'a mut W { self.variant(CEIPSELW::CEIPSEL_4) } #[doc = "Channel 5 selected"] #[inline] pub fn ceipsel_5(self) -> &'a mut W { self.variant(CEIPSELW::CEIPSEL_5) } #[doc = "Channel 6 selected"] #[inline] pub fn ceipsel_6(self) -> &'a mut W { self.variant(CEIPSELW::CEIPSEL_6) } #[doc = "Channel 7 selected"] #[inline] pub fn ceipsel_7(self) -> &'a mut W { self.variant(CEIPSELW::CEIPSEL_7) } #[doc = "Channel 8 selected"] #[inline] pub fn ceipsel_8(self) -> &'a mut W { self.variant(CEIPSELW::CEIPSEL_8) } #[doc = "Channel 9 selected"] #[inline] pub fn ceipsel_9(self) -> &'a mut W { self.variant(CEIPSELW::CEIPSEL_9) } #[doc = "Channel 10 selected"] #[inline] pub fn ceipsel_10(self) -> &'a mut W { self.variant(CEIPSELW::CEIPSEL_10) } #[doc = "Channel 11 selected"] #[inline] pub fn ceipsel_11(self) -> &'a mut W { self.variant(CEIPSELW::CEIPSEL_11) } #[doc = "Channel 12 selected"] #[inline] pub fn ceipsel_12(self) -> &'a mut W { self.variant(CEIPSELW::CEIPSEL_12) } #[doc = "Channel 13 selected"] #[inline] pub fn ceipsel_13(self) -> &'a mut W { self.variant(CEIPSELW::CEIPSEL_13) } #[doc = "Channel 14 selected"] #[inline] pub fn ceipsel_14(self) -> &'a mut W { self.variant(CEIPSELW::CEIPSEL_14) } #[doc = "Channel 15 selected"] #[inline] pub fn ceipsel_15(self) -> &'a mut W { self.variant(CEIPSELW::CEIPSEL_15) } #[doc = r" Writes raw bits to the field"] #[inline] pub fn bits(self, value: u8) -> &'a mut W { const MASK: u8 = 15; 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 `CEIPEN`"] pub enum CEIPENW { #[doc = "Selected analog input channel for V+ terminal is disabled"] CEIPEN_0, #[doc = "Selected analog input channel for V+ terminal is enabled"] CEIPEN_1, } impl CEIPENW { #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _bits(&self) -> bool { match *self { CEIPENW::CEIPEN_0 => false, CEIPENW::CEIPEN_1 => true, } } } #[doc = r" Proxy"] pub struct _CEIPENW<'a> { w: &'a mut W, } impl<'a> _CEIPENW<'a> { #[doc = r" Writes `variant` to the field"] #[inline] pub fn variant(self, variant: CEIPENW) -> &'a mut W { { self.bit(variant._bits()) } } #[doc = "Selected analog input channel for V+ terminal is disabled"] #[inline] pub fn ceipen_0(self) -> &'a mut W { self.variant(CEIPENW::CEIPEN_0) } #[doc = "Selected analog input channel for V+ terminal is enabled"] #[inline] pub fn ceipen_1(self) -> &'a mut W { self.variant(CEIPENW::CEIPEN_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 = 7; 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 `CEIMSEL`"] pub enum CEIMSELW { #[doc = "Channel 0 selected"] CEIMSEL_0, #[doc = "Channel 1 selected"] CEIMSEL_1, #[doc = "Channel 2 selected"] CEIMSEL_2, #[doc = "Channel 3 selected"] CEIMSEL_3, #[doc = "Channel 4 selected"] CEIMSEL_4, #[doc = "Channel 5 selected"] CEIMSEL_5, #[doc = "Channel 6 selected"] CEIMSEL_6, #[doc = "Channel 7 selected"] CEIMSEL_7, #[doc = "Channel 8 selected"] CEIMSEL_8, #[doc = "Channel 9 selected"] CEIMSEL_9, #[doc = "Channel 10 selected"] CEIMSEL_10, #[doc = "Channel 11 selected"] CEIMSEL_11, #[doc = "Channel 12 selected"] CEIMSEL_12, #[doc = "Channel 13 selected"] CEIMSEL_13, #[doc = "Channel 14 selected"] CEIMSEL_14, #[doc = "Channel 15 selected"] CEIMSEL_15, } impl CEIMSELW { #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _bits(&self) -> u8 { match *self { CEIMSELW::CEIMSEL_0 => 0, CEIMSELW::CEIMSEL_1 => 1, CEIMSELW::CEIMSEL_2 => 2, CEIMSELW::CEIMSEL_3 => 3, CEIMSELW::CEIMSEL_4 => 4, CEIMSELW::CEIMSEL_5 => 5, CEIMSELW::CEIMSEL_6 => 6, CEIMSELW::CEIMSEL_7 => 7, CEIMSELW::CEIMSEL_8 => 8, CEIMSELW::CEIMSEL_9 => 9, CEIMSELW::CEIMSEL_10 => 10, CEIMSELW::CEIMSEL_11 => 11, CEIMSELW::CEIMSEL_12 => 12, CEIMSELW::CEIMSEL_13 => 13, CEIMSELW::CEIMSEL_14 => 14, CEIMSELW::CEIMSEL_15 => 15, } } } #[doc = r" Proxy"] pub struct _CEIMSELW<'a> { w: &'a mut W, } impl<'a> _CEIMSELW<'a> { #[doc = r" Writes `variant` to the field"] #[inline] pub fn variant(self, variant: CEIMSELW) -> &'a mut W { { self.bits(variant._bits()) } } #[doc = "Channel 0 selected"] #[inline] pub fn ceimsel_0(self) -> &'a mut W { self.variant(CEIMSELW::CEIMSEL_0) } #[doc = "Channel 1 selected"] #[inline] pub fn ceimsel_1(self) -> &'a mut W { self.variant(CEIMSELW::CEIMSEL_1) } #[doc = "Channel 2 selected"] #[inline] pub fn ceimsel_2(self) -> &'a mut W { self.variant(CEIMSELW::CEIMSEL_2) } #[doc = "Channel 3 selected"] #[inline] pub fn ceimsel_3(self) -> &'a mut W { self.variant(CEIMSELW::CEIMSEL_3) } #[doc = "Channel 4 selected"] #[inline] pub fn ceimsel_4(self) -> &'a mut W { self.variant(CEIMSELW::CEIMSEL_4) } #[doc = "Channel 5 selected"] #[inline] pub fn ceimsel_5(self) -> &'a mut W { self.variant(CEIMSELW::CEIMSEL_5) } #[doc = "Channel 6 selected"] #[inline] pub fn ceimsel_6(self) -> &'a mut W { self.variant(CEIMSELW::CEIMSEL_6) } #[doc = "Channel 7 selected"] #[inline] pub fn ceimsel_7(self) -> &'a mut W { self.variant(CEIMSELW::CEIMSEL_7) } #[doc = "Channel 8 selected"] #[inline] pub fn ceimsel_8(self) -> &'a mut W { self.variant(CEIMSELW::CEIMSEL_8) } #[doc = "Channel 9 selected"] #[inline] pub fn ceimsel_9(self) -> &'a mut W { self.variant(CEIMSELW::CEIMSEL_9) } #[doc = "Channel 10 selected"] #[inline] pub fn ceimsel_10(self) -> &'a mut W { self.variant(CEIMSELW::CEIMSEL_10) } #[doc = "Channel 11 selected"] #[inline] pub fn ceimsel_11(self) -> &'a mut W { self.variant(CEIMSELW::CEIMSEL_11) } #[doc = "Channel 12 selected"] #[inline] pub fn ceimsel_12(self) -> &'a mut W { self.variant(CEIMSELW::CEIMSEL_12) } #[doc = "Channel 13 selected"] #[inline] pub fn ceimsel_13(self) -> &'a mut W { self.variant(CEIMSELW::CEIMSEL_13) } #[doc = "Channel 14 selected"] #[inline] pub fn ceimsel_14(self) -> &'a mut W { self.variant(CEIMSELW::CEIMSEL_14) } #[doc = "Channel 15 selected"] #[inline] pub fn ceimsel_15(self) -> &'a mut W { self.variant(CEIMSELW::CEIMSEL_15) } #[doc = r" Writes raw bits to the field"] #[inline] pub fn bits(self, value: u8) -> &'a mut W { const MASK: u8 = 15; 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 `CEIMEN`"] pub enum CEIMENW { #[doc = "Selected analog input channel for V- terminal is disabled"] CEIMEN_0, #[doc = "Selected analog input channel for V- terminal is enabled"] CEIMEN_1, } impl CEIMENW { #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _bits(&self) -> bool { match *self { CEIMENW::CEIMEN_0 => false, CEIMENW::CEIMEN_1 => true, } } } #[doc = r" Proxy"] pub struct _CEIMENW<'a> { w: &'a mut W, } impl<'a> _CEIMENW<'a> { #[doc = r" Writes `variant` to the field"] #[inline] pub fn variant(self, variant: CEIMENW) -> &'a mut W { { self.bit(variant._bits()) } } #[doc = "Selected analog input channel for V- terminal is disabled"] #[inline] pub fn ceimen_0(self) -> &'a mut W { self.variant(CEIMENW::CEIMEN_0) } #[doc = "Selected analog input channel for V- terminal is enabled"] #[inline] pub fn ceimen_1(self) -> &'a mut W { self.variant(CEIMENW::CEIMEN_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 = 15; 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 = "Bits 0:3 - Channel input selected for the V+ terminal"] #[inline] pub fn ceipsel(&self) -> CEIPSELR { CEIPSELR::_from({ const MASK: u8 = 15; const OFFSET: u8 = 0; ((self.bits >> OFFSET) & MASK as u16) as u8 }) } #[doc = "Bit 7 - Channel input enable for the V+ terminal"] #[inline] pub fn ceipen(&self) -> CEIPENR { CEIPENR::_from({ const MASK: bool = true; const OFFSET: u8 = 7; ((self.bits >> OFFSET) & MASK as u16) != 0 }) } #[doc = "Bits 8:11 - Channel input selected for the - terminal"] #[inline] pub fn ceimsel(&self) -> CEIMSELR { CEIMSELR::_from({ const MASK: u8 = 15; const OFFSET: u8 = 8; ((self.bits >> OFFSET) & MASK as u16) as u8 }) } #[doc = "Bit 15 - Channel input enable for the - terminal"] #[inline] pub fn ceimen(&self) -> CEIMENR { CEIMENR::_from({ const MASK: bool = true; const OFFSET: u8 = 15; ((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 = "Bits 0:3 - Channel input selected for the V+ terminal"] #[inline] pub fn ceipsel(&mut self) -> _CEIPSELW { _CEIPSELW { w: self } } #[doc = "Bit 7 - Channel input enable for the V+ terminal"] #[inline] pub fn ceipen(&mut self) -> _CEIPENW { _CEIPENW { w: self } } #[doc = "Bits 8:11 - Channel input selected for the - terminal"] #[inline] pub fn ceimsel(&mut self) -> _CEIMSELW { _CEIMSELW { w: self } } #[doc = "Bit 15 - Channel input enable for the - terminal"] #[inline] pub fn ceimen(&mut self) -> _CEIMENW { _CEIMENW { w: self } } }