Skip to main content

atsamd51j20a/
sercom0.rs

1#[doc = r"Register block"]
2#[repr(C)]
3pub struct RegisterBlock {
4    _reserved_0_i2cm: [u8; 49usize],
5}
6impl RegisterBlock {
7    #[doc = "0x00 - USART INTERNAL CLOCK Mode"]
8    #[inline(always)]
9    pub fn usart_int(&self) -> &USART_INT {
10        unsafe { &*(((self as *const Self) as *const u8).add(0usize) as *const USART_INT) }
11    }
12    #[doc = "0x00 - USART INTERNAL CLOCK Mode"]
13    #[inline(always)]
14    pub fn usart_int_mut(&self) -> &mut USART_INT {
15        unsafe { &mut *(((self as *const Self) as *mut u8).add(0usize) as *mut USART_INT) }
16    }
17    #[doc = "0x00 - USART EXTERNAL CLOCK Mode"]
18    #[inline(always)]
19    pub fn usart_ext(&self) -> &USART_EXT {
20        unsafe { &*(((self as *const Self) as *const u8).add(0usize) as *const USART_EXT) }
21    }
22    #[doc = "0x00 - USART EXTERNAL CLOCK Mode"]
23    #[inline(always)]
24    pub fn usart_ext_mut(&self) -> &mut USART_EXT {
25        unsafe { &mut *(((self as *const Self) as *mut u8).add(0usize) as *mut USART_EXT) }
26    }
27    #[doc = "0x00 - SPI Master Mode"]
28    #[inline(always)]
29    pub fn spim(&self) -> &SPIM {
30        unsafe { &*(((self as *const Self) as *const u8).add(0usize) as *const SPIM) }
31    }
32    #[doc = "0x00 - SPI Master Mode"]
33    #[inline(always)]
34    pub fn spim_mut(&self) -> &mut SPIM {
35        unsafe { &mut *(((self as *const Self) as *mut u8).add(0usize) as *mut SPIM) }
36    }
37    #[doc = "0x00 - SPI Slave Mode"]
38    #[inline(always)]
39    pub fn spis(&self) -> &SPIS {
40        unsafe { &*(((self as *const Self) as *const u8).add(0usize) as *const SPIS) }
41    }
42    #[doc = "0x00 - SPI Slave Mode"]
43    #[inline(always)]
44    pub fn spis_mut(&self) -> &mut SPIS {
45        unsafe { &mut *(((self as *const Self) as *mut u8).add(0usize) as *mut SPIS) }
46    }
47    #[doc = "0x00 - I2C Slave Mode"]
48    #[inline(always)]
49    pub fn i2cs(&self) -> &I2CS {
50        unsafe { &*(((self as *const Self) as *const u8).add(0usize) as *const I2CS) }
51    }
52    #[doc = "0x00 - I2C Slave Mode"]
53    #[inline(always)]
54    pub fn i2cs_mut(&self) -> &mut I2CS {
55        unsafe { &mut *(((self as *const Self) as *mut u8).add(0usize) as *mut I2CS) }
56    }
57    #[doc = "0x00 - I2C Master Mode"]
58    #[inline(always)]
59    pub fn i2cm(&self) -> &I2CM {
60        unsafe { &*(((self as *const Self) as *const u8).add(0usize) as *const I2CM) }
61    }
62    #[doc = "0x00 - I2C Master Mode"]
63    #[inline(always)]
64    pub fn i2cm_mut(&self) -> &mut I2CM {
65        unsafe { &mut *(((self as *const Self) as *mut u8).add(0usize) as *mut I2CM) }
66    }
67}
68#[doc = r"Register block"]
69#[repr(C)]
70pub struct I2CM {
71    #[doc = "0x00 - I2CM Control A"]
72    pub ctrla: self::i2cm::CTRLA,
73    #[doc = "0x04 - I2CM Control B"]
74    pub ctrlb: self::i2cm::CTRLB,
75    #[doc = "0x08 - I2CM Control C"]
76    pub ctrlc: self::i2cm::CTRLC,
77    #[doc = "0x0c - I2CM Baud Rate"]
78    pub baud: self::i2cm::BAUD,
79    _reserved4: [u8; 4usize],
80    #[doc = "0x14 - I2CM Interrupt Enable Clear"]
81    pub intenclr: self::i2cm::INTENCLR,
82    _reserved5: [u8; 1usize],
83    #[doc = "0x16 - I2CM Interrupt Enable Set"]
84    pub intenset: self::i2cm::INTENSET,
85    _reserved6: [u8; 1usize],
86    #[doc = "0x18 - I2CM Interrupt Flag Status and Clear"]
87    pub intflag: self::i2cm::INTFLAG,
88    _reserved7: [u8; 1usize],
89    #[doc = "0x1a - I2CM Status"]
90    pub status: self::i2cm::STATUS,
91    #[doc = "0x1c - I2CM Synchronization Busy"]
92    pub syncbusy: self::i2cm::SYNCBUSY,
93    _reserved9: [u8; 4usize],
94    #[doc = "0x24 - I2CM Address"]
95    pub addr: self::i2cm::ADDR,
96    #[doc = "0x28 - I2CM Data"]
97    pub data: self::i2cm::DATA,
98    _reserved11: [u8; 7usize],
99    #[doc = "0x30 - I2CM Debug Control"]
100    pub dbgctrl: self::i2cm::DBGCTRL,
101}
102#[doc = r"Register block"]
103#[doc = "I2C Master Mode"]
104pub mod i2cm;
105#[doc = r"Register block"]
106#[repr(C)]
107pub struct I2CS {
108    #[doc = "0x00 - I2CS Control A"]
109    pub ctrla: self::i2cs::CTRLA,
110    #[doc = "0x04 - I2CS Control B"]
111    pub ctrlb: self::i2cs::CTRLB,
112    #[doc = "0x08 - I2CS Control C"]
113    pub ctrlc: self::i2cs::CTRLC,
114    _reserved3: [u8; 8usize],
115    #[doc = "0x14 - I2CS Interrupt Enable Clear"]
116    pub intenclr: self::i2cs::INTENCLR,
117    _reserved4: [u8; 1usize],
118    #[doc = "0x16 - I2CS Interrupt Enable Set"]
119    pub intenset: self::i2cs::INTENSET,
120    _reserved5: [u8; 1usize],
121    #[doc = "0x18 - I2CS Interrupt Flag Status and Clear"]
122    pub intflag: self::i2cs::INTFLAG,
123    _reserved6: [u8; 1usize],
124    #[doc = "0x1a - I2CS Status"]
125    pub status: self::i2cs::STATUS,
126    #[doc = "0x1c - I2CS Synchronization Busy"]
127    pub syncbusy: self::i2cs::SYNCBUSY,
128    _reserved8: [u8; 2usize],
129    #[doc = "0x22 - I2CS Length"]
130    pub length: self::i2cs::LENGTH,
131    #[doc = "0x24 - I2CS Address"]
132    pub addr: self::i2cs::ADDR,
133    #[doc = "0x28 - I2CS Data"]
134    pub data: self::i2cs::DATA,
135}
136#[doc = r"Register block"]
137#[doc = "I2C Slave Mode"]
138pub mod i2cs;
139#[doc = r"Register block"]
140#[repr(C)]
141pub struct SPIS {
142    #[doc = "0x00 - SPIS Control A"]
143    pub ctrla: self::spis::CTRLA,
144    #[doc = "0x04 - SPIS Control B"]
145    pub ctrlb: self::spis::CTRLB,
146    #[doc = "0x08 - SPIS Control C"]
147    pub ctrlc: self::spis::CTRLC,
148    #[doc = "0x0c - SPIS Baud Rate"]
149    pub baud: self::spis::BAUD,
150    _reserved4: [u8; 7usize],
151    #[doc = "0x14 - SPIS Interrupt Enable Clear"]
152    pub intenclr: self::spis::INTENCLR,
153    _reserved5: [u8; 1usize],
154    #[doc = "0x16 - SPIS Interrupt Enable Set"]
155    pub intenset: self::spis::INTENSET,
156    _reserved6: [u8; 1usize],
157    #[doc = "0x18 - SPIS Interrupt Flag Status and Clear"]
158    pub intflag: self::spis::INTFLAG,
159    _reserved7: [u8; 1usize],
160    #[doc = "0x1a - SPIS Status"]
161    pub status: self::spis::STATUS,
162    #[doc = "0x1c - SPIS Synchronization Busy"]
163    pub syncbusy: self::spis::SYNCBUSY,
164    _reserved9: [u8; 2usize],
165    #[doc = "0x22 - SPIS Length"]
166    pub length: self::spis::LENGTH,
167    #[doc = "0x24 - SPIS Address"]
168    pub addr: self::spis::ADDR,
169    #[doc = "0x28 - SPIS Data"]
170    pub data: self::spis::DATA,
171    _reserved12: [u8; 4usize],
172    #[doc = "0x30 - SPIS Debug Control"]
173    pub dbgctrl: self::spis::DBGCTRL,
174}
175#[doc = r"Register block"]
176#[doc = "SPI Slave Mode"]
177pub mod spis;
178#[doc = r"Register block"]
179#[repr(C)]
180pub struct SPIM {
181    #[doc = "0x00 - SPIM Control A"]
182    pub ctrla: self::spim::CTRLA,
183    #[doc = "0x04 - SPIM Control B"]
184    pub ctrlb: self::spim::CTRLB,
185    #[doc = "0x08 - SPIM Control C"]
186    pub ctrlc: self::spim::CTRLC,
187    #[doc = "0x0c - SPIM Baud Rate"]
188    pub baud: self::spim::BAUD,
189    _reserved4: [u8; 7usize],
190    #[doc = "0x14 - SPIM Interrupt Enable Clear"]
191    pub intenclr: self::spim::INTENCLR,
192    _reserved5: [u8; 1usize],
193    #[doc = "0x16 - SPIM Interrupt Enable Set"]
194    pub intenset: self::spim::INTENSET,
195    _reserved6: [u8; 1usize],
196    #[doc = "0x18 - SPIM Interrupt Flag Status and Clear"]
197    pub intflag: self::spim::INTFLAG,
198    _reserved7: [u8; 1usize],
199    #[doc = "0x1a - SPIM Status"]
200    pub status: self::spim::STATUS,
201    #[doc = "0x1c - SPIM Synchronization Busy"]
202    pub syncbusy: self::spim::SYNCBUSY,
203    _reserved9: [u8; 2usize],
204    #[doc = "0x22 - SPIM Length"]
205    pub length: self::spim::LENGTH,
206    #[doc = "0x24 - SPIM Address"]
207    pub addr: self::spim::ADDR,
208    #[doc = "0x28 - SPIM Data"]
209    pub data: self::spim::DATA,
210    _reserved12: [u8; 4usize],
211    #[doc = "0x30 - SPIM Debug Control"]
212    pub dbgctrl: self::spim::DBGCTRL,
213}
214#[doc = r"Register block"]
215#[doc = "SPI Master Mode"]
216pub mod spim;
217#[doc = r"Register block"]
218#[repr(C)]
219pub struct USART_EXT {
220    #[doc = "0x00 - USART_EXT Control A"]
221    pub ctrla: self::usart_ext::CTRLA,
222    #[doc = "0x04 - USART_EXT Control B"]
223    pub ctrlb: self::usart_ext::CTRLB,
224    #[doc = "0x08 - USART_EXT Control C"]
225    pub ctrlc: self::usart_ext::CTRLC,
226    _reserved_3_baud: [u8; 2usize],
227    #[doc = "0x0e - USART_EXT Receive Pulse Length"]
228    pub rxpl: self::usart_ext::RXPL,
229    _reserved5: [u8; 5usize],
230    #[doc = "0x14 - USART_EXT Interrupt Enable Clear"]
231    pub intenclr: self::usart_ext::INTENCLR,
232    _reserved6: [u8; 1usize],
233    #[doc = "0x16 - USART_EXT Interrupt Enable Set"]
234    pub intenset: self::usart_ext::INTENSET,
235    _reserved7: [u8; 1usize],
236    #[doc = "0x18 - USART_EXT Interrupt Flag Status and Clear"]
237    pub intflag: self::usart_ext::INTFLAG,
238    _reserved8: [u8; 1usize],
239    #[doc = "0x1a - USART_EXT Status"]
240    pub status: self::usart_ext::STATUS,
241    #[doc = "0x1c - USART_EXT Synchronization Busy"]
242    pub syncbusy: self::usart_ext::SYNCBUSY,
243    #[doc = "0x20 - USART_EXT Receive Error Count"]
244    pub rxerrcnt: self::usart_ext::RXERRCNT,
245    _reserved11: [u8; 1usize],
246    #[doc = "0x22 - USART_EXT Length"]
247    pub length: self::usart_ext::LENGTH,
248    _reserved12: [u8; 4usize],
249    #[doc = "0x28 - USART_EXT Data"]
250    pub data: self::usart_ext::DATA,
251    _reserved13: [u8; 4usize],
252    #[doc = "0x30 - USART_EXT Debug Control"]
253    pub dbgctrl: self::usart_ext::DBGCTRL,
254}
255impl USART_EXT {
256    #[doc = "0x0c - USART_EXT Baud Rate"]
257    #[inline(always)]
258    pub fn baud_usartfp_mode(&self) -> &self::usart_ext::BAUD_USARTFP_MODE {
259        unsafe {
260            &*(((self as *const Self) as *const u8).add(12usize)
261                as *const self::usart_ext::BAUD_USARTFP_MODE)
262        }
263    }
264    #[doc = "0x0c - USART_EXT Baud Rate"]
265    #[inline(always)]
266    pub fn baud_usartfp_mode_mut(&self) -> &mut self::usart_ext::BAUD_USARTFP_MODE {
267        unsafe {
268            &mut *(((self as *const Self) as *mut u8).add(12usize)
269                as *mut self::usart_ext::BAUD_USARTFP_MODE)
270        }
271    }
272    #[doc = "0x0c - USART_EXT Baud Rate"]
273    #[inline(always)]
274    pub fn baud_fracfp_mode(&self) -> &self::usart_ext::BAUD_FRACFP_MODE {
275        unsafe {
276            &*(((self as *const Self) as *const u8).add(12usize)
277                as *const self::usart_ext::BAUD_FRACFP_MODE)
278        }
279    }
280    #[doc = "0x0c - USART_EXT Baud Rate"]
281    #[inline(always)]
282    pub fn baud_fracfp_mode_mut(&self) -> &mut self::usart_ext::BAUD_FRACFP_MODE {
283        unsafe {
284            &mut *(((self as *const Self) as *mut u8).add(12usize)
285                as *mut self::usart_ext::BAUD_FRACFP_MODE)
286        }
287    }
288    #[doc = "0x0c - USART_EXT Baud Rate"]
289    #[inline(always)]
290    pub fn baud_frac_mode(&self) -> &self::usart_ext::BAUD_FRAC_MODE {
291        unsafe {
292            &*(((self as *const Self) as *const u8).add(12usize)
293                as *const self::usart_ext::BAUD_FRAC_MODE)
294        }
295    }
296    #[doc = "0x0c - USART_EXT Baud Rate"]
297    #[inline(always)]
298    pub fn baud_frac_mode_mut(&self) -> &mut self::usart_ext::BAUD_FRAC_MODE {
299        unsafe {
300            &mut *(((self as *const Self) as *mut u8).add(12usize)
301                as *mut self::usart_ext::BAUD_FRAC_MODE)
302        }
303    }
304    #[doc = "0x0c - USART_EXT Baud Rate"]
305    #[inline(always)]
306    pub fn baud(&self) -> &self::usart_ext::BAUD {
307        unsafe {
308            &*(((self as *const Self) as *const u8).add(12usize) as *const self::usart_ext::BAUD)
309        }
310    }
311    #[doc = "0x0c - USART_EXT Baud Rate"]
312    #[inline(always)]
313    pub fn baud_mut(&self) -> &mut self::usart_ext::BAUD {
314        unsafe {
315            &mut *(((self as *const Self) as *mut u8).add(12usize) as *mut self::usart_ext::BAUD)
316        }
317    }
318}
319#[doc = r"Register block"]
320#[doc = "USART EXTERNAL CLOCK Mode"]
321pub mod usart_ext;
322#[doc = r"Register block"]
323#[repr(C)]
324pub struct USART_INT {
325    #[doc = "0x00 - USART_INT Control A"]
326    pub ctrla: self::usart_int::CTRLA,
327    #[doc = "0x04 - USART_INT Control B"]
328    pub ctrlb: self::usart_int::CTRLB,
329    #[doc = "0x08 - USART_INT Control C"]
330    pub ctrlc: self::usart_int::CTRLC,
331    _reserved_3_baud: [u8; 2usize],
332    #[doc = "0x0e - USART_INT Receive Pulse Length"]
333    pub rxpl: self::usart_int::RXPL,
334    _reserved5: [u8; 5usize],
335    #[doc = "0x14 - USART_INT Interrupt Enable Clear"]
336    pub intenclr: self::usart_int::INTENCLR,
337    _reserved6: [u8; 1usize],
338    #[doc = "0x16 - USART_INT Interrupt Enable Set"]
339    pub intenset: self::usart_int::INTENSET,
340    _reserved7: [u8; 1usize],
341    #[doc = "0x18 - USART_INT Interrupt Flag Status and Clear"]
342    pub intflag: self::usart_int::INTFLAG,
343    _reserved8: [u8; 1usize],
344    #[doc = "0x1a - USART_INT Status"]
345    pub status: self::usart_int::STATUS,
346    #[doc = "0x1c - USART_INT Synchronization Busy"]
347    pub syncbusy: self::usart_int::SYNCBUSY,
348    #[doc = "0x20 - USART_INT Receive Error Count"]
349    pub rxerrcnt: self::usart_int::RXERRCNT,
350    _reserved11: [u8; 1usize],
351    #[doc = "0x22 - USART_INT Length"]
352    pub length: self::usart_int::LENGTH,
353    _reserved12: [u8; 4usize],
354    #[doc = "0x28 - USART_INT Data"]
355    pub data: self::usart_int::DATA,
356    _reserved13: [u8; 4usize],
357    #[doc = "0x30 - USART_INT Debug Control"]
358    pub dbgctrl: self::usart_int::DBGCTRL,
359}
360impl USART_INT {
361    #[doc = "0x0c - USART_INT Baud Rate"]
362    #[inline(always)]
363    pub fn baud_usartfp_mode(&self) -> &self::usart_int::BAUD_USARTFP_MODE {
364        unsafe {
365            &*(((self as *const Self) as *const u8).add(12usize)
366                as *const self::usart_int::BAUD_USARTFP_MODE)
367        }
368    }
369    #[doc = "0x0c - USART_INT Baud Rate"]
370    #[inline(always)]
371    pub fn baud_usartfp_mode_mut(&self) -> &mut self::usart_int::BAUD_USARTFP_MODE {
372        unsafe {
373            &mut *(((self as *const Self) as *mut u8).add(12usize)
374                as *mut self::usart_int::BAUD_USARTFP_MODE)
375        }
376    }
377    #[doc = "0x0c - USART_INT Baud Rate"]
378    #[inline(always)]
379    pub fn baud_fracfp_mode(&self) -> &self::usart_int::BAUD_FRACFP_MODE {
380        unsafe {
381            &*(((self as *const Self) as *const u8).add(12usize)
382                as *const self::usart_int::BAUD_FRACFP_MODE)
383        }
384    }
385    #[doc = "0x0c - USART_INT Baud Rate"]
386    #[inline(always)]
387    pub fn baud_fracfp_mode_mut(&self) -> &mut self::usart_int::BAUD_FRACFP_MODE {
388        unsafe {
389            &mut *(((self as *const Self) as *mut u8).add(12usize)
390                as *mut self::usart_int::BAUD_FRACFP_MODE)
391        }
392    }
393    #[doc = "0x0c - USART_INT Baud Rate"]
394    #[inline(always)]
395    pub fn baud_frac_mode(&self) -> &self::usart_int::BAUD_FRAC_MODE {
396        unsafe {
397            &*(((self as *const Self) as *const u8).add(12usize)
398                as *const self::usart_int::BAUD_FRAC_MODE)
399        }
400    }
401    #[doc = "0x0c - USART_INT Baud Rate"]
402    #[inline(always)]
403    pub fn baud_frac_mode_mut(&self) -> &mut self::usart_int::BAUD_FRAC_MODE {
404        unsafe {
405            &mut *(((self as *const Self) as *mut u8).add(12usize)
406                as *mut self::usart_int::BAUD_FRAC_MODE)
407        }
408    }
409    #[doc = "0x0c - USART_INT Baud Rate"]
410    #[inline(always)]
411    pub fn baud(&self) -> &self::usart_int::BAUD {
412        unsafe {
413            &*(((self as *const Self) as *const u8).add(12usize) as *const self::usart_int::BAUD)
414        }
415    }
416    #[doc = "0x0c - USART_INT Baud Rate"]
417    #[inline(always)]
418    pub fn baud_mut(&self) -> &mut self::usart_int::BAUD {
419        unsafe {
420            &mut *(((self as *const Self) as *mut u8).add(12usize) as *mut self::usart_int::BAUD)
421        }
422    }
423}
424#[doc = r"Register block"]
425#[doc = "USART INTERNAL CLOCK Mode"]
426pub mod usart_int;