atsam4sa16c_pac/pwm/
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 `WPSWS0` reader - Write Protect SW Status"]
17pub type WPSWS0_R = crate::BitReader<bool>;
18#[doc = "Field `WPSWS1` reader - Write Protect SW Status"]
19pub type WPSWS1_R = crate::BitReader<bool>;
20#[doc = "Field `WPSWS2` reader - Write Protect SW Status"]
21pub type WPSWS2_R = crate::BitReader<bool>;
22#[doc = "Field `WPSWS3` reader - Write Protect SW Status"]
23pub type WPSWS3_R = crate::BitReader<bool>;
24#[doc = "Field `WPSWS4` reader - Write Protect SW Status"]
25pub type WPSWS4_R = crate::BitReader<bool>;
26#[doc = "Field `WPSWS5` reader - Write Protect SW Status"]
27pub type WPSWS5_R = crate::BitReader<bool>;
28#[doc = "Field `WPVS` reader - Write Protect Violation Status"]
29pub type WPVS_R = crate::BitReader<bool>;
30#[doc = "Field `WPHWS0` reader - Write Protect HW Status"]
31pub type WPHWS0_R = crate::BitReader<bool>;
32#[doc = "Field `WPHWS1` reader - Write Protect HW Status"]
33pub type WPHWS1_R = crate::BitReader<bool>;
34#[doc = "Field `WPHWS2` reader - Write Protect HW Status"]
35pub type WPHWS2_R = crate::BitReader<bool>;
36#[doc = "Field `WPHWS3` reader - Write Protect HW Status"]
37pub type WPHWS3_R = crate::BitReader<bool>;
38#[doc = "Field `WPHWS4` reader - Write Protect HW Status"]
39pub type WPHWS4_R = crate::BitReader<bool>;
40#[doc = "Field `WPHWS5` reader - Write Protect HW Status"]
41pub type WPHWS5_R = crate::BitReader<bool>;
42#[doc = "Field `WPVSRC` reader - Write Protect Violation Source"]
43pub type WPVSRC_R = crate::FieldReader<u16, u16>;
44impl R {
45    #[doc = "Bit 0 - Write Protect SW Status"]
46    #[inline(always)]
47    pub fn wpsws0(&self) -> WPSWS0_R {
48        WPSWS0_R::new((self.bits & 1) != 0)
49    }
50    #[doc = "Bit 1 - Write Protect SW Status"]
51    #[inline(always)]
52    pub fn wpsws1(&self) -> WPSWS1_R {
53        WPSWS1_R::new(((self.bits >> 1) & 1) != 0)
54    }
55    #[doc = "Bit 2 - Write Protect SW Status"]
56    #[inline(always)]
57    pub fn wpsws2(&self) -> WPSWS2_R {
58        WPSWS2_R::new(((self.bits >> 2) & 1) != 0)
59    }
60    #[doc = "Bit 3 - Write Protect SW Status"]
61    #[inline(always)]
62    pub fn wpsws3(&self) -> WPSWS3_R {
63        WPSWS3_R::new(((self.bits >> 3) & 1) != 0)
64    }
65    #[doc = "Bit 4 - Write Protect SW Status"]
66    #[inline(always)]
67    pub fn wpsws4(&self) -> WPSWS4_R {
68        WPSWS4_R::new(((self.bits >> 4) & 1) != 0)
69    }
70    #[doc = "Bit 5 - Write Protect SW Status"]
71    #[inline(always)]
72    pub fn wpsws5(&self) -> WPSWS5_R {
73        WPSWS5_R::new(((self.bits >> 5) & 1) != 0)
74    }
75    #[doc = "Bit 7 - Write Protect Violation Status"]
76    #[inline(always)]
77    pub fn wpvs(&self) -> WPVS_R {
78        WPVS_R::new(((self.bits >> 7) & 1) != 0)
79    }
80    #[doc = "Bit 8 - Write Protect HW Status"]
81    #[inline(always)]
82    pub fn wphws0(&self) -> WPHWS0_R {
83        WPHWS0_R::new(((self.bits >> 8) & 1) != 0)
84    }
85    #[doc = "Bit 9 - Write Protect HW Status"]
86    #[inline(always)]
87    pub fn wphws1(&self) -> WPHWS1_R {
88        WPHWS1_R::new(((self.bits >> 9) & 1) != 0)
89    }
90    #[doc = "Bit 10 - Write Protect HW Status"]
91    #[inline(always)]
92    pub fn wphws2(&self) -> WPHWS2_R {
93        WPHWS2_R::new(((self.bits >> 10) & 1) != 0)
94    }
95    #[doc = "Bit 11 - Write Protect HW Status"]
96    #[inline(always)]
97    pub fn wphws3(&self) -> WPHWS3_R {
98        WPHWS3_R::new(((self.bits >> 11) & 1) != 0)
99    }
100    #[doc = "Bit 12 - Write Protect HW Status"]
101    #[inline(always)]
102    pub fn wphws4(&self) -> WPHWS4_R {
103        WPHWS4_R::new(((self.bits >> 12) & 1) != 0)
104    }
105    #[doc = "Bit 13 - Write Protect HW Status"]
106    #[inline(always)]
107    pub fn wphws5(&self) -> WPHWS5_R {
108        WPHWS5_R::new(((self.bits >> 13) & 1) != 0)
109    }
110    #[doc = "Bits 16:31 - Write Protect Violation Source"]
111    #[inline(always)]
112    pub fn wpvsrc(&self) -> WPVSRC_R {
113        WPVSRC_R::new(((self.bits >> 16) & 0xffff) as u16)
114    }
115}
116#[doc = "PWM 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"]
117pub struct WPSR_SPEC;
118impl crate::RegisterSpec for WPSR_SPEC {
119    type Ux = u32;
120}
121#[doc = "`read()` method returns [wpsr::R](R) reader structure"]
122impl crate::Readable for WPSR_SPEC {
123    type Reader = R;
124}
125#[doc = "`reset()` method sets WPSR to value 0"]
126impl crate::Resettable for WPSR_SPEC {
127    const RESET_VALUE: Self::Ux = 0;
128}