atsam4lc8b_pac/spi/
features.rs

1#[doc = "Register `FEATURES` reader"]
2pub struct R(crate::R<FEATURES_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<FEATURES_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<FEATURES_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<FEATURES_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `NCS` reader - Number of Chip Selects"]
17pub type NCS_R = crate::FieldReader<u8, u8>;
18#[doc = "Field `PCONF` reader - Polarity is Configurable"]
19pub type PCONF_R = crate::BitReader<bool>;
20#[doc = "Field `PPNCONF` reader - Polarity is Positive if Polarity is not Configurable"]
21pub type PPNCONF_R = crate::BitReader<bool>;
22#[doc = "Field `PHCONF` reader - Phase is Configurable"]
23pub type PHCONF_R = crate::BitReader<bool>;
24#[doc = "Field `PHZNCONF` reader - Phase is Zero if Phase is not Configurable"]
25pub type PHZNCONF_R = crate::BitReader<bool>;
26#[doc = "Field `LENCONF` reader - Character Length is Configurable"]
27pub type LENCONF_R = crate::BitReader<bool>;
28#[doc = "Field `LENNCONF` reader - Character Length if not Configurable"]
29pub type LENNCONF_R = crate::FieldReader<u8, u8>;
30#[doc = "Field `EXTDEC` reader - External Decoder is True"]
31pub type EXTDEC_R = crate::BitReader<bool>;
32#[doc = "Field `CSNAATIMPL` reader - CSNAAT Features are Implemented"]
33pub type CSNAATIMPL_R = crate::BitReader<bool>;
34#[doc = "Field `BRPBHSB` reader - Bridge Type is PB to HSB"]
35pub type BRPBHSB_R = crate::BitReader<bool>;
36#[doc = "Field `FIFORIMPL` reader - FIFO in Reception is Implemented"]
37pub type FIFORIMPL_R = crate::BitReader<bool>;
38#[doc = "Field `SWPIMPL` reader - Spurious Write Protection is Implemented"]
39pub type SWPIMPL_R = crate::BitReader<bool>;
40impl R {
41    #[doc = "Bits 0:3 - Number of Chip Selects"]
42    #[inline(always)]
43    pub fn ncs(&self) -> NCS_R {
44        NCS_R::new((self.bits & 0x0f) as u8)
45    }
46    #[doc = "Bit 4 - Polarity is Configurable"]
47    #[inline(always)]
48    pub fn pconf(&self) -> PCONF_R {
49        PCONF_R::new(((self.bits >> 4) & 1) != 0)
50    }
51    #[doc = "Bit 5 - Polarity is Positive if Polarity is not Configurable"]
52    #[inline(always)]
53    pub fn ppnconf(&self) -> PPNCONF_R {
54        PPNCONF_R::new(((self.bits >> 5) & 1) != 0)
55    }
56    #[doc = "Bit 6 - Phase is Configurable"]
57    #[inline(always)]
58    pub fn phconf(&self) -> PHCONF_R {
59        PHCONF_R::new(((self.bits >> 6) & 1) != 0)
60    }
61    #[doc = "Bit 7 - Phase is Zero if Phase is not Configurable"]
62    #[inline(always)]
63    pub fn phznconf(&self) -> PHZNCONF_R {
64        PHZNCONF_R::new(((self.bits >> 7) & 1) != 0)
65    }
66    #[doc = "Bit 8 - Character Length is Configurable"]
67    #[inline(always)]
68    pub fn lenconf(&self) -> LENCONF_R {
69        LENCONF_R::new(((self.bits >> 8) & 1) != 0)
70    }
71    #[doc = "Bits 9:15 - Character Length if not Configurable"]
72    #[inline(always)]
73    pub fn lennconf(&self) -> LENNCONF_R {
74        LENNCONF_R::new(((self.bits >> 9) & 0x7f) as u8)
75    }
76    #[doc = "Bit 16 - External Decoder is True"]
77    #[inline(always)]
78    pub fn extdec(&self) -> EXTDEC_R {
79        EXTDEC_R::new(((self.bits >> 16) & 1) != 0)
80    }
81    #[doc = "Bit 17 - CSNAAT Features are Implemented"]
82    #[inline(always)]
83    pub fn csnaatimpl(&self) -> CSNAATIMPL_R {
84        CSNAATIMPL_R::new(((self.bits >> 17) & 1) != 0)
85    }
86    #[doc = "Bit 18 - Bridge Type is PB to HSB"]
87    #[inline(always)]
88    pub fn brpbhsb(&self) -> BRPBHSB_R {
89        BRPBHSB_R::new(((self.bits >> 18) & 1) != 0)
90    }
91    #[doc = "Bit 19 - FIFO in Reception is Implemented"]
92    #[inline(always)]
93    pub fn fiforimpl(&self) -> FIFORIMPL_R {
94        FIFORIMPL_R::new(((self.bits >> 19) & 1) != 0)
95    }
96    #[doc = "Bit 20 - Spurious Write Protection is Implemented"]
97    #[inline(always)]
98    pub fn swpimpl(&self) -> SWPIMPL_R {
99        SWPIMPL_R::new(((self.bits >> 20) & 1) != 0)
100    }
101}
102#[doc = "Features 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 [features](index.html) module"]
103pub struct FEATURES_SPEC;
104impl crate::RegisterSpec for FEATURES_SPEC {
105    type Ux = u32;
106}
107#[doc = "`read()` method returns [features::R](R) reader structure"]
108impl crate::Readable for FEATURES_SPEC {
109    type Reader = R;
110}
111#[doc = "`reset()` method sets FEATURES to value 0"]
112impl crate::Resettable for FEATURES_SPEC {
113    const RESET_VALUE: Self::Ux = 0;
114}