Struct pscontroller_rs::PlayStationPort
[−]
[src]
pub struct PlayStationPort<SPI, CS> { /* fields omitted */ }
The main event! Create a port using an SPI bus and start commanding controllers!
Methods
impl<E, SPI, CS> PlayStationPort<SPI, CS> where
SPI: Transfer<u8, Error = E>,
CS: OutputPin,
[src]
SPI: Transfer<u8, Error = E>,
CS: OutputPin,
pub fn new(spi: SPI, select: Option<CS>) -> Self
[src]
Create a new device to talk over the PlayStation's controller port
pub fn set_multitap_port(&mut self, port: MultitapPort)
[src]
Set the active port on the multi-tap. If no tap is being used, anything
other than A
will fail to return anything. Or so I assume! Setting this
will mean any commands send will be directed towards that port indefinitely.
pub fn send_command(
&mut self,
command: &[u8],
result: &mut [u8]
) -> Result<(), E>
[src]
&mut self,
command: &[u8],
result: &mut [u8]
) -> Result<(), E>
Sends commands to the underlying hardware and provides responses
pub fn enable_pressure(&mut self) -> Result<(), E>
[src]
Configure the controller to set it to DualShock2 mode. This will also enable analog mode on DualShock1 controllers.
pub fn enable_jogcon(&mut self) -> Result<(), E>
[src]
Configure the JogCon for wheel control.
If no digital buttons are pressed in this mode for 60 seconds, the JogCon will go to sleep until buttons are pressed. If no polling is done for 10 seconds, it will drop out of this mode and revert to the standard Controller mode
pub fn control_dualshock(&mut self, little: bool, big: u8) -> Result<(), E>
[src]
Control the vibration motors in the DualShock 1 or 2 controller.
little
- Turn on the little motor (no strength supported)big
- Strength of the big right motor
pub fn control_jogcon(
&mut self,
control: JogControl,
strength: u8
) -> Result<(), E>
[src]
&mut self,
control: JogControl,
strength: u8
) -> Result<(), E>
Control the JogCon's jogwheel.
strength
- A value between 0 and 15. Any higher will wrap around.
pub fn read_config(&mut self) -> Result<ControllerConfiguration, E>
[src]
Read various parameters from the controller including its current status.
pub fn read_input(&mut self) -> Result<Device, Error<E>>
[src]
Ask the controller for input states. Different contoller types can be returned.
Trait Implementations
Auto Trait Implementations
impl<SPI, CS> Send for PlayStationPort<SPI, CS> where
CS: Send,
SPI: Send,
CS: Send,
SPI: Send,
impl<SPI, CS> Sync for PlayStationPort<SPI, CS> where
CS: Sync,
SPI: Sync,
CS: Sync,
SPI: Sync,