Trait spectrusty::peripherals::zxprinter::Spooler
source · pub trait Spooler: Debug + Default {
fn push_line(&mut self, line: &[u8]);
fn motor_on(&mut self) { ... }
fn motor_off(&mut self) { ... }
}
Expand description
An interface to the ZX Printer spooler.
An implementation of this trait must be provided in order to complete the emulation of ZxPrinterDevice.
Required Methods§
sourcefn push_line(&mut self, line: &[u8])
fn push_line(&mut self, line: &[u8])
After each printed line this method is being called with a reference to a slice containing information about up to 256 printed dots stored in up to 32 bytes.
8 dots are encoded from the most significant to the least significant bit in each byte. So the leftmost dot is encoded in the bit 7 of the first byte in a given slice and the rightmost dot is encoded in the bit 0 of the last byte.
A value of 1 in each bit signifies the presence of a dot, 0 means there is no dot.
A received slice will never be larger than 32 bytes. If a user presses a BREAK
key during
COPY
, the slice may be smaller than 32 bytes but it will never be empty.