pub struct SpuAddr(/* private fields */);Expand description
An 8-byte-aligned SPU RAM address.
SPU voice-start / loop / transfer registers all hold addr / 8
in their 16-bit field. Construction asserts alignment so the
division is lossless and caller bugs don’t silently round down.
Implementations§
Source§impl SpuAddr
impl SpuAddr
Sourcepub const fn new(addr: u32) -> Self
pub const fn new(addr: u32) -> Self
Build from a byte offset into SPU RAM. Panics if addr
isn’t a multiple of 8.
Sourcepub const fn byte_offset(self) -> u32
pub const fn byte_offset(self) -> u32
The byte offset this address represents.
Sourcepub const fn register_value(self) -> u16
pub const fn register_value(self) -> u16
The 16-bit field value the SPU registers actually want
(addr / 8).
Trait Implementations§
impl Copy for SpuAddr
impl Eq for SpuAddr
impl StructuralPartialEq for SpuAddr
Auto Trait Implementations§
impl Freeze for SpuAddr
impl RefUnwindSafe for SpuAddr
impl Send for SpuAddr
impl Sync for SpuAddr
impl Unpin for SpuAddr
impl UnsafeUnpin for SpuAddr
impl UnwindSafe for SpuAddr
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)