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

Mmio

Struct Mmio 

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

The CD-ROM controller, through the SDK’s register steps.

Trait Implementations§

Source§

impl CdHw for Mmio

Source§

const TRACE: bool = true

Whether to record controller events through trace. Constant per implementation so the unused event words fold away.
Source§

fn issue(&mut self, command: u8, params: &[u8]) -> bool

Send one drive command and arm the controller to interrupt for its responses. Returns false when the parameter FIFO never had room (the command is not sent). Read more
Source§

fn interrupt_code(&mut self) -> u8

The controller’s current interrupt flag (0 none, 1 data ready, 2 complete, 3 acknowledge, 5 error).
Source§

fn error_response(&mut self) -> (u8, u8)

The first two response bytes of a drive error: status and error code.
Source§

fn discard_response(&mut self)

Pop and discard the response FIFO.
Source§

fn acknowledge(&mut self, bits: u8)

Acknowledge interrupt flag bits on the controller and the CPU-side pending bit. acknowledge(0) only clears the CPU-side bit.
Source§

fn silence_output(&mut self)

Mask the controller’s interrupt output, so nothing more is raised until the next issue.
Source§

fn drop_data_request(&mut self)

Drop a data request left armed by the previous transfer. Called before the first command of a transfer that did not start from a recovery pause.
Source§

unsafe fn pop_sector( &mut self, destination: *mut u32, store_words: usize, ) -> bool

Pop one sector’s 2048 bytes from the data FIFO as 512 little-endian words, storing the first store_words of them at destination. The rest are popped and dropped (the FIFO has to be emptied either way). Arms the data request and waits a bounded time for the FIFO to fill; false if it never does. Read more
Source§

fn set_source_enabled(&mut self, enabled: bool)

Let the CD interrupt source reach the CPU (or not). Read more
Source§

fn vblank_count(&mut self) -> u32

Monotonic VBlank count, the clock the no-progress timeout runs on.
Source§

fn clock(&mut self) -> u16

A free-running timestamp for measuring the handler, wrapping at 16 bits. Implementations that do not measure return a constant.
Source§

fn trace(&mut self, word: u32)

Record one trace word (only called when TRACE is set).

Auto Trait Implementations§

§

impl Freeze for Mmio

§

impl RefUnwindSafe for Mmio

§

impl Send for Mmio

§

impl Sync for Mmio

§

impl Unpin for Mmio

§

impl UnsafeUnpin for Mmio

§

impl UnwindSafe for Mmio

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.