pub struct Controller { /* private fields */ }Expand description
One standard NES controller plugged into $4016 (player 1) or $4017
(player 2).
Implementations§
Source§impl Controller
impl Controller
Set the current button state. Takes effect on the next strobe edge (or immediately, while strobe is held high).
Get the current button state.
Sourcepub const fn write_strobe(&mut self, value: u8)
pub const fn write_strobe(&mut self, value: u8)
Handle a write to $4016. Only bit 0 matters for the standard
controller. While strobe is held high the shift register continuously
reloads from the live button state.
Trait Implementations§
Source§impl Clone for Controller
impl Clone for Controller
Source§fn clone(&self) -> Controller
fn clone(&self) -> Controller
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Controller
impl Debug for Controller
Source§impl Default for Controller
impl Default for Controller
Source§fn default() -> Controller
fn default() -> Controller
Returns the “default value” for a type. Read more
impl Copy for Controller
Auto Trait Implementations§
impl Freeze for Controller
impl RefUnwindSafe for Controller
impl Send for Controller
impl Sync for Controller
impl Unpin for Controller
impl UnsafeUnpin for Controller
impl UnwindSafe for Controller
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