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]
impl<E, SPI, CS> PlayStationPort<SPI, CS> where
SPI: Transfer<u8, Error = E>,
CS: OutputPin,
pub fn new(spi: SPI, select: Option<CS>) -> Self
[src]
pub fn new(spi: SPI, select: Option<CS>) -> Self
Create a new device to talk over the PlayStation's controller port
pub fn set_multitap_port(&mut self, port: MultitapPort)
[src]
pub fn set_multitap_port(&mut self, port: MultitapPort)
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]
pub fn send_command(
&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]
pub fn enable_pressure(&mut self) -> Result<(), E>
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]
pub fn enable_jogcon(&mut self) -> Result<(), E>
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 read_config(&mut self) -> Result<ControllerConfiguration, E>
[src]
pub fn read_config(&mut self) -> Result<ControllerConfiguration, E>
Read various parameters from the controller including its current status.
pub fn read_raw(
&mut self,
command: Option<&PollCommand>
) -> Result<ControllerData, Error<E>>
[src]
pub fn read_raw(
&mut self,
command: Option<&PollCommand>
) -> Result<ControllerData, Error<E>>
Get the raw data from polling for a controller. You can use this to cooerce the data into
some controller that can't be safely identified by read_input
, but you should rely on that
function if you can.
pub fn read_input(
&mut self,
command: Option<&PollCommand>
) -> Result<Device, Error<E>>
[src]
pub fn read_input(
&mut self,
command: Option<&PollCommand>
) -> Result<Device, Error<E>>
Ask the controller for input states. Different contoller types will be returned automatically
for you. If you'd like to cooerce a controller yourself, use read_raw
.
Auto Trait Implementations
impl<SPI, CS> Send for PlayStationPort<SPI, CS> where
CS: Send,
SPI: Send,
impl<SPI, CS> Send for PlayStationPort<SPI, CS> where
CS: Send,
SPI: Send,
impl<SPI, CS> Sync for PlayStationPort<SPI, CS> where
CS: Sync,
SPI: Sync,
impl<SPI, CS> Sync for PlayStationPort<SPI, CS> where
CS: Sync,
SPI: Sync,