pub struct GamecubeController { /* private fields */ }
Expand description
A wrapper around JoybusPio
providing a high level interface for acting as a gamecube controller.
Implementations§
Source§impl GamecubeController
impl GamecubeController
Sourcepub fn try_new(
pio: JoybusPio,
timer: &Timer,
delay: &mut Delay,
) -> Option<GamecubeController>
pub fn try_new( pio: JoybusPio, timer: &Timer, delay: &mut Delay, ) -> Option<GamecubeController>
Initializes a connection with a gamecube protocol compatible device and
returns a GamecubeController
instance to interact with this connection.
If None is returned the device is not compatible with the gamecube protocol.
pub fn wait_for_poll_start(&mut self, timer: &Timer, delay: &mut Delay)
pub fn restart_sm_for_read(&mut self)
pub fn restart_sm_for_write(&mut self)
pub fn respond_to_poll( &mut self, timer: &Timer, delay: &mut Delay, input: GamecubeInput, )
pub fn respond_to_poll_raw( &mut self, timer: &Timer, delay: &mut Delay, report: &[u8], )
pub fn recv(&mut self, timer: &Timer) -> Option<u8>
pub fn send(&mut self, values: &[u8])
Auto Trait Implementations§
impl Freeze for GamecubeController
impl !RefUnwindSafe for GamecubeController
impl Send for GamecubeController
impl !Sync for GamecubeController
impl Unpin for GamecubeController
impl !UnwindSafe for GamecubeController
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
Source§impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more