1#[doc = "Register `IO_INPUT` reader"]
2pub struct R(crate::R<IO_INPUT_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<IO_INPUT_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<IO_INPUT_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<IO_INPUT_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Field `IO_0` reader - Read digital value of pin mapped to IO bit 0"]
17pub struct IO_0_R(crate::FieldReader<bool, bool>);
18impl IO_0_R {
19 #[inline(always)]
20 pub(crate) fn new(bits: bool) -> Self {
21 IO_0_R(crate::FieldReader::new(bits))
22 }
23}
24impl core::ops::Deref for IO_0_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 `IO_1` reader - Read digital value of pin mapped to IO bit 1"]
32pub struct IO_1_R(crate::FieldReader<bool, bool>);
33impl IO_1_R {
34 #[inline(always)]
35 pub(crate) fn new(bits: bool) -> Self {
36 IO_1_R(crate::FieldReader::new(bits))
37 }
38}
39impl core::ops::Deref for IO_1_R {
40 type Target = crate::FieldReader<bool, bool>;
41 #[inline(always)]
42 fn deref(&self) -> &Self::Target {
43 &self.0
44 }
45}
46#[doc = "Field `IO_2` reader - Read digital value of pin mapped to IO bit 2"]
47pub struct IO_2_R(crate::FieldReader<bool, bool>);
48impl IO_2_R {
49 #[inline(always)]
50 pub(crate) fn new(bits: bool) -> Self {
51 IO_2_R(crate::FieldReader::new(bits))
52 }
53}
54impl core::ops::Deref for IO_2_R {
55 type Target = crate::FieldReader<bool, bool>;
56 #[inline(always)]
57 fn deref(&self) -> &Self::Target {
58 &self.0
59 }
60}
61#[doc = "Field `IO_3` reader - Read digital value of pin mapped to IO bit 3"]
62pub struct IO_3_R(crate::FieldReader<bool, bool>);
63impl IO_3_R {
64 #[inline(always)]
65 pub(crate) fn new(bits: bool) -> Self {
66 IO_3_R(crate::FieldReader::new(bits))
67 }
68}
69impl core::ops::Deref for IO_3_R {
70 type Target = crate::FieldReader<bool, bool>;
71 #[inline(always)]
72 fn deref(&self) -> &Self::Target {
73 &self.0
74 }
75}
76#[doc = "Field `IO_4` reader - Read digital value of pin mapped to IO bit 4"]
77pub struct IO_4_R(crate::FieldReader<bool, bool>);
78impl IO_4_R {
79 #[inline(always)]
80 pub(crate) fn new(bits: bool) -> Self {
81 IO_4_R(crate::FieldReader::new(bits))
82 }
83}
84impl core::ops::Deref for IO_4_R {
85 type Target = crate::FieldReader<bool, bool>;
86 #[inline(always)]
87 fn deref(&self) -> &Self::Target {
88 &self.0
89 }
90}
91#[doc = "Field `IO_5` reader - Read digital value of pin mapped to IO bit 5"]
92pub struct IO_5_R(crate::FieldReader<bool, bool>);
93impl IO_5_R {
94 #[inline(always)]
95 pub(crate) fn new(bits: bool) -> Self {
96 IO_5_R(crate::FieldReader::new(bits))
97 }
98}
99impl core::ops::Deref for IO_5_R {
100 type Target = crate::FieldReader<bool, bool>;
101 #[inline(always)]
102 fn deref(&self) -> &Self::Target {
103 &self.0
104 }
105}
106#[doc = "Field `IO_6` reader - Read digital value of pin mapped to IO bit 6"]
107pub struct IO_6_R(crate::FieldReader<bool, bool>);
108impl IO_6_R {
109 #[inline(always)]
110 pub(crate) fn new(bits: bool) -> Self {
111 IO_6_R(crate::FieldReader::new(bits))
112 }
113}
114impl core::ops::Deref for IO_6_R {
115 type Target = crate::FieldReader<bool, bool>;
116 #[inline(always)]
117 fn deref(&self) -> &Self::Target {
118 &self.0
119 }
120}
121#[doc = "Field `IO_7` reader - Read digital value of pin mapped to IO bit 7"]
122pub struct IO_7_R(crate::FieldReader<bool, bool>);
123impl IO_7_R {
124 #[inline(always)]
125 pub(crate) fn new(bits: bool) -> Self {
126 IO_7_R(crate::FieldReader::new(bits))
127 }
128}
129impl core::ops::Deref for IO_7_R {
130 type Target = crate::FieldReader<bool, bool>;
131 #[inline(always)]
132 fn deref(&self) -> &Self::Target {
133 &self.0
134 }
135}
136impl R {
137 #[doc = "Bit 0 - Read digital value of pin mapped to IO bit 0"]
138 #[inline(always)]
139 pub fn io_0(&self) -> IO_0_R {
140 IO_0_R::new((self.bits & 0x01) != 0)
141 }
142 #[doc = "Bit 1 - Read digital value of pin mapped to IO bit 1"]
143 #[inline(always)]
144 pub fn io_1(&self) -> IO_1_R {
145 IO_1_R::new(((self.bits >> 1) & 0x01) != 0)
146 }
147 #[doc = "Bit 2 - Read digital value of pin mapped to IO bit 2"]
148 #[inline(always)]
149 pub fn io_2(&self) -> IO_2_R {
150 IO_2_R::new(((self.bits >> 2) & 0x01) != 0)
151 }
152 #[doc = "Bit 3 - Read digital value of pin mapped to IO bit 3"]
153 #[inline(always)]
154 pub fn io_3(&self) -> IO_3_R {
155 IO_3_R::new(((self.bits >> 3) & 0x01) != 0)
156 }
157 #[doc = "Bit 4 - Read digital value of pin mapped to IO bit 4"]
158 #[inline(always)]
159 pub fn io_4(&self) -> IO_4_R {
160 IO_4_R::new(((self.bits >> 4) & 0x01) != 0)
161 }
162 #[doc = "Bit 5 - Read digital value of pin mapped to IO bit 5"]
163 #[inline(always)]
164 pub fn io_5(&self) -> IO_5_R {
165 IO_5_R::new(((self.bits >> 5) & 0x01) != 0)
166 }
167 #[doc = "Bit 6 - Read digital value of pin mapped to IO bit 6"]
168 #[inline(always)]
169 pub fn io_6(&self) -> IO_6_R {
170 IO_6_R::new(((self.bits >> 6) & 0x01) != 0)
171 }
172 #[doc = "Bit 7 - Read digital value of pin mapped to IO bit 7"]
173 #[inline(always)]
174 pub fn io_7(&self) -> IO_7_R {
175 IO_7_R::new(((self.bits >> 7) & 0x01) != 0)
176 }
177}
178#[doc = "Reads the value of the IO pins\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 [io_input](index.html) module"]
179pub struct IO_INPUT_SPEC;
180impl crate::RegisterSpec for IO_INPUT_SPEC {
181 type Ux = u32;
182}
183#[doc = "`read()` method returns [io_input::R](R) reader structure"]
184impl crate::Readable for IO_INPUT_SPEC {
185 type Reader = R;
186}
187#[doc = "`reset()` method sets IO_INPUT to value 0"]
188impl crate::Resettable for IO_INPUT_SPEC {
189 #[inline(always)]
190 fn reset_value() -> Self::Ux {
191 0
192 }
193}