atsam4e16c_pac/afec0/
wpsr.rs

1#[doc = "Register `WPSR` reader"]
2pub struct R(crate::R<WPSR_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<WPSR_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<WPSR_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<WPSR_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `WPVS` reader - Write Protect Violation Status"]
17pub type WPVS_R = crate::BitReader<bool>;
18#[doc = "Field `WPVSRC` reader - Write Protect Violation Source"]
19pub type WPVSRC_R = crate::FieldReader<u16, u16>;
20impl R {
21    #[doc = "Bit 0 - Write Protect Violation Status"]
22    #[inline(always)]
23    pub fn wpvs(&self) -> WPVS_R {
24        WPVS_R::new((self.bits & 1) != 0)
25    }
26    #[doc = "Bits 8:23 - Write Protect Violation Source"]
27    #[inline(always)]
28    pub fn wpvsrc(&self) -> WPVSRC_R {
29        WPVSRC_R::new(((self.bits >> 8) & 0xffff) as u16)
30    }
31}
32#[doc = "AFEC Write Protection Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [wpsr](index.html) module"]
33pub struct WPSR_SPEC;
34impl crate::RegisterSpec for WPSR_SPEC {
35    type Ux = u32;
36}
37#[doc = "`read()` method returns [wpsr::R](R) reader structure"]
38impl crate::Readable for WPSR_SPEC {
39    type Reader = R;
40}
41#[doc = "`reset()` method sets WPSR to value 0"]
42impl crate::Resettable for WPSR_SPEC {
43    const RESET_VALUE: Self::Ux = 0;
44}