-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regen with chiptool d29063045446448526e3e0c19857f10e32992386
- Loading branch information
Showing
31 changed files
with
3,090 additions
and
758 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,58 @@ | ||
#[repr(transparent)] | ||
#[repr(u8)] | ||
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
pub struct Perfsel(pub u8); | ||
pub enum Perfsel { | ||
APB_CONTESTED = 0, | ||
APB = 0x01, | ||
FASTPERI_CONTESTED = 0x02, | ||
FASTPERI = 0x03, | ||
SRAM5_CONTESTED = 0x04, | ||
SRAM5 = 0x05, | ||
SRAM4_CONTESTED = 0x06, | ||
SRAM4 = 0x07, | ||
SRAM3_CONTESTED = 0x08, | ||
SRAM3 = 0x09, | ||
SRAM2_CONTESTED = 0x0a, | ||
SRAM2 = 0x0b, | ||
SRAM1_CONTESTED = 0x0c, | ||
SRAM1 = 0x0d, | ||
SRAM0_CONTESTED = 0x0e, | ||
SRAM0 = 0x0f, | ||
XIP_MAIN_CONTESTED = 0x10, | ||
XIP_MAIN = 0x11, | ||
ROM_CONTESTED = 0x12, | ||
ROM = 0x13, | ||
_RESERVED_14 = 0x14, | ||
_RESERVED_15 = 0x15, | ||
_RESERVED_16 = 0x16, | ||
_RESERVED_17 = 0x17, | ||
_RESERVED_18 = 0x18, | ||
_RESERVED_19 = 0x19, | ||
_RESERVED_1a = 0x1a, | ||
_RESERVED_1b = 0x1b, | ||
_RESERVED_1c = 0x1c, | ||
_RESERVED_1d = 0x1d, | ||
_RESERVED_1e = 0x1e, | ||
_RESERVED_1f = 0x1f, | ||
} | ||
impl Perfsel { | ||
pub const APB_CONTESTED: Self = Self(0); | ||
pub const APB: Self = Self(0x01); | ||
pub const FASTPERI_CONTESTED: Self = Self(0x02); | ||
pub const FASTPERI: Self = Self(0x03); | ||
pub const SRAM5_CONTESTED: Self = Self(0x04); | ||
pub const SRAM5: Self = Self(0x05); | ||
pub const SRAM4_CONTESTED: Self = Self(0x06); | ||
pub const SRAM4: Self = Self(0x07); | ||
pub const SRAM3_CONTESTED: Self = Self(0x08); | ||
pub const SRAM3: Self = Self(0x09); | ||
pub const SRAM2_CONTESTED: Self = Self(0x0a); | ||
pub const SRAM2: Self = Self(0x0b); | ||
pub const SRAM1_CONTESTED: Self = Self(0x0c); | ||
pub const SRAM1: Self = Self(0x0d); | ||
pub const SRAM0_CONTESTED: Self = Self(0x0e); | ||
pub const SRAM0: Self = Self(0x0f); | ||
pub const XIP_MAIN_CONTESTED: Self = Self(0x10); | ||
pub const XIP_MAIN: Self = Self(0x11); | ||
pub const ROM_CONTESTED: Self = Self(0x12); | ||
pub const ROM: Self = Self(0x13); | ||
#[inline(always)] | ||
pub const fn from_bits(val: u8) -> Perfsel { | ||
unsafe { core::mem::transmute(val & 0x1f) } | ||
} | ||
#[inline(always)] | ||
pub const fn to_bits(self) -> u8 { | ||
unsafe { core::mem::transmute(self) } | ||
} | ||
} | ||
impl From<u8> for Perfsel { | ||
#[inline(always)] | ||
fn from(val: u8) -> Perfsel { | ||
Perfsel::from_bits(val) | ||
} | ||
} | ||
impl From<Perfsel> for u8 { | ||
#[inline(always)] | ||
fn from(val: Perfsel) -> u8 { | ||
Perfsel::to_bits(val) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.