pub struct SerialPorts128<S1, S2> {
    pub serial1: S1,
    pub serial2: S2,
    /* private fields */
}
Expand description

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§

Resets the device at the given timestamp.
Writes data to the device at the given timestamp.
Reads data from the device at the given timestamp.
Signals the device when the current frame ends, providing the value of the cycle clock after the frame execution stopped. Read more
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Deserialize this value from the given Serde deserializer. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Converts self into T using Into<T>. Read more
Causes self to use its Binary implementation when Debug-formatted.
Causes self to use its Display implementation when Debug-formatted. Read more
Causes self to use its LowerExp implementation when Debug-formatted. Read more
Causes self to use its LowerHex implementation when Debug-formatted. Read more
Causes self to use its Octal implementation when Debug-formatted.
Causes self to use its Pointer implementation when Debug-formatted. Read more
Causes self to use its UpperExp implementation when Debug-formatted. Read more
Causes self to use its UpperHex implementation when Debug-formatted. Read more
Formats each item in a sequence. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Convert to S a sample type from self.
Pipes by value. This is generally the method you want to use. Read more
Borrows self and passes that borrow into the pipe function. Read more
Mutably borrows self and passes that borrow into the pipe function. Read more
Borrows self, then passes self.borrow() into the pipe function. Read more
Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Borrows self, then passes self.as_ref() into the pipe function.
Mutably borrows self, then passes self.as_mut() into the pipe function. Read more
Borrows self, then passes self.deref() into the pipe function.
Mutably borrows self, then passes self.deref_mut() into the pipe function. Read more
Immutable access to a value. Read more
Mutable access to a value. Read more
Immutable access to the Borrow<B> of a value. Read more
Mutable access to the BorrowMut<B> of a value. Read more
Immutable access to the AsRef<R> view of a value. Read more
Mutable access to the AsMut<R> view of a value. Read more
Immutable access to the Deref::Target of a value. Read more
Mutable access to the Deref::Target of a value. Read more
Calls .tap() only in debug builds, and is erased in release builds.
Calls .tap_mut() only in debug builds, and is erased in release builds. Read more
Calls .tap_borrow() only in debug builds, and is erased in release builds. Read more
Calls .tap_borrow_mut() only in debug builds, and is erased in release builds. Read more
Calls .tap_ref() only in debug builds, and is erased in release builds. Read more
Calls .tap_ref_mut() only in debug builds, and is erased in release builds. Read more
Calls .tap_deref() only in debug builds, and is erased in release builds. Read more
Calls .tap_deref_mut() only in debug builds, and is erased in release builds. Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Attempts to convert self into T using TryInto<T>. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.