Skip to content

Commit

Permalink
Revert "Fixed addressOffset fields for filters."
Browse files Browse the repository at this point in the history
This reverts commit 6bc584d.
  • Loading branch information
Frostie314159 committed Oct 22, 2024
1 parent 6bc584d commit 755e9a1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions esp32/src/wifi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#[doc = "Register block"]
pub struct RegisterBlock {
filter_bank: [FILTER_BANK; 2],
_reserved1: [u8; 0x44],
_reserved1: [u8; 0x04],
rx_ctrl: RX_CTRL,
rx_descr_base: RX_DESCR_BASE,
rx_descr_next: RX_DESCR_NEXT,
Expand Down Expand Up @@ -46,13 +46,13 @@ pub struct RegisterBlock {
crypto_key_entry: [CRYPTO_KEY_ENTRY; 16],
}
impl RegisterBlock {
#[doc = "0x00..0x40 - Filter banks for frame reception. Bank zero is for the BSSID and bank one for the RA. Each filter bank has registers for two interfaces."]
#[doc = "0x00..0x80 - Filter banks for frame reception. Bank zero is for the BSSID and bank one for the RA. Each filter bank has registers for two interfaces."]
#[inline(always)]
pub const fn filter_bank(&self, n: usize) -> &FILTER_BANK {
&self.filter_bank[n]
}
#[doc = "Iterator for array of:"]
#[doc = "0x00..0x40 - Filter banks for frame reception. Bank zero is for the BSSID and bank one for the RA. Each filter bank has registers for two interfaces."]
#[doc = "0x00..0x80 - Filter banks for frame reception. Bank zero is for the BSSID and bank one for the RA. Each filter bank has registers for two interfaces."]
#[inline(always)]
pub fn filter_bank_iter(&self) -> impl Iterator<Item = &FILTER_BANK> {
self.filter_bank.iter()
Expand Down
20 changes: 10 additions & 10 deletions esp32/src/wifi/filter_bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ pub struct FILTER_BANK {
addr_low: (),
_reserved1: [u8; 0x04],
addr_high: (),
_reserved2: [u8; 0x0c],
_reserved2: [u8; 0x1c],
mask_low: (),
_reserved3: [u8; 0x04],
mask_high: (),
_reserved_end: [u8; 0x0c],
_reserved_end: [u8; 0x1c],
}
impl FILTER_BANK {
#[doc = "0x00..0x08 - First 4 bytes of BSSID MAC address filter"]
Expand Down Expand Up @@ -40,33 +40,33 @@ impl FILTER_BANK {
(0..2)
.map(move |n| unsafe { &*(self as *const Self).cast::<u8>().add(4).add(8 * n).cast() })
}
#[doc = "0x10..0x18 - First 4 bytes of BSSID MAC address filter mask"]
#[doc = "0x20..0x28 - First 4 bytes of BSSID MAC address filter mask"]
#[inline(always)]
pub const fn mask_low(&self, n: usize) -> &MASK_LOW {
#[allow(clippy::no_effect)]
[(); 2][n];
unsafe { &*(self as *const Self).cast::<u8>().add(16).add(8 * n).cast() }
unsafe { &*(self as *const Self).cast::<u8>().add(32).add(8 * n).cast() }
}
#[doc = "Iterator for array of:"]
#[doc = "0x10..0x18 - First 4 bytes of BSSID MAC address filter mask"]
#[doc = "0x20..0x28 - First 4 bytes of BSSID MAC address filter mask"]
#[inline(always)]
pub fn mask_low_iter(&self) -> impl Iterator<Item = &MASK_LOW> {
(0..2)
.map(move |n| unsafe { &*(self as *const Self).cast::<u8>().add(16).add(8 * n).cast() })
.map(move |n| unsafe { &*(self as *const Self).cast::<u8>().add(32).add(8 * n).cast() })
}
#[doc = "0x14..0x1c - last 2 bytes of BSSID MAC address filter mask"]
#[doc = "0x24..0x2c - last 2 bytes of BSSID MAC address filter mask"]
#[inline(always)]
pub const fn mask_high(&self, n: usize) -> &MASK_HIGH {
#[allow(clippy::no_effect)]
[(); 2][n];
unsafe { &*(self as *const Self).cast::<u8>().add(20).add(8 * n).cast() }
unsafe { &*(self as *const Self).cast::<u8>().add(36).add(8 * n).cast() }
}
#[doc = "Iterator for array of:"]
#[doc = "0x14..0x1c - last 2 bytes of BSSID MAC address filter mask"]
#[doc = "0x24..0x2c - last 2 bytes of BSSID MAC address filter mask"]
#[inline(always)]
pub fn mask_high_iter(&self) -> impl Iterator<Item = &MASK_HIGH> {
(0..2)
.map(move |n| unsafe { &*(self as *const Self).cast::<u8>().add(20).add(8 * n).cast() })
.map(move |n| unsafe { &*(self as *const Self).cast::<u8>().add(36).add(8 * n).cast() })
}
}
#[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"]
Expand Down
6 changes: 3 additions & 3 deletions esp32/svd/patches/esp32-wifi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ WIFI:
_clusters:
FILTER_BANK%s:
dim: 2
dimIncrement: 0x20
dimIncrement: 0x40
addressOffset: 0x0
description: "
Filter banks for frame reception. Bank zero is for the BSSID and bank one for the RA.
Expand Down Expand Up @@ -218,13 +218,13 @@ WIFI:
dim: 2
dimIncrement: 0x8
description: First 4 bytes of BSSID MAC address filter mask
addressOffset: 0x10
addressOffset: 0x20
access: read-write
MASK_HIGH%s:
dim: 2
dimIncrement: 0x8
description: last 2 bytes of BSSID MAC address filter mask
addressOffset: 0x14
addressOffset: 0x24
access: read-write
fields:
MASK:
Expand Down

0 comments on commit 755e9a1

Please sign in to comment.