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

Module controller_port

Module controller_port 

Source
Expand description

The controller and memory-card port: one serial transport shared by every driver on it.

A pad and a memory card sit on the same wires, so a program has one owner for them, the ControllerPort token, and the drivers (psx-pad, psx-mc) borrow it for the length of a transaction. What they borrow is the Transport: select a socket, clock bytes with the device’s /ACK pulse pacing each one, release the socket. The pad’s timing is the reference, since it was tuned on an original SCPH-1200, a clone and an SCPH-110; a memory card uses the same exchange with a longer budget for the /ACK after a flash write.

Register addresses and bit layouts live in [psx_hw::sio::sio0].

let mut port = peripherals.controller_port;
let mut pads = psx_pad::PadReader::port1();
let state = pads.poll(&mut port);
let mut card = psx_mc::Card::new(psx_mc::HardwareCard::on_port(&mut port, Slot::One));

Structs§

Timing
Spin budgets for one transaction. Each spin is one bounded STAT read, so the budgets bound the time a missing or wedged device can cost.

Enums§

ExchangeError
Why one byte exchange failed.
Port
Which socket a transaction addresses.

Traits§

Transport
The six accesses the transport makes to the port, and the transaction steps built on them.