#[repr(u8)]pub enum ChipMode {
INACTIVE = 0,
READ = 1,
WRITE = 2,
ADDRESS = 3,
}Expand description
The four modes of the YM2149’s bus control decoder.
Bus control decoder table, no redundancy:
| Mode | BDIR | BC2 | BC1 |
|---|---|---|---|
| INACTIVE | 0 | 1 | 0 |
| READ | 0 | 1 | 1 |
| WRITE | 1 | 1 | 0 |
| ADDRESS | 1 | 1 | 1 |
Variants§
INACTIVE = 0
DA7~DA0 has high impedance.
READ = 1
DA7~DA0 set to output mode, and contents of register currently being addressed are output.
§Warning!
Mode::READ makes the chip output 5V to the data bus. If you’re using this crate in an embedded project,
make sure that 5V isn’t too high for your board! If it is, you can use a level shifter to prevent damage to your board.
WRITE = 2
DA7~DA0 set to input mode, and data is written to register currently being addressed.
ADDRESS = 3
DA7~DA0 set to input mode, and address is fetched from register array.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ChipMode
impl RefUnwindSafe for ChipMode
impl Send for ChipMode
impl Sync for ChipMode
impl Unpin for ChipMode
impl UnwindSafe for ChipMode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more