#[doc = "Register `ALT_PROT_ROW140` reader"]
pub struct R(crate::R<ALT_PROT_ROW140_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<ALT_PROT_ROW140_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::convert::From<crate::R<ALT_PROT_ROW140_SPEC>> for R {
    fn from(reader: crate::R<ALT_PROT_ROW140_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `ALT_PROT_ROW140` writer"]
pub struct W(crate::W<ALT_PROT_ROW140_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<ALT_PROT_ROW140_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<ALT_PROT_ROW140_SPEC>> for W {
    fn from(writer: crate::W<ALT_PROT_ROW140_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `DATA8` reader - Protection Data (1b per page)"]
pub struct DATA8_R(crate::FieldReader<u8, u8>);
impl DATA8_R {
    pub(crate) fn new(bits: u8) -> Self {
        DATA8_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for DATA8_R {
    type Target = crate::FieldReader<u8, u8>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `DATA8` writer - Protection Data (1b per page)"]
pub struct DATA8_W<'a> {
    w: &'a mut W,
}
impl<'a> DATA8_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 u8 & 0xff);
        self.w
    }
}
impl R {
    #[doc = "Bits 0:7 - Protection Data (1b per page)"]
    #[inline(always)]
    pub fn data8(&self) -> DATA8_R {
        DATA8_R::new((self.bits & 0xff) as u8)
    }
}
impl W {
    #[doc = "Bits 0:7 - Protection Data (1b per page)"]
    #[inline(always)]
    pub fn data8(&mut self) -> DATA8_W {
        DATA8_W { w: self }
    }
    #[doc = "Writes raw bits to the register."]
    pub unsafe fn bits(&mut self, bits: u8) -> &mut Self {
        self.0.bits(bits);
        self
    }
}
#[doc = "Per Page Write Protection\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 [alt_prot_row140](index.html) module"]
pub struct ALT_PROT_ROW140_SPEC;
impl crate::RegisterSpec for ALT_PROT_ROW140_SPEC {
    type Ux = u8;
}
#[doc = "`read()` method returns [alt_prot_row140::R](R) reader structure"]
impl crate::Readable for ALT_PROT_ROW140_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [alt_prot_row140::W](W) writer structure"]
impl crate::Writable for ALT_PROT_ROW140_SPEC {
    type Writer = W;
}
#[doc = "`reset()` method sets ALT_PROT_ROW140 to value 0"]
impl crate::Resettable for ALT_PROT_ROW140_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0
    }
}
