esp32s2/wifi/
filter_bank.rs1#[repr(C)]
2#[cfg_attr(feature = "impl-register-debug", derive(Debug))]
3#[doc = "Filter banks for frame reception. Bank zero is for the BSSID and bank one for the RA. Each filter bank has registers for four interfaces."]
4pub struct FILTER_BANK {
5 addr_low: (),
6 _reserved1: [u8; 0x04],
7 addr_high: (),
8 _reserved2: [u8; 0x1c],
9 mask_low: (),
10 _reserved3: [u8; 0x04],
11 mask_high: (),
12 _reserved_end: [u8; 0x1c],
13}
14impl FILTER_BANK {
15 #[doc = "0x00..0x10 - First 4 bytes of BSSID MAC address filter"]
16 #[inline(always)]
17 pub const fn addr_low(&self, n: usize) -> &ADDR_LOW {
18 #[allow(clippy::no_effect)]
19 [(); 4][n];
20 unsafe { &*core::ptr::from_ref(self).cast::<u8>().add(8 * n).cast() }
21 }
22 #[doc = "Iterator for array of:"]
23 #[doc = "0x00..0x10 - First 4 bytes of BSSID MAC address filter"]
24 #[inline(always)]
25 pub fn addr_low_iter(&self) -> impl Iterator<Item = &ADDR_LOW> {
26 (0..4).map(move |n| unsafe { &*core::ptr::from_ref(self).cast::<u8>().add(8 * n).cast() })
27 }
28 #[doc = "0x04..0x14 - last 2 bytes of BSSID MAC address filter"]
29 #[inline(always)]
30 pub const fn addr_high(&self, n: usize) -> &ADDR_HIGH {
31 #[allow(clippy::no_effect)]
32 [(); 4][n];
33 unsafe {
34 &*core::ptr::from_ref(self)
35 .cast::<u8>()
36 .add(4)
37 .add(8 * n)
38 .cast()
39 }
40 }
41 #[doc = "Iterator for array of:"]
42 #[doc = "0x04..0x14 - last 2 bytes of BSSID MAC address filter"]
43 #[inline(always)]
44 pub fn addr_high_iter(&self) -> impl Iterator<Item = &ADDR_HIGH> {
45 (0..4).map(move |n| unsafe {
46 &*core::ptr::from_ref(self)
47 .cast::<u8>()
48 .add(4)
49 .add(8 * n)
50 .cast()
51 })
52 }
53 #[doc = "0x20..0x30 - First 4 bytes of BSSID MAC address filter mask"]
54 #[inline(always)]
55 pub const fn mask_low(&self, n: usize) -> &MASK_LOW {
56 #[allow(clippy::no_effect)]
57 [(); 4][n];
58 unsafe {
59 &*core::ptr::from_ref(self)
60 .cast::<u8>()
61 .add(32)
62 .add(8 * n)
63 .cast()
64 }
65 }
66 #[doc = "Iterator for array of:"]
67 #[doc = "0x20..0x30 - First 4 bytes of BSSID MAC address filter mask"]
68 #[inline(always)]
69 pub fn mask_low_iter(&self) -> impl Iterator<Item = &MASK_LOW> {
70 (0..4).map(move |n| unsafe {
71 &*core::ptr::from_ref(self)
72 .cast::<u8>()
73 .add(32)
74 .add(8 * n)
75 .cast()
76 })
77 }
78 #[doc = "0x24..0x34 - last 2 bytes of BSSID MAC address filter mask"]
79 #[inline(always)]
80 pub const fn mask_high(&self, n: usize) -> &MASK_HIGH {
81 #[allow(clippy::no_effect)]
82 [(); 4][n];
83 unsafe {
84 &*core::ptr::from_ref(self)
85 .cast::<u8>()
86 .add(36)
87 .add(8 * n)
88 .cast()
89 }
90 }
91 #[doc = "Iterator for array of:"]
92 #[doc = "0x24..0x34 - last 2 bytes of BSSID MAC address filter mask"]
93 #[inline(always)]
94 pub fn mask_high_iter(&self) -> impl Iterator<Item = &MASK_HIGH> {
95 (0..4).map(move |n| unsafe {
96 &*core::ptr::from_ref(self)
97 .cast::<u8>()
98 .add(36)
99 .add(8 * n)
100 .cast()
101 })
102 }
103}
104#[doc = "ADDR_LOW (rw) register accessor: First 4 bytes of BSSID MAC address filter\n\nYou can [`read`](crate::Reg::read) this register and get [`addr_low::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`addr_low::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@addr_low`] module"]
105pub type ADDR_LOW = crate::Reg<addr_low::ADDR_LOW_SPEC>;
106#[doc = "First 4 bytes of BSSID MAC address filter"]
107pub mod addr_low;
108#[doc = "ADDR_HIGH (rw) register accessor: last 2 bytes of BSSID MAC address filter\n\nYou can [`read`](crate::Reg::read) this register and get [`addr_high::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`addr_high::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@addr_high`] module"]
109pub type ADDR_HIGH = crate::Reg<addr_high::ADDR_HIGH_SPEC>;
110#[doc = "last 2 bytes of BSSID MAC address filter"]
111pub mod addr_high;
112#[doc = "MASK_LOW (rw) register accessor: First 4 bytes of BSSID MAC address filter mask\n\nYou can [`read`](crate::Reg::read) this register and get [`mask_low::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mask_low::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@mask_low`] module"]
113pub type MASK_LOW = crate::Reg<mask_low::MASK_LOW_SPEC>;
114#[doc = "First 4 bytes of BSSID MAC address filter mask"]
115pub mod mask_low;
116#[doc = "MASK_HIGH (rw) register accessor: last 2 bytes of BSSID MAC address filter mask\n\nYou can [`read`](crate::Reg::read) this register and get [`mask_high::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mask_high::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@mask_high`] module"]
117pub type MASK_HIGH = crate::Reg<mask_high::MASK_HIGH_SPEC>;
118#[doc = "last 2 bytes of BSSID MAC address filter mask"]
119pub mod mask_high;