atsamd21j/
hmatrix.rs
1#[repr(C)]
2#[doc = "Register block"]
3pub struct RegisterBlock {
4 _reserved0: [u8; 0x80],
5 pras: (),
6 _reserved1: [u8; 0x04],
7 prbs: (),
8 _reserved2: [u8; 0x8c],
9 sfr: [Sfr; 16],
10}
11impl RegisterBlock {
12 #[doc = "0x80..0xc0 - Priority A for Slave"]
13 #[inline(always)]
14 pub const fn pras(&self, n: usize) -> &Pras {
15 #[allow(clippy::no_effect)]
16 [(); 16][n];
17 unsafe {
18 &*(self as *const Self)
19 .cast::<u8>()
20 .add(128)
21 .add(8 * n)
22 .cast()
23 }
24 }
25 #[doc = "Iterator for array of:"]
26 #[doc = "0x80..0xc0 - Priority A for Slave"]
27 #[inline(always)]
28 pub fn pras_iter(&self) -> impl Iterator<Item = &Pras> {
29 (0..16).map(move |n| unsafe {
30 &*(self as *const Self)
31 .cast::<u8>()
32 .add(128)
33 .add(8 * n)
34 .cast()
35 })
36 }
37 #[doc = "0x84..0xc4 - Priority B for Slave"]
38 #[inline(always)]
39 pub const fn prbs(&self, n: usize) -> &Prbs {
40 #[allow(clippy::no_effect)]
41 [(); 16][n];
42 unsafe {
43 &*(self as *const Self)
44 .cast::<u8>()
45 .add(132)
46 .add(8 * n)
47 .cast()
48 }
49 }
50 #[doc = "Iterator for array of:"]
51 #[doc = "0x84..0xc4 - Priority B for Slave"]
52 #[inline(always)]
53 pub fn prbs_iter(&self) -> impl Iterator<Item = &Prbs> {
54 (0..16).map(move |n| unsafe {
55 &*(self as *const Self)
56 .cast::<u8>()
57 .add(132)
58 .add(8 * n)
59 .cast()
60 })
61 }
62 #[doc = "0x110..0x150 - Special Function"]
63 #[inline(always)]
64 pub const fn sfr(&self, n: usize) -> &Sfr {
65 &self.sfr[n]
66 }
67 #[doc = "Iterator for array of:"]
68 #[doc = "0x110..0x150 - Special Function"]
69 #[inline(always)]
70 pub fn sfr_iter(&self) -> impl Iterator<Item = &Sfr> {
71 self.sfr.iter()
72 }
73}
74#[doc = "PRAS (rw) register accessor: Priority A for Slave\n\nYou can [`read`](crate::Reg::read) this register and get [`pras::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pras::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pras`]
75module"]
76#[doc(alias = "PRAS")]
77pub type Pras = crate::Reg<pras::PrasSpec>;
78#[doc = "Priority A for Slave"]
79pub mod pras;
80#[doc = "PRBS (rw) register accessor: Priority B for Slave\n\nYou can [`read`](crate::Reg::read) this register and get [`prbs::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`prbs::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@prbs`]
81module"]
82#[doc(alias = "PRBS")]
83pub type Prbs = crate::Reg<prbs::PrbsSpec>;
84#[doc = "Priority B for Slave"]
85pub mod prbs;
86#[doc = "SFR (rw) register accessor: Special Function\n\nYou can [`read`](crate::Reg::read) this register and get [`sfr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`sfr::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@sfr`]
87module"]
88#[doc(alias = "SFR")]
89pub type Sfr = crate::Reg<sfr::SfrSpec>;
90#[doc = "Special Function"]
91pub mod sfr;