pub struct JoyCon {
pub max_raw_gyro: i16,
pub max_raw_accel: i16,
/* private fields */
}
Fields§
§max_raw_gyro: i16
§max_raw_accel: i16
Implementations§
source§impl JoyCon
impl JoyCon
pub fn new(device: HidDevice, info: DeviceInfo) -> Result<JoyCon>
pub fn supports_ir(&self) -> bool
pub fn send(&mut self, report: &mut OutputReport) -> Result<()>
pub fn recv(&mut self) -> Result<InputReport>
pub fn set_rumble(&mut self, rumble: RumbleData) -> Result<()>
pub fn tick(&mut self) -> Result<Report>
pub fn load_calibration(&mut self) -> Result<()>
pub fn get_dev_info(&mut self) -> Result<DeviceInfo>
pub fn set_home_light(&mut self, home_light: HomeLight) -> Result<()>
pub fn set_player_light(&mut self, player_lights: PlayerLights) -> Result<()>
pub fn call_subcmd_wait<S: Into<SubcommandRequest> + Debug>( &mut self, subcmd: S ) -> Result<SubcommandReply>
pub fn read_spi<S: SPI>(&mut self) -> Result<S>
pub fn read_spi_raw(&mut self, range: SPIRange) -> Result<[u8; 29]>
pub fn write_spi<S: SPI + Into<SPIWriteRequest> + Debug>( &mut self, value: S ) -> Result<bool>
pub unsafe fn write_spi_raw( &mut self, range: SPIRange, data: &[u8] ) -> Result<bool>
source§impl JoyCon
impl JoyCon
MCU handling (infrared camera and NFC reader)
pub fn enable_ir(&mut self, resolution: Resolution) -> Result<()>
pub fn disable_mcu(&mut self) -> Result<()>
pub fn enable_pulserate(&mut self) -> Result<()>
pub fn set_ir_image_mode(&mut self, ir_mode: MCUIRMode, frags: u8) -> Result<()>
pub fn get_ir_registers(&mut self) -> Result<Vec<Register>>
pub fn set_ir_registers(&mut self, regs: &[Register]) -> Result<()>
pub fn change_ir_resolution(&mut self, resolution: Resolution) -> Result<()>
source§impl JoyCon
impl JoyCon
IMU handling (gyroscope and accelerometer)
pub fn enable_imu(&mut self) -> Result<()>
pub fn set_imu_sens(&mut self) -> Result<()>
source§impl JoyCon
impl JoyCon
Ringcon handling
pub fn enable_ringcon(&mut self) -> Result<()>
pub fn disable_ringcon(&mut self) -> Result<()>
pub fn mcu_wait_not_busy(&mut self) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for JoyCon
impl RefUnwindSafe for JoyCon
impl Send for JoyCon
impl !Sync for JoyCon
impl Unpin for JoyCon
impl UnwindSafe for JoyCon
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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