#[doc = "Register `CHAN_WORK13` reader"]
pub struct R(crate::R<CHAN_WORK13_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<CHAN_WORK13_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::convert::From<crate::R<CHAN_WORK13_SPEC>> for R {
    fn from(reader: crate::R<CHAN_WORK13_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `CHAN_WORK13` writer"]
pub struct W(crate::W<CHAN_WORK13_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<CHAN_WORK13_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<CHAN_WORK13_SPEC>> for W {
    fn from(writer: crate::W<CHAN_WORK13_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `WORK` reader - SAR conversion working data of the channel. The data is written here right after sampling this channel."]
pub struct WORK_R(crate::FieldReader<u16, u16>);
impl WORK_R {
    pub(crate) fn new(bits: u16) -> Self {
        WORK_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for WORK_R {
    type Target = crate::FieldReader<u16, u16>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `CHAN_WORK_VALID_MIR` reader - mirror bit of corresponding bit in SAR_CHAN_WORK_VALID register"]
pub struct CHAN_WORK_VALID_MIR_R(crate::FieldReader<bool, bool>);
impl CHAN_WORK_VALID_MIR_R {
    pub(crate) fn new(bits: bool) -> Self {
        CHAN_WORK_VALID_MIR_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for CHAN_WORK_VALID_MIR_R {
    type Target = crate::FieldReader<bool, bool>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl R {
    #[doc = "Bits 0:15 - SAR conversion working data of the channel. The data is written here right after sampling this channel."]
    #[inline(always)]
    pub fn work(&self) -> WORK_R {
        WORK_R::new((self.bits & 0xffff) as u16)
    }
    #[doc = "Bit 31 - mirror bit of corresponding bit in SAR_CHAN_WORK_VALID register"]
    #[inline(always)]
    pub fn chan_work_valid_mir(&self) -> CHAN_WORK_VALID_MIR_R {
        CHAN_WORK_VALID_MIR_R::new(((self.bits >> 31) & 0x01) != 0)
    }
}
impl W {
    #[doc = "Writes raw bits to the register."]
    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
        self.0.bits(bits);
        self
    }
}
#[doc = "Channel working data register\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 [chan_work13](index.html) module"]
pub struct CHAN_WORK13_SPEC;
impl crate::RegisterSpec for CHAN_WORK13_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [chan_work13::R](R) reader structure"]
impl crate::Readable for CHAN_WORK13_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [chan_work13::W](W) writer structure"]
impl crate::Writable for CHAN_WORK13_SPEC {
    type Writer = W;
}
#[doc = "`reset()` method sets CHAN_WORK13 to value 0"]
impl crate::Resettable for CHAN_WORK13_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0
    }
}
