nrf52840_pac/nfct/
selres.rs
1#[doc = "Register `SELRES` reader"]
2pub struct R(crate::R<SELRES_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<SELRES_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<SELRES_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<SELRES_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `SELRES` writer"]
17pub struct W(crate::W<SELRES_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<SELRES_SPEC>;
20 #[inline(always)]
21 fn deref(&self) -> &Self::Target {
22 &self.0
23 }
24}
25impl core::ops::DerefMut for W {
26 #[inline(always)]
27 fn deref_mut(&mut self) -> &mut Self::Target {
28 &mut self.0
29 }
30}
31impl From<crate::W<SELRES_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<SELRES_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `RFU10` reader - Reserved for future use. Shall be 0."]
38pub type RFU10_R = crate::FieldReader<u8, u8>;
39#[doc = "Field `RFU10` writer - Reserved for future use. Shall be 0."]
40pub type RFU10_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SELRES_SPEC, u8, u8, 2, O>;
41#[doc = "Field `CASCADE` reader - Cascade as defined by the b3 of SEL_RES response in the NFC Forum, NFC Digital Protocol Technical Specification (controlled by hardware, shall be 0)"]
42pub type CASCADE_R = crate::BitReader<bool>;
43#[doc = "Field `CASCADE` writer - Cascade as defined by the b3 of SEL_RES response in the NFC Forum, NFC Digital Protocol Technical Specification (controlled by hardware, shall be 0)"]
44pub type CASCADE_W<'a, const O: u8> = crate::BitWriter<'a, u32, SELRES_SPEC, bool, O>;
45#[doc = "Field `RFU43` reader - Reserved for future use. Shall be 0."]
46pub type RFU43_R = crate::FieldReader<u8, u8>;
47#[doc = "Field `RFU43` writer - Reserved for future use. Shall be 0."]
48pub type RFU43_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SELRES_SPEC, u8, u8, 2, O>;
49#[doc = "Field `PROTOCOL` reader - Protocol as defined by the b7:b6 of SEL_RES response in the NFC Forum, NFC Digital Protocol Technical Specification"]
50pub type PROTOCOL_R = crate::FieldReader<u8, u8>;
51#[doc = "Field `PROTOCOL` writer - Protocol as defined by the b7:b6 of SEL_RES response in the NFC Forum, NFC Digital Protocol Technical Specification"]
52pub type PROTOCOL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SELRES_SPEC, u8, u8, 2, O>;
53#[doc = "Field `RFU7` reader - Reserved for future use. Shall be 0."]
54pub type RFU7_R = crate::BitReader<bool>;
55#[doc = "Field `RFU7` writer - Reserved for future use. Shall be 0."]
56pub type RFU7_W<'a, const O: u8> = crate::BitWriter<'a, u32, SELRES_SPEC, bool, O>;
57impl R {
58 #[doc = "Bits 0:1 - Reserved for future use. Shall be 0."]
59 #[inline(always)]
60 pub fn rfu10(&self) -> RFU10_R {
61 RFU10_R::new((self.bits & 3) as u8)
62 }
63 #[doc = "Bit 2 - Cascade as defined by the b3 of SEL_RES response in the NFC Forum, NFC Digital Protocol Technical Specification (controlled by hardware, shall be 0)"]
64 #[inline(always)]
65 pub fn cascade(&self) -> CASCADE_R {
66 CASCADE_R::new(((self.bits >> 2) & 1) != 0)
67 }
68 #[doc = "Bits 3:4 - Reserved for future use. Shall be 0."]
69 #[inline(always)]
70 pub fn rfu43(&self) -> RFU43_R {
71 RFU43_R::new(((self.bits >> 3) & 3) as u8)
72 }
73 #[doc = "Bits 5:6 - Protocol as defined by the b7:b6 of SEL_RES response in the NFC Forum, NFC Digital Protocol Technical Specification"]
74 #[inline(always)]
75 pub fn protocol(&self) -> PROTOCOL_R {
76 PROTOCOL_R::new(((self.bits >> 5) & 3) as u8)
77 }
78 #[doc = "Bit 7 - Reserved for future use. Shall be 0."]
79 #[inline(always)]
80 pub fn rfu7(&self) -> RFU7_R {
81 RFU7_R::new(((self.bits >> 7) & 1) != 0)
82 }
83}
84impl W {
85 #[doc = "Bits 0:1 - Reserved for future use. Shall be 0."]
86 #[inline(always)]
87 pub fn rfu10(&mut self) -> RFU10_W<0> {
88 RFU10_W::new(self)
89 }
90 #[doc = "Bit 2 - Cascade as defined by the b3 of SEL_RES response in the NFC Forum, NFC Digital Protocol Technical Specification (controlled by hardware, shall be 0)"]
91 #[inline(always)]
92 pub fn cascade(&mut self) -> CASCADE_W<2> {
93 CASCADE_W::new(self)
94 }
95 #[doc = "Bits 3:4 - Reserved for future use. Shall be 0."]
96 #[inline(always)]
97 pub fn rfu43(&mut self) -> RFU43_W<3> {
98 RFU43_W::new(self)
99 }
100 #[doc = "Bits 5:6 - Protocol as defined by the b7:b6 of SEL_RES response in the NFC Forum, NFC Digital Protocol Technical Specification"]
101 #[inline(always)]
102 pub fn protocol(&mut self) -> PROTOCOL_W<5> {
103 PROTOCOL_W::new(self)
104 }
105 #[doc = "Bit 7 - Reserved for future use. Shall be 0."]
106 #[inline(always)]
107 pub fn rfu7(&mut self) -> RFU7_W<7> {
108 RFU7_W::new(self)
109 }
110 #[doc = "Writes raw bits to the register."]
111 #[inline(always)]
112 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
113 self.0.bits(bits);
114 self
115 }
116}
117#[doc = "NFC-A SEL_RES auto-response settings\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 [selres](index.html) module"]
118pub struct SELRES_SPEC;
119impl crate::RegisterSpec for SELRES_SPEC {
120 type Ux = u32;
121}
122#[doc = "`read()` method returns [selres::R](R) reader structure"]
123impl crate::Readable for SELRES_SPEC {
124 type Reader = R;
125}
126#[doc = "`write(|w| ..)` method takes [selres::W](W) writer structure"]
127impl crate::Writable for SELRES_SPEC {
128 type Writer = W;
129}
130#[doc = "`reset()` method sets SELRES to value 0"]
131impl crate::Resettable for SELRES_SPEC {
132 #[inline(always)]
133 fn reset_value() -> Self::Ux {
134 0
135 }
136}