use core::fmt;
use spectrusty_core::bus::BusDevice;
use crate::ay::{AyIoNullPort, Ay128kPortDecode};
pub use crate::ay::serial128::SerialPorts128;
pub use crate::serial::{NullSerialPort, Rs232Io, SerialKeypad};
use super::Ay3_891xBusDevice;
pub type Ay3_8912Keypad<D> = Ay3_891xBusDevice<
Ay128kPortDecode,
SerialPorts128<
SerialKeypad<<D as BusDevice>::Timestamp>,
NullSerialPort<<D as BusDevice>::Timestamp>
>,
AyIoNullPort<<D as BusDevice>::Timestamp>, D>;
pub type Ay3_8912Rs232<D, R, W> = Ay3_891xBusDevice<
Ay128kPortDecode,
SerialPorts128<
NullSerialPort<<D as BusDevice>::Timestamp>,
Rs232Io<<D as BusDevice>::Timestamp, R, W>
>,
AyIoNullPort<<D as BusDevice>::Timestamp>, D>;
pub type Ay3_8912KeypadRs232<D, R, W> = Ay3_891xBusDevice<
Ay128kPortDecode,
SerialPorts128<
SerialKeypad<<D as BusDevice>::Timestamp>,
Rs232Io<<D as BusDevice>::Timestamp, R, W>
>,
AyIoNullPort<<D as BusDevice>::Timestamp>, D>;
impl<D: BusDevice> fmt::Display for Ay3_8912Keypad<D> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str("AY-3-8912 + Keypad")
}
}
impl<D: BusDevice, R, W> fmt::Display for Ay3_8912Rs232<D, R, W> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str("AY-3-8912 + RS-232")
}
}
impl<D: BusDevice, R, W> fmt::Display for Ay3_8912KeypadRs232<D, R, W> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str("AY-3-8912 + Keypad + RS-232")
}
}