pub struct Pad2 {
pub pressed: u16,
}Expand description
A 2-button pad: SEL high shows the directions, SEL low the buttons.
[hw: pcetech 4] While CLR is high the pad’s multiplexer outputs 0 on D3-D0. [doc: controller-info] the 74HC157 gates all four outputs low on CLR.
Fields§
§pressed: u16Implementations§
Trait Implementations§
Source§impl ControllerPort for Pad2
impl ControllerPort for Pad2
fn write(&mut self, _sel: bool, _clr: bool)
fn read(&mut self, sel: bool, clr: bool) -> u8
Source§fn set_pressed(&mut self, _port: usize, pressed: u16)
fn set_pressed(&mut self, _port: usize, pressed: u16)
The host’s side: the buttons held on pad
port (0 for a pad plugged straight in, 0-4
behind a multitap), as the bit mask of pads.rs.fn as_any_mut(&mut self) -> &mut dyn Any
Source§impl<'de> Deserialize<'de> for Pad2
impl<'de> Deserialize<'de> for Pad2
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl DeviceState for Pad2
impl DeviceState for Pad2
Source§fn load_state(&mut self, data: &[u8]) -> Result<(), String>
fn load_state(&mut self, data: &[u8]) -> Result<(), String>
Put the device in a saved state. A device without state accepts only an empty one.
Source§fn state_identity(&self) -> String
fn state_identity(&self) -> String
What the device is and which media it holds (a card’s ROM by its SHA-1, a disc by its
table of contents): a state is refused by a system whose device answers otherwise.
impl Copy for Pad2
impl Eq for Pad2
impl StructuralPartialEq for Pad2
Auto Trait Implementations§
impl Freeze for Pad2
impl RefUnwindSafe for Pad2
impl Send for Pad2
impl Sync for Pad2
impl Unpin for Pad2
impl UnwindSafe for Pad2
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