pub trait CommandOutput {
// Required method
fn execute(&mut self, command: Command);
}Expand description
Helper trait that lets you implement an “output” for the commands that the driver generates.
Example:
use ym2149_core::command::{Command, CommandOutput};
struct DebugWriter;
impl CommandOutput for DebugWriter {
fn execute(&mut self, command: Command) {
let arr = command.as_array();
println!("Writing 0b{:08b} to register 0b{:08b}.", arr[0], arr[1]);
}
}