pub struct Ay3_891xIo<T, R, A, B> {
    pub recorder: R,
    pub port_a: A,
    pub port_b: B,
    /* private fields */
}
Expand description

Implements a communication protocol with programmable sound generator AY-3-8910 / 8912 / 8913 and its I/O ports.

Records values written to audio registers which can be used to produce sound using audio::Ay3_891xAudio.

The recorder type R needs to implement AyRegRecorder trait. The port types A and B need to implement AyIoPort trait.

Fields§

§recorder: R

Provides access to the recorded changes of sound generator registers. The changes are required to generate sound with audio::Ay3_891xAudio.

§port_a: A

An instance of port A AyIoPort I/O device implementation.

§port_b: B

An instance of port B AyIoPort I/O device implementation.

Implementations§

Resets the state of internal registers, port devices, and which register is being currently selected for reading and writing.

NOTE: does nothing to the recorded register changes.

Clears recorder data and forwards the call to I/O port implementations. It can be used to indicate an end-of-frame.

Retrieves a current value of the indicated register.

Returns a reference to all registers as an array of their current values.

Returns an iterator of (register, value) pairs over current registers.

Returns an iterator of (register, value) pairs over current registers used by the sound generator.

Sets a current value of the indicated register.

Returns true if the control register bit controlling I/O port A input is reset.

Returns true if the control register bit controlling I/O port B input is reset.

Returns true if the control register bit controlling I/O port A input is set.

Returns true if the control register bit controlling I/O port B input is reset.

Returns a previously selected register with Ay3_891xIo::select_port_write.

Bits 0-3 of data selects a register to be read from or written to.

This method is being used to interface the host controller I/O operation.

Writes data to a previously selected register and records a change in the attached recorder unless a write is performed to one of the I/O ports.

This method is being used to interface the host controller I/O operation.

Reads data from a previously selected register.

This method is being used to interface the host controller I/O operation.

Trait Implementations§

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.