Skip to main content
← PSoXide SDK guides and examples · SDK f2fec1c301f1 · All Cargo features enabled; check feature gates before use.

SpuDma

Struct SpuDma 

Source
pub struct SpuDma { /* private fields */ }
Expand description

DMA channel 4 (RAM to SPU RAM and back) and the SPU transfer port.

Implementations§

Source§

impl SpuDma

Source

pub fn write_blocks(&mut self, words: &[u32], block_words: u16) -> bool

Copy words to the SPU over DMA channel 4, in blocks of block_words words, and wait for the channel to finish.

Enables the channel without disturbing the others, starts a block-sync transfer, and ends it with wait_or_abort, so the SPU has taken every word or the channel has been aborted by the time this returns. The caller has already put the SPU in its DMA-write transfer mode.

Returns false without starting anything when words is empty (a zero block count means 65,536 blocks on silicon), when block_words is 0 or does not divide the length, or when the block count does not fit the 16-bit field; and false when the channel wedged and was aborted.

Source§

impl SpuDma

Source

pub const unsafe fn steal() -> Self

Make a token without going through psx_rt::Peripherals::take().

§Safety

The caller must not use this token while another one of the same type is in use: two owners of one device each assume they are the only driver programming it.

Trait Implementations§

Source§

impl Debug for SpuDma

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for SpuDma

§

impl RefUnwindSafe for SpuDma

§

impl Send for SpuDma

§

impl Sync for SpuDma

§

impl Unpin for SpuDma

§

impl UnsafeUnpin for SpuDma

§

impl UnwindSafe for SpuDma

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.