Module cpu_io

Module cpu_io 

Source
Expand description

The HuC6280’s on-die peripherals that are not the CPU: timer, $1400 interrupt controller, I/O port and the I/O buffer (cpu_io/__init__.py; Aubrey’s rule: in the board, behind a module boundary).

Nothing here uses the rest of the crate except the sockets traits, so the module can move into a core or a repository of its own if a second consumer appears (a Data East arcade board’s HuC6280). Never copied.

CpuIo answers the hardware-page offsets $0800-$17FF: the PSG range is forwarded to an object the board supplies, so this module does not use the PSG.

Differences forced by Rust: the PSG and the CD-sense level are arguments of each access (the reference holds a reference and a callable); a change of the disable mask is left in IrqController::mask_changed for the board to hand the CPU when the access returns (the reference calls back from inside the write; nothing touches the CPU in between).

Re-exports§

pub use io_buffer::IoBuffer;
pub use io_port::IoPort;
pub use irq_ctl::IrqController;
pub use timer::Timer;

Modules§

io_buffer
The I/O buffer: the last value read from or written to $0800-$17FF (cpu_io/io_buffer.py).
io_port
The I/O port ($1000-$13FF, one register) and what answers on the pad pins (cpu_io/io_port.py).
irq_ctl
The interrupt controller ($1400-$17FF, mirrored every 4 bytes) (cpu_io/irq_ctl.py).
timer
The HuC6280’s 7-bit timer ($0C00-$0FFF, mirrored every 2 bytes) (cpu_io/timer.py).

Structs§

CpuIo

Traits§

PsgPins
What CpuIo needs from the sound generator: its register writes.