1#[doc = r"Register block"]
2#[repr(C)]
3pub struct RegisterBlock {
4 _reserved_0_spi: [u8; 49usize],
5}
6impl RegisterBlock {
7 #[doc = "0x00 - USART Mode"]
8 #[inline(always)]
9 pub fn usart(&self) -> &USART {
10 unsafe { &*(((self as *const Self) as *const u8).add(0usize) as *const USART) }
11 }
12 #[doc = "0x00 - USART Mode"]
13 #[inline(always)]
14 pub fn usart_mut(&self) -> &mut USART {
15 unsafe { &mut *(((self as *const Self) as *mut u8).add(0usize) as *mut USART) }
16 }
17 #[doc = "0x00 - SPI Mode"]
18 #[inline(always)]
19 pub fn spi(&self) -> &SPI {
20 unsafe { &*(((self as *const Self) as *const u8).add(0usize) as *const SPI) }
21 }
22 #[doc = "0x00 - SPI Mode"]
23 #[inline(always)]
24 pub fn spi_mut(&self) -> &mut SPI {
25 unsafe { &mut *(((self as *const Self) as *mut u8).add(0usize) as *mut SPI) }
26 }
27 #[doc = "0x00 - I2C Slave Mode"]
28 #[inline(always)]
29 pub fn i2cs(&self) -> &I2CS {
30 unsafe { &*(((self as *const Self) as *const u8).add(0usize) as *const I2CS) }
31 }
32 #[doc = "0x00 - I2C Slave Mode"]
33 #[inline(always)]
34 pub fn i2cs_mut(&self) -> &mut I2CS {
35 unsafe { &mut *(((self as *const Self) as *mut u8).add(0usize) as *mut I2CS) }
36 }
37 #[doc = "0x00 - I2C Master Mode"]
38 #[inline(always)]
39 pub fn i2cm(&self) -> &I2CM {
40 unsafe { &*(((self as *const Self) as *const u8).add(0usize) as *const I2CM) }
41 }
42 #[doc = "0x00 - I2C Master Mode"]
43 #[inline(always)]
44 pub fn i2cm_mut(&self) -> &mut I2CM {
45 unsafe { &mut *(((self as *const Self) as *mut u8).add(0usize) as *mut I2CM) }
46 }
47}
48#[doc = r"Register block"]
49#[repr(C)]
50pub struct I2CM {
51 #[doc = "0x00 - I2CM Control A"]
52 pub ctrla: self::i2cm::CTRLA,
53 #[doc = "0x04 - I2CM Control B"]
54 pub ctrlb: self::i2cm::CTRLB,
55 _reserved2: [u8; 4usize],
56 #[doc = "0x0c - I2CM Baud Rate"]
57 pub baud: self::i2cm::BAUD,
58 _reserved3: [u8; 4usize],
59 #[doc = "0x14 - I2CM Interrupt Enable Clear"]
60 pub intenclr: self::i2cm::INTENCLR,
61 _reserved4: [u8; 1usize],
62 #[doc = "0x16 - I2CM Interrupt Enable Set"]
63 pub intenset: self::i2cm::INTENSET,
64 _reserved5: [u8; 1usize],
65 #[doc = "0x18 - I2CM Interrupt Flag Status and Clear"]
66 pub intflag: self::i2cm::INTFLAG,
67 _reserved6: [u8; 1usize],
68 #[doc = "0x1a - I2CM Status"]
69 pub status: self::i2cm::STATUS,
70 #[doc = "0x1c - I2CM Synchronization Busy"]
71 pub syncbusy: self::i2cm::SYNCBUSY,
72 _reserved8: [u8; 4usize],
73 #[doc = "0x24 - I2CM Address"]
74 pub addr: self::i2cm::ADDR,
75 #[doc = "0x28 - I2CM Data"]
76 pub data: self::i2cm::DATA,
77 _reserved10: [u8; 7usize],
78 #[doc = "0x30 - I2CM Debug Control"]
79 pub dbgctrl: self::i2cm::DBGCTRL,
80}
81#[doc = r"Register block"]
82#[doc = "I2C Master Mode"]
83pub mod i2cm;
84#[doc = r"Register block"]
85#[repr(C)]
86pub struct I2CS {
87 #[doc = "0x00 - I2CS Control A"]
88 pub ctrla: self::i2cs::CTRLA,
89 #[doc = "0x04 - I2CS Control B"]
90 pub ctrlb: self::i2cs::CTRLB,
91 _reserved2: [u8; 12usize],
92 #[doc = "0x14 - I2CS Interrupt Enable Clear"]
93 pub intenclr: self::i2cs::INTENCLR,
94 _reserved3: [u8; 1usize],
95 #[doc = "0x16 - I2CS Interrupt Enable Set"]
96 pub intenset: self::i2cs::INTENSET,
97 _reserved4: [u8; 1usize],
98 #[doc = "0x18 - I2CS Interrupt Flag Status and Clear"]
99 pub intflag: self::i2cs::INTFLAG,
100 _reserved5: [u8; 1usize],
101 #[doc = "0x1a - I2CS Status"]
102 pub status: self::i2cs::STATUS,
103 #[doc = "0x1c - I2CS Synchronization Busy"]
104 pub syncbusy: self::i2cs::SYNCBUSY,
105 _reserved7: [u8; 4usize],
106 #[doc = "0x24 - I2CS Address"]
107 pub addr: self::i2cs::ADDR,
108 #[doc = "0x28 - I2CS Data"]
109 pub data: self::i2cs::DATA,
110}
111#[doc = r"Register block"]
112#[doc = "I2C Slave Mode"]
113pub mod i2cs;
114#[doc = r"Register block"]
115#[repr(C)]
116pub struct SPI {
117 #[doc = "0x00 - SPI Control A"]
118 pub ctrla: self::spi::CTRLA,
119 #[doc = "0x04 - SPI Control B"]
120 pub ctrlb: self::spi::CTRLB,
121 _reserved2: [u8; 4usize],
122 #[doc = "0x0c - SPI Baud Rate"]
123 pub baud: self::spi::BAUD,
124 _reserved3: [u8; 7usize],
125 #[doc = "0x14 - SPI Interrupt Enable Clear"]
126 pub intenclr: self::spi::INTENCLR,
127 _reserved4: [u8; 1usize],
128 #[doc = "0x16 - SPI Interrupt Enable Set"]
129 pub intenset: self::spi::INTENSET,
130 _reserved5: [u8; 1usize],
131 #[doc = "0x18 - SPI Interrupt Flag Status and Clear"]
132 pub intflag: self::spi::INTFLAG,
133 _reserved6: [u8; 1usize],
134 #[doc = "0x1a - SPI Status"]
135 pub status: self::spi::STATUS,
136 #[doc = "0x1c - SPI Synchronization Busy"]
137 pub syncbusy: self::spi::SYNCBUSY,
138 _reserved8: [u8; 4usize],
139 #[doc = "0x24 - SPI Address"]
140 pub addr: self::spi::ADDR,
141 #[doc = "0x28 - SPI Data"]
142 pub data: self::spi::DATA,
143 _reserved10: [u8; 4usize],
144 #[doc = "0x30 - SPI Debug Control"]
145 pub dbgctrl: self::spi::DBGCTRL,
146}
147#[doc = r"Register block"]
148#[doc = "SPI Mode"]
149pub mod spi;
150#[doc = r"Register block"]
151#[repr(C)]
152pub struct USART {
153 #[doc = "0x00 - USART Control A"]
154 pub ctrla: self::usart::CTRLA,
155 #[doc = "0x04 - USART Control B"]
156 pub ctrlb: self::usart::CTRLB,
157 #[doc = "0x08 - USART Control C"]
158 pub ctrlc: self::usart::CTRLC,
159 _reserved_3_baud: [u8; 2usize],
160 #[doc = "0x0e - USART Receive Pulse Length"]
161 pub rxpl: self::usart::RXPL,
162 _reserved5: [u8; 5usize],
163 #[doc = "0x14 - USART Interrupt Enable Clear"]
164 pub intenclr: self::usart::INTENCLR,
165 _reserved6: [u8; 1usize],
166 #[doc = "0x16 - USART Interrupt Enable Set"]
167 pub intenset: self::usart::INTENSET,
168 _reserved7: [u8; 1usize],
169 #[doc = "0x18 - USART Interrupt Flag Status and Clear"]
170 pub intflag: self::usart::INTFLAG,
171 _reserved8: [u8; 1usize],
172 #[doc = "0x1a - USART Status"]
173 pub status: self::usart::STATUS,
174 #[doc = "0x1c - USART Synchronization Busy"]
175 pub syncbusy: self::usart::SYNCBUSY,
176 #[doc = "0x20 - USART Receive Error Count"]
177 pub rxerrcnt: self::usart::RXERRCNT,
178 _reserved11: [u8; 7usize],
179 #[doc = "0x28 - USART Data"]
180 pub data: self::usart::DATA,
181 _reserved12: [u8; 6usize],
182 #[doc = "0x30 - USART Debug Control"]
183 pub dbgctrl: self::usart::DBGCTRL,
184}
185impl USART {
186 #[doc = "0x0c - USART Baud Rate"]
187 #[inline(always)]
188 pub fn baud_usartfp_mode(&self) -> &self::usart::BAUD_USARTFP_MODE {
189 unsafe {
190 &*(((self as *const Self) as *const u8).add(12usize)
191 as *const self::usart::BAUD_USARTFP_MODE)
192 }
193 }
194 #[doc = "0x0c - USART Baud Rate"]
195 #[inline(always)]
196 pub fn baud_usartfp_mode_mut(&self) -> &mut self::usart::BAUD_USARTFP_MODE {
197 unsafe {
198 &mut *(((self as *const Self) as *mut u8).add(12usize)
199 as *mut self::usart::BAUD_USARTFP_MODE)
200 }
201 }
202 #[doc = "0x0c - USART Baud Rate"]
203 #[inline(always)]
204 pub fn baud_fracfp_mode(&self) -> &self::usart::BAUD_FRACFP_MODE {
205 unsafe {
206 &*(((self as *const Self) as *const u8).add(12usize)
207 as *const self::usart::BAUD_FRACFP_MODE)
208 }
209 }
210 #[doc = "0x0c - USART Baud Rate"]
211 #[inline(always)]
212 pub fn baud_fracfp_mode_mut(&self) -> &mut self::usart::BAUD_FRACFP_MODE {
213 unsafe {
214 &mut *(((self as *const Self) as *mut u8).add(12usize)
215 as *mut self::usart::BAUD_FRACFP_MODE)
216 }
217 }
218 #[doc = "0x0c - USART Baud Rate"]
219 #[inline(always)]
220 pub fn baud_frac_mode(&self) -> &self::usart::BAUD_FRAC_MODE {
221 unsafe {
222 &*(((self as *const Self) as *const u8).add(12usize)
223 as *const self::usart::BAUD_FRAC_MODE)
224 }
225 }
226 #[doc = "0x0c - USART Baud Rate"]
227 #[inline(always)]
228 pub fn baud_frac_mode_mut(&self) -> &mut self::usart::BAUD_FRAC_MODE {
229 unsafe {
230 &mut *(((self as *const Self) as *mut u8).add(12usize)
231 as *mut self::usart::BAUD_FRAC_MODE)
232 }
233 }
234 #[doc = "0x0c - USART Baud Rate"]
235 #[inline(always)]
236 pub fn baud(&self) -> &self::usart::BAUD {
237 unsafe { &*(((self as *const Self) as *const u8).add(12usize) as *const self::usart::BAUD) }
238 }
239 #[doc = "0x0c - USART Baud Rate"]
240 #[inline(always)]
241 pub fn baud_mut(&self) -> &mut self::usart::BAUD {
242 unsafe { &mut *(((self as *const Self) as *mut u8).add(12usize) as *mut self::usart::BAUD) }
243 }
244}
245#[doc = r"Register block"]
246#[doc = "USART Mode"]
247pub mod usart;