atsams70n21/matrix/
matrix_wpsr.rs

1#[doc = "Register `MATRIX_WPSR` reader"]
2pub struct R(crate::R<MATRIX_WPSR_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<MATRIX_WPSR_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<MATRIX_WPSR_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<MATRIX_WPSR_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `WPVS` reader - Write Protection Violation Status"]
17pub struct WPVS_R(crate::FieldReader<bool, bool>);
18impl WPVS_R {
19    #[inline(always)]
20    pub(crate) fn new(bits: bool) -> Self {
21        WPVS_R(crate::FieldReader::new(bits))
22    }
23}
24impl core::ops::Deref for WPVS_R {
25    type Target = crate::FieldReader<bool, bool>;
26    #[inline(always)]
27    fn deref(&self) -> &Self::Target {
28        &self.0
29    }
30}
31#[doc = "Field `WPVSRC` reader - Write Protection Violation Source"]
32pub struct WPVSRC_R(crate::FieldReader<u16, u16>);
33impl WPVSRC_R {
34    #[inline(always)]
35    pub(crate) fn new(bits: u16) -> Self {
36        WPVSRC_R(crate::FieldReader::new(bits))
37    }
38}
39impl core::ops::Deref for WPVSRC_R {
40    type Target = crate::FieldReader<u16, u16>;
41    #[inline(always)]
42    fn deref(&self) -> &Self::Target {
43        &self.0
44    }
45}
46impl R {
47    #[doc = "Bit 0 - Write Protection Violation Status"]
48    #[inline(always)]
49    pub fn wpvs(&self) -> WPVS_R {
50        WPVS_R::new((self.bits & 0x01) != 0)
51    }
52    #[doc = "Bits 8:23 - Write Protection Violation Source"]
53    #[inline(always)]
54    pub fn wpvsrc(&self) -> WPVSRC_R {
55        WPVSRC_R::new(((self.bits >> 8) & 0xffff) as u16)
56    }
57}
58#[doc = "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 [matrix_wpsr](index.html) module"]
59pub struct MATRIX_WPSR_SPEC;
60impl crate::RegisterSpec for MATRIX_WPSR_SPEC {
61    type Ux = u32;
62}
63#[doc = "`read()` method returns [matrix_wpsr::R](R) reader structure"]
64impl crate::Readable for MATRIX_WPSR_SPEC {
65    type Reader = R;
66}
67#[doc = "`reset()` method sets MATRIX_WPSR to value 0"]
68impl crate::Resettable for MATRIX_WPSR_SPEC {
69    #[inline(always)]
70    fn reset_value() -> Self::Ux {
71        0
72    }
73}