[][src]Struct spectrusty::peripherals::ay::serial128::SerialPorts128

pub struct SerialPorts128<S1, S2> {
    pub serial1: S1,
    pub serial2: S2,
    // some fields omitted
}

The bridge between ZX Spectrum 128 AY-3-8912 I/O ports and emulators of serial port devices.

The RS232C/MIDI interface is implemented using the Port A Data Store in the sound generator chip IC32. The data store is a special register that accesses an 8-bit bi-directional port A7-AO. The port occupies the same I/O space as the sound generator registers and is accessed in much the same way.

Bits of an I/O port A register have the following meaning:

  • A0: KEYPAD CTS (OUT) = 0: active - Spectrum ready to receive, 1: inactive - busy.
  • A1: KEYPAD RXD (OUT) = 0: transmit bit (high voltage), 1: transmit bit (low voltage).
  • A2: RS232 CTS (OUT) = 0: active - Spectrum ready to receive, 1: inactive - busy.
  • A3: RS232 RXD (OUT) = 0: transmit (high voltage), 1: transmit bit (low voltage).
  • A4: KEYPAD DTR (IN) = 0: active - a device ready for data, 1: inactive - busy.
  • A5: KEYPAD TXD (IN) = 0: receive bit (high voltage), 1: Receive bit (low voltage).
  • A6: RS232 DTR (IN) = 0: active - a device ready for data, 1: inactive - busy.
  • A7: RS232 TXD (IN) = 0: receive bit (high voltage), 1: Receive bit (low voltage).

This type implements a single AyIoPort as two serial ports of ZX Spectrum 128.

One of these ports is primarily being used for the extension keypad and the other for communicating with a serial printer or another RS-232 device in either direction.

To "connect" something to these ports, provide some types that implement SerialPortDevice as S1 and S2.

Fields

serial1: S1

A SerialPortDevice connected to a KEYPAD port.

serial2: S2

A SerialPortDevice connected to a RS232 port.

Trait Implementations

impl<S1, S2> AyIoPort for SerialPorts128<S1, S2> where
    S1: SerialPortDevice,
    S2: SerialPortDevice<Timestamp = <S1 as SerialPortDevice>::Timestamp>,
    <S1 as SerialPortDevice>::Timestamp: Copy
[src]

type Timestamp = <S1 as SerialPortDevice>::Timestamp

impl<S1, S2> Clone for SerialPorts128<S1, S2> where
    S1: Clone,
    S2: Clone
[src]

impl<S1, S2> Debug for SerialPorts128<S1, S2> where
    S1: Debug,
    S2: Debug
[src]

impl<S1, S2> Default for SerialPorts128<S1, S2> where
    S1: Default,
    S2: Default
[src]

impl<'de, S1, S2> Deserialize<'de> for SerialPorts128<S1, S2> where
    S1: Deserialize<'de> + Default,
    S2: Deserialize<'de> + Default
[src]

impl<S1, S2> Serialize for SerialPorts128<S1, S2> where
    S1: Serialize,
    S2: Serialize
[src]

Auto Trait Implementations

impl<S1, S2> RefUnwindSafe for SerialPorts128<S1, S2> where
    S1: RefUnwindSafe,
    S2: RefUnwindSafe
[src]

impl<S1, S2> Send for SerialPorts128<S1, S2> where
    S1: Send,
    S2: Send
[src]

impl<S1, S2> Sync for SerialPorts128<S1, S2> where
    S1: Sync,
    S2: Sync
[src]

impl<S1, S2> Unpin for SerialPorts128<S1, S2> where
    S1: Unpin,
    S2: Unpin
[src]

impl<S1, S2> UnwindSafe for SerialPorts128<S1, S2> where
    S1: UnwindSafe,
    S2: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> Conv for T

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<S, T> IntoSample<S> for T where
    S: FromSample<T>, 
[src]

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,