#[non_exhaustive]pub struct Peripherals {
pub gpu_dma: GpuDma,
pub ordering_table_clear_dma: OrderingTableClearDma,
pub mdec_dma: MdecDma,
pub spu_dma: SpuDma,
pub cd: Cd,
pub controller_port: ControllerPort,
}Expand description
Every shared-state peripheral token, handed out once.
ⓘ
let p = psx_rt::Peripherals::take().unwrap();
let mut gpu = psx_gpu::Gpu::new(p.gpu_dma, display);
let mut port = p.controller_port; // pads and memory cards borrow it
let mut spu = psx_spu::Spu::new(p.spu_dma);
let cd = p.cd; // or `SectorReader::with_cd(cd)`, `xa::Player::new(cd)`Each token is owned by the driver that programs its device; see
psx_io::periph for who that is.
The tokens are zero-sized, so Peripherals is too; moving it or its
fields around costs nothing.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.gpu_dma: GpuDmaDMA channel 2 and the GP0 stream it feeds.
ordering_table_clear_dma: OrderingTableClearDmaDMA channel 6, the ordering-table clear.
mdec_dma: MdecDmaDMA channels 0 and 1 (MDEC in and out).
spu_dma: SpuDmaDMA channel 4 and the SPU transfer port.
cd: CdThe CD-ROM controller and DMA channel 3.
controller_port: ControllerPortThe pad and memory-card port (SIO0).