#[doc = "Register `IDAC` reader"]
pub struct R(crate::R<IDAC_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<IDAC_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::convert::From<crate::R<IDAC_SPEC>> for R {
    fn from(reader: crate::R<IDAC_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `IDAC` writer"]
pub struct W(crate::W<IDAC_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<IDAC_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::ops::DerefMut for W {
    #[inline(always)]
    fn deref_mut(&mut self) -> &mut Self::Target {
        &mut self.0
    }
}
impl core::convert::From<crate::W<IDAC_SPEC>> for W {
    fn from(writer: crate::W<IDAC_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `IDAC1` reader - Current setting for IDAC1 (8 bits)."]
pub struct IDAC1_R(crate::FieldReader<u8, u8>);
impl IDAC1_R {
    pub(crate) fn new(bits: u8) -> Self {
        IDAC1_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for IDAC1_R {
    type Target = crate::FieldReader<u8, u8>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `IDAC1` writer - Current setting for IDAC1 (8 bits)."]
pub struct IDAC1_W<'a> {
    w: &'a mut W,
}
impl<'a> IDAC1_W<'a> {
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff);
        self.w
    }
}
#[doc = "Controls the usage mode of IDAC1\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum IDAC1_MODE_A {
    #[doc = "0: No description available"]
    OFF = 0,
    #[doc = "1: No description available"]
    FIXED = 1,
    #[doc = "2: No description available"]
    VARIABLE = 2,
    #[doc = "3: No description available"]
    DSI = 3,
}
impl From<IDAC1_MODE_A> for u8 {
    #[inline(always)]
    fn from(variant: IDAC1_MODE_A) -> Self {
        variant as _
    }
}
#[doc = "Field `IDAC1_MODE` reader - Controls the usage mode of IDAC1"]
pub struct IDAC1_MODE_R(crate::FieldReader<u8, IDAC1_MODE_A>);
impl IDAC1_MODE_R {
    pub(crate) fn new(bits: u8) -> Self {
        IDAC1_MODE_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> IDAC1_MODE_A {
        match self.bits {
            0 => IDAC1_MODE_A::OFF,
            1 => IDAC1_MODE_A::FIXED,
            2 => IDAC1_MODE_A::VARIABLE,
            3 => IDAC1_MODE_A::DSI,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `OFF`"]
    #[inline(always)]
    pub fn is_off(&self) -> bool {
        **self == IDAC1_MODE_A::OFF
    }
    #[doc = "Checks if the value of the field is `FIXED`"]
    #[inline(always)]
    pub fn is_fixed(&self) -> bool {
        **self == IDAC1_MODE_A::FIXED
    }
    #[doc = "Checks if the value of the field is `VARIABLE`"]
    #[inline(always)]
    pub fn is_variable(&self) -> bool {
        **self == IDAC1_MODE_A::VARIABLE
    }
    #[doc = "Checks if the value of the field is `DSI`"]
    #[inline(always)]
    pub fn is_dsi(&self) -> bool {
        **self == IDAC1_MODE_A::DSI
    }
}
impl core::ops::Deref for IDAC1_MODE_R {
    type Target = crate::FieldReader<u8, IDAC1_MODE_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `IDAC1_MODE` writer - Controls the usage mode of IDAC1"]
pub struct IDAC1_MODE_W<'a> {
    w: &'a mut W,
}
impl<'a> IDAC1_MODE_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: IDAC1_MODE_A) -> &'a mut W {
        self.bits(variant.into())
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn off(self) -> &'a mut W {
        self.variant(IDAC1_MODE_A::OFF)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn fixed(self) -> &'a mut W {
        self.variant(IDAC1_MODE_A::FIXED)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn variable(self) -> &'a mut W {
        self.variant(IDAC1_MODE_A::VARIABLE)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn dsi(self) -> &'a mut W {
        self.variant(IDAC1_MODE_A::DSI)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x03 << 8)) | ((value as u32 & 0x03) << 8);
        self.w
    }
}
#[doc = "Current multiplier setting for IDAC1.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum IDAC1_RANGE_A {
    #[doc = "0: No description available"]
    CY4X = 0,
    #[doc = "1: No description available"]
    CY8X = 1,
}
impl From<IDAC1_RANGE_A> for bool {
    #[inline(always)]
    fn from(variant: IDAC1_RANGE_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `IDAC1_RANGE` reader - Current multiplier setting for IDAC1."]
pub struct IDAC1_RANGE_R(crate::FieldReader<bool, IDAC1_RANGE_A>);
impl IDAC1_RANGE_R {
    pub(crate) fn new(bits: bool) -> Self {
        IDAC1_RANGE_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> IDAC1_RANGE_A {
        match self.bits {
            false => IDAC1_RANGE_A::CY4X,
            true => IDAC1_RANGE_A::CY8X,
        }
    }
    #[doc = "Checks if the value of the field is `CY4X`"]
    #[inline(always)]
    pub fn is_cy4x(&self) -> bool {
        **self == IDAC1_RANGE_A::CY4X
    }
    #[doc = "Checks if the value of the field is `CY8X`"]
    #[inline(always)]
    pub fn is_cy8x(&self) -> bool {
        **self == IDAC1_RANGE_A::CY8X
    }
}
impl core::ops::Deref for IDAC1_RANGE_R {
    type Target = crate::FieldReader<bool, IDAC1_RANGE_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `IDAC1_RANGE` writer - Current multiplier setting for IDAC1."]
pub struct IDAC1_RANGE_W<'a> {
    w: &'a mut W,
}
impl<'a> IDAC1_RANGE_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: IDAC1_RANGE_A) -> &'a mut W {
        self.bit(variant.into())
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn cy4x(self) -> &'a mut W {
        self.variant(IDAC1_RANGE_A::CY4X)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn cy8x(self) -> &'a mut W {
        self.variant(IDAC1_RANGE_A::CY8X)
    }
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10);
        self.w
    }
}
#[doc = "Field `POLARITY1_MIR` reader - Mirror bit for POLARITY bit in CONFIG register"]
pub struct POLARITY1_MIR_R(crate::FieldReader<bool, bool>);
impl POLARITY1_MIR_R {
    pub(crate) fn new(bits: bool) -> Self {
        POLARITY1_MIR_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for POLARITY1_MIR_R {
    type Target = crate::FieldReader<bool, bool>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `POLARITY1_MIR` writer - Mirror bit for POLARITY bit in CONFIG register"]
pub struct POLARITY1_MIR_W<'a> {
    w: &'a mut W,
}
impl<'a> POLARITY1_MIR_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12);
        self.w
    }
}
#[doc = "Field `IDAC2` reader - Current setting for IDAC2 (7 bits)."]
pub struct IDAC2_R(crate::FieldReader<u8, u8>);
impl IDAC2_R {
    pub(crate) fn new(bits: u8) -> Self {
        IDAC2_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for IDAC2_R {
    type Target = crate::FieldReader<u8, u8>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `IDAC2` writer - Current setting for IDAC2 (7 bits)."]
pub struct IDAC2_W<'a> {
    w: &'a mut W,
}
impl<'a> IDAC2_W<'a> {
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x7f << 16)) | ((value as u32 & 0x7f) << 16);
        self.w
    }
}
#[doc = "Controls the usage mode of IDAC2\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum IDAC2_MODE_A {
    #[doc = "0: No description available"]
    OFF = 0,
    #[doc = "1: No description available"]
    FIXED = 1,
    #[doc = "2: No description available"]
    VARIABLE = 2,
    #[doc = "3: No description available"]
    DSI = 3,
}
impl From<IDAC2_MODE_A> for u8 {
    #[inline(always)]
    fn from(variant: IDAC2_MODE_A) -> Self {
        variant as _
    }
}
#[doc = "Field `IDAC2_MODE` reader - Controls the usage mode of IDAC2"]
pub struct IDAC2_MODE_R(crate::FieldReader<u8, IDAC2_MODE_A>);
impl IDAC2_MODE_R {
    pub(crate) fn new(bits: u8) -> Self {
        IDAC2_MODE_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> IDAC2_MODE_A {
        match self.bits {
            0 => IDAC2_MODE_A::OFF,
            1 => IDAC2_MODE_A::FIXED,
            2 => IDAC2_MODE_A::VARIABLE,
            3 => IDAC2_MODE_A::DSI,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `OFF`"]
    #[inline(always)]
    pub fn is_off(&self) -> bool {
        **self == IDAC2_MODE_A::OFF
    }
    #[doc = "Checks if the value of the field is `FIXED`"]
    #[inline(always)]
    pub fn is_fixed(&self) -> bool {
        **self == IDAC2_MODE_A::FIXED
    }
    #[doc = "Checks if the value of the field is `VARIABLE`"]
    #[inline(always)]
    pub fn is_variable(&self) -> bool {
        **self == IDAC2_MODE_A::VARIABLE
    }
    #[doc = "Checks if the value of the field is `DSI`"]
    #[inline(always)]
    pub fn is_dsi(&self) -> bool {
        **self == IDAC2_MODE_A::DSI
    }
}
impl core::ops::Deref for IDAC2_MODE_R {
    type Target = crate::FieldReader<u8, IDAC2_MODE_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `IDAC2_MODE` writer - Controls the usage mode of IDAC2"]
pub struct IDAC2_MODE_W<'a> {
    w: &'a mut W,
}
impl<'a> IDAC2_MODE_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: IDAC2_MODE_A) -> &'a mut W {
        self.bits(variant.into())
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn off(self) -> &'a mut W {
        self.variant(IDAC2_MODE_A::OFF)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn fixed(self) -> &'a mut W {
        self.variant(IDAC2_MODE_A::FIXED)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn variable(self) -> &'a mut W {
        self.variant(IDAC2_MODE_A::VARIABLE)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn dsi(self) -> &'a mut W {
        self.variant(IDAC2_MODE_A::DSI)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x03 << 24)) | ((value as u32 & 0x03) << 24);
        self.w
    }
}
#[doc = "Current multiplier setting for IDAC2.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum IDAC2_RANGE_A {
    #[doc = "0: No description available"]
    CY4X = 0,
    #[doc = "1: No description available"]
    CY8X = 1,
}
impl From<IDAC2_RANGE_A> for bool {
    #[inline(always)]
    fn from(variant: IDAC2_RANGE_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `IDAC2_RANGE` reader - Current multiplier setting for IDAC2."]
pub struct IDAC2_RANGE_R(crate::FieldReader<bool, IDAC2_RANGE_A>);
impl IDAC2_RANGE_R {
    pub(crate) fn new(bits: bool) -> Self {
        IDAC2_RANGE_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> IDAC2_RANGE_A {
        match self.bits {
            false => IDAC2_RANGE_A::CY4X,
            true => IDAC2_RANGE_A::CY8X,
        }
    }
    #[doc = "Checks if the value of the field is `CY4X`"]
    #[inline(always)]
    pub fn is_cy4x(&self) -> bool {
        **self == IDAC2_RANGE_A::CY4X
    }
    #[doc = "Checks if the value of the field is `CY8X`"]
    #[inline(always)]
    pub fn is_cy8x(&self) -> bool {
        **self == IDAC2_RANGE_A::CY8X
    }
}
impl core::ops::Deref for IDAC2_RANGE_R {
    type Target = crate::FieldReader<bool, IDAC2_RANGE_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `IDAC2_RANGE` writer - Current multiplier setting for IDAC2."]
pub struct IDAC2_RANGE_W<'a> {
    w: &'a mut W,
}
impl<'a> IDAC2_RANGE_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: IDAC2_RANGE_A) -> &'a mut W {
        self.bit(variant.into())
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn cy4x(self) -> &'a mut W {
        self.variant(IDAC2_RANGE_A::CY4X)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn cy8x(self) -> &'a mut W {
        self.variant(IDAC2_RANGE_A::CY8X)
    }
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26);
        self.w
    }
}
#[doc = "Field `POLARITY2_MIR` reader - Mirror bit for POLARITY2 bit in CONFIG register"]
pub struct POLARITY2_MIR_R(crate::FieldReader<bool, bool>);
impl POLARITY2_MIR_R {
    pub(crate) fn new(bits: bool) -> Self {
        POLARITY2_MIR_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for POLARITY2_MIR_R {
    type Target = crate::FieldReader<bool, bool>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `POLARITY2_MIR` writer - Mirror bit for POLARITY2 bit in CONFIG register"]
pub struct POLARITY2_MIR_W<'a> {
    w: &'a mut W,
}
impl<'a> POLARITY2_MIR_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28);
        self.w
    }
}
#[doc = "This bit controls whether, during CSD operation, the IDAC is controlled from the sampling flip-flop or directly from the comparator.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum FEEDBACK_MODE_A {
    #[doc = "0: No description available"]
    FLOP = 0,
    #[doc = "1: No description available"]
    COMP = 1,
}
impl From<FEEDBACK_MODE_A> for bool {
    #[inline(always)]
    fn from(variant: FEEDBACK_MODE_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `FEEDBACK_MODE` reader - This bit controls whether, during CSD operation, the IDAC is controlled from the sampling flip-flop or directly from the comparator."]
pub struct FEEDBACK_MODE_R(crate::FieldReader<bool, FEEDBACK_MODE_A>);
impl FEEDBACK_MODE_R {
    pub(crate) fn new(bits: bool) -> Self {
        FEEDBACK_MODE_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> FEEDBACK_MODE_A {
        match self.bits {
            false => FEEDBACK_MODE_A::FLOP,
            true => FEEDBACK_MODE_A::COMP,
        }
    }
    #[doc = "Checks if the value of the field is `FLOP`"]
    #[inline(always)]
    pub fn is_flop(&self) -> bool {
        **self == FEEDBACK_MODE_A::FLOP
    }
    #[doc = "Checks if the value of the field is `COMP`"]
    #[inline(always)]
    pub fn is_comp(&self) -> bool {
        **self == FEEDBACK_MODE_A::COMP
    }
}
impl core::ops::Deref for FEEDBACK_MODE_R {
    type Target = crate::FieldReader<bool, FEEDBACK_MODE_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `FEEDBACK_MODE` writer - This bit controls whether, during CSD operation, the IDAC is controlled from the sampling flip-flop or directly from the comparator."]
pub struct FEEDBACK_MODE_W<'a> {
    w: &'a mut W,
}
impl<'a> FEEDBACK_MODE_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: FEEDBACK_MODE_A) -> &'a mut W {
        self.bit(variant.into())
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn flop(self) -> &'a mut W {
        self.variant(FEEDBACK_MODE_A::FLOP)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn comp(self) -> &'a mut W {
        self.variant(FEEDBACK_MODE_A::COMP)
    }
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30);
        self.w
    }
}
impl R {
    #[doc = "Bits 0:7 - Current setting for IDAC1 (8 bits)."]
    #[inline(always)]
    pub fn idac1(&self) -> IDAC1_R {
        IDAC1_R::new((self.bits & 0xff) as u8)
    }
    #[doc = "Bits 8:9 - Controls the usage mode of IDAC1"]
    #[inline(always)]
    pub fn idac1_mode(&self) -> IDAC1_MODE_R {
        IDAC1_MODE_R::new(((self.bits >> 8) & 0x03) as u8)
    }
    #[doc = "Bit 10 - Current multiplier setting for IDAC1."]
    #[inline(always)]
    pub fn idac1_range(&self) -> IDAC1_RANGE_R {
        IDAC1_RANGE_R::new(((self.bits >> 10) & 0x01) != 0)
    }
    #[doc = "Bit 12 - Mirror bit for POLARITY bit in CONFIG register"]
    #[inline(always)]
    pub fn polarity1_mir(&self) -> POLARITY1_MIR_R {
        POLARITY1_MIR_R::new(((self.bits >> 12) & 0x01) != 0)
    }
    #[doc = "Bits 16:22 - Current setting for IDAC2 (7 bits)."]
    #[inline(always)]
    pub fn idac2(&self) -> IDAC2_R {
        IDAC2_R::new(((self.bits >> 16) & 0x7f) as u8)
    }
    #[doc = "Bits 24:25 - Controls the usage mode of IDAC2"]
    #[inline(always)]
    pub fn idac2_mode(&self) -> IDAC2_MODE_R {
        IDAC2_MODE_R::new(((self.bits >> 24) & 0x03) as u8)
    }
    #[doc = "Bit 26 - Current multiplier setting for IDAC2."]
    #[inline(always)]
    pub fn idac2_range(&self) -> IDAC2_RANGE_R {
        IDAC2_RANGE_R::new(((self.bits >> 26) & 0x01) != 0)
    }
    #[doc = "Bit 28 - Mirror bit for POLARITY2 bit in CONFIG register"]
    #[inline(always)]
    pub fn polarity2_mir(&self) -> POLARITY2_MIR_R {
        POLARITY2_MIR_R::new(((self.bits >> 28) & 0x01) != 0)
    }
    #[doc = "Bit 30 - This bit controls whether, during CSD operation, the IDAC is controlled from the sampling flip-flop or directly from the comparator."]
    #[inline(always)]
    pub fn feedback_mode(&self) -> FEEDBACK_MODE_R {
        FEEDBACK_MODE_R::new(((self.bits >> 30) & 0x01) != 0)
    }
}
impl W {
    #[doc = "Bits 0:7 - Current setting for IDAC1 (8 bits)."]
    #[inline(always)]
    pub fn idac1(&mut self) -> IDAC1_W {
        IDAC1_W { w: self }
    }
    #[doc = "Bits 8:9 - Controls the usage mode of IDAC1"]
    #[inline(always)]
    pub fn idac1_mode(&mut self) -> IDAC1_MODE_W {
        IDAC1_MODE_W { w: self }
    }
    #[doc = "Bit 10 - Current multiplier setting for IDAC1."]
    #[inline(always)]
    pub fn idac1_range(&mut self) -> IDAC1_RANGE_W {
        IDAC1_RANGE_W { w: self }
    }
    #[doc = "Bit 12 - Mirror bit for POLARITY bit in CONFIG register"]
    #[inline(always)]
    pub fn polarity1_mir(&mut self) -> POLARITY1_MIR_W {
        POLARITY1_MIR_W { w: self }
    }
    #[doc = "Bits 16:22 - Current setting for IDAC2 (7 bits)."]
    #[inline(always)]
    pub fn idac2(&mut self) -> IDAC2_W {
        IDAC2_W { w: self }
    }
    #[doc = "Bits 24:25 - Controls the usage mode of IDAC2"]
    #[inline(always)]
    pub fn idac2_mode(&mut self) -> IDAC2_MODE_W {
        IDAC2_MODE_W { w: self }
    }
    #[doc = "Bit 26 - Current multiplier setting for IDAC2."]
    #[inline(always)]
    pub fn idac2_range(&mut self) -> IDAC2_RANGE_W {
        IDAC2_RANGE_W { w: self }
    }
    #[doc = "Bit 28 - Mirror bit for POLARITY2 bit in CONFIG register"]
    #[inline(always)]
    pub fn polarity2_mir(&mut self) -> POLARITY2_MIR_W {
        POLARITY2_MIR_W { w: self }
    }
    #[doc = "Bit 30 - This bit controls whether, during CSD operation, the IDAC is controlled from the sampling flip-flop or directly from the comparator."]
    #[inline(always)]
    pub fn feedback_mode(&mut self) -> FEEDBACK_MODE_W {
        FEEDBACK_MODE_W { w: self }
    }
    #[doc = "Writes raw bits to the register."]
    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
        self.0.bits(bits);
        self
    }
}
#[doc = "IDAC Configuration\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [idac](index.html) module"]
pub struct IDAC_SPEC;
impl crate::RegisterSpec for IDAC_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [idac::R](R) reader structure"]
impl crate::Readable for IDAC_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [idac::W](W) writer structure"]
impl crate::Writable for IDAC_SPEC {
    type Writer = W;
}
#[doc = "`reset()` method sets IDAC to value 0"]
impl crate::Resettable for IDAC_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0
    }
}
