Skip to content
This repository has been archived by the owner on Jun 18, 2023. It is now read-only.

Commit

Permalink
Changed: ctrl documentation (see message)
Browse files Browse the repository at this point in the history
* Improve doc by adding links to various elements in `ctrl`.
  • Loading branch information
GGLinnk committed Apr 21, 2021
1 parent 8bd87f9 commit 049386e
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions src/ctrl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ pub enum SceCtrlErrorCode {
/// Enumeration for the digital controller buttons.
///
/// Notes :
/// > L1/R1/L3/R3 only can bind using ::sceCtrlPeekBufferPositiveExt2 and ::sceCtrlReadBufferPositiveExt2
/// > L1/R1/L3/R3 only can bind using [sceCtrlPeekBufferPositiveExt2](crate::ctrl::sceCtrlPeekBufferPositiveExt2) and [sceCtrlReadBufferPositiveExt2](crate::ctrl::sceCtrlReadBufferPositiveExt2)
///
/// > Values bigger than 0x00010000 can be intercepted only with shell privileges
///
/// > Vita's L Trigger and R Trigger are mapped to L1 and R1 when using ::sceCtrlPeekBufferPositiveExt2 and ::sceCtrlReadBufferPositiveExt2
/// > Vita's L Trigger and R Trigger are mapped to L1 and R1 when using [sceCtrlPeekBufferPositiveExt2](crate::ctrl::sceCtrlPeekBufferPositiveExt2) and [sceCtrlReadBufferPositiveExt2](crate::ctrl::sceCtrlReadBufferPositiveExt2)
#[repr(C)]
pub enum SceCtrlButtons {
/// Select button.
Expand Down Expand Up @@ -102,7 +102,7 @@ pub enum SceCtrlPadInputMode {
SCE_CTRL_MODE_DIGITAL = 0,
/// Digital buttons + Analog support.
SCE_CTRL_MODE_ANALOG = 1,
/// Same as ::SCE_CTRL_MODE_ANALOG, but with larger range for analog sticks.
/// Same as [SCE_CTRL_MODE_ANALOG](crate::ctrl::SceCtrlPadInputMode::SCE_CTRL_MODE_ANALOG), but with larger range for analog sticks.
SCE_CTRL_MODE_ANALOG_WIDE = 2,
}

Expand All @@ -111,7 +111,7 @@ pub enum SceCtrlPadInputMode {
pub struct SceCtrlData {
/// The current read frame.
pub timeStamp: u64,
/// Bit mask containing zero or more of ::SceCtrlButtons.
/// Bit mask containing zero or more of [SceCtrlButtons](crate::ctrl::SceCtrlButtons).
pub buttons: u32,
/// Left analogue stick, X axis.
pub lx: u8,
Expand Down Expand Up @@ -149,7 +149,7 @@ pub struct SceCtrlData {
_reserved: [u8; 4],
}

/// Structure to pass as argument to ::sceCtrlSetRapidFire
/// Structure to pass as argument to [sceCtrlSetRapidFire](crate::ctrl::sceCtrlSetRapidFire)
#[repr(C)]
pub struct SceCtrlRapidFireRule {
pub Mask: u32,
Expand All @@ -160,7 +160,7 @@ pub struct SceCtrlRapidFireRule {
pub Break: u32,
}

/// Structure to pass as argument to ::sceCtrlSetActuator
/// Structure to pass as argument to [sceCtrlSetActuator](crate::ctrl::sceCtrlSetActuator)
#[repr(C)]
pub struct SceCtrlActuator {
/// Vibration strength of the small motor
Expand All @@ -171,10 +171,10 @@ pub struct SceCtrlActuator {
unk: [u8; 6],
}

/// Structure to pass as argument to ::sceCtrlGetControllerPortInfo
/// Structure to pass as argument to [sceCtrlGetControllerPortInfo](crate::ctrl::sceCtrlGetControllerPortInfo)
#[repr(C)]
pub struct SceCtrlPortInfo {
/// Controller type of each port (See ::SceCtrlExternalInputMode)
/// Controller type of each port (See [SceCtrlExternalInputMode](crate::ctrl::SceCtrlExternalInputMode))
pub port: [u8; 5],
/// Unknown
unk: [u8; 11],
Expand All @@ -184,7 +184,7 @@ pub struct SceCtrlPortInfo {
extern "C" {
/// Set the controller mode.
///
/// * `mode` - One of ::SceCtrlPadInputMode.
/// * `mode` - One of [SceCtrlPadInputMode](crate::ctrl::SceCtrlPadInputMode).
///
/// Returns he previous mode, < 0 on error.
pub fn sceCtrlSetSamplingMode(
Expand All @@ -193,7 +193,7 @@ extern "C" {

/// Set the controller extend mode.
///
/// * `mode` - One of ::SceCtrlPadInputMode.
/// * `mode` - One of [SceCtrlPadInputMode](crate::ctrl::SceCtrlPadInputMode).
///
/// Returns the previous mode, < 0 on error.
pub fn sceCtrlSetSamplingModeExt(
Expand All @@ -202,7 +202,7 @@ extern "C" {

/// Get the current controller mode.
///
/// * `pMode` (out) - Return value, see ::SceCtrlPadInputMode.
/// * `pMode` (out) - Return value, see [SceCtrlPadInputMode](crate::ctrl::SceCtrlPadInputMode).
///
/// Returns the previous mode, < 0 on error.
pub fn sceCtrlGetSamplingMode(
Expand All @@ -212,7 +212,7 @@ extern "C" {
/// Get the controller state information (polling, positive logic).
///
/// * `port` - use 0.
/// * `*pad_data` (out) - see ::SceCtrlData.
/// * `*pad_data` (out) - see [SceCtrlData](crate::ctrl::SceCtrlData).
/// * `count` - Buffers count. Up to 64 buffers can be requested.
///
/// Returns buffers count, between 1 and 'count'. < 0 on error.
Expand All @@ -227,7 +227,7 @@ extern "C" {
/// This function will bind L/R trigger value to L1/R1 instead of LTRIGGER/RTRIGGER
///
/// * `port` - use 0.
/// * `*pad_data` (out) - see ::SceCtrlData.
/// * `*pad_data` (out) - see [SceCtrlData](crate::ctrl::SceCtrlData).
/// * `count` - Buffers count. Up to 64 buffers can be requested.
///
/// Returns buffers count, between 1 and 'count'. < 0 on error.
Expand All @@ -240,7 +240,7 @@ extern "C" {
/// Get the controller state information (polling, negative logic).
///
/// * `port` - use 0.
/// * `*pad_data` (out) - see ::SceCtrlData.
/// * `*pad_data` (out) - see [SceCtrlData](crate::ctrl::SceCtrlData).
/// * `count` - Buffers count. Up to 64 buffers can be requested.
///
/// Returns buffers count, between 1 and 'count'. < 0 on error.
Expand All @@ -253,7 +253,7 @@ extern "C" {
/// Get the controller state information (blocking, positive logic).
///
/// * `port` - use 0.
/// * `*pad_data` (out) - see ::SceCtrlData.
/// * `*pad_data` (out) - see [SceCtrlData](crate::ctrl::SceCtrlData).
/// * `count` - Buffers count. Up to 64 buffers can be requested.
///
/// Returns buffers count, between 1 and 'count'. < 0 on error.
Expand All @@ -268,7 +268,7 @@ extern "C" {
/// This function will bind L/R trigger value to L1/R1 instead of LTRIGGER/RTRIGGER
///
/// * `port` - use 0.
/// * `*pad_data` (out) - see ::SceCtrlData.
/// * `*pad_data` (out) - see [SceCtrlData](crate::ctrl::SceCtrlData).
/// * `count` - Buffers count. Up to 64 buffers can be requested.
///
/// Returns buffers count, between 1 and 'count'. < 0 on error.
Expand All @@ -281,7 +281,7 @@ extern "C" {
/// Get the controller state information (blocking, negative logic).
///
/// * `port` - use 0.
/// * `*pad_data` (out) - see ::SceCtrlData.
/// * `*pad_data` (out) - see [SceCtrlData](crate::ctrl::SceCtrlData).
/// * `count` - Buffers count. Up to 64 buffers can be requested.
///
/// Returns buffers count, between 1 and 'count'. < 0 on error.
Expand All @@ -295,7 +295,7 @@ extern "C" {
///
/// * `port` - use 0.
/// * `idx` - rule index between 0-15
/// * `pRule` - structure ::SceCtrlRapidFireRule.
/// * `pRule` - structure [SceCtrlRapidFireRule](crate::ctrl::SceCtrlRapidFireRule).
///
/// Returns 0 on success, < 0 on error.
pub fn sceCtrlSetRapidFire(
Expand All @@ -318,7 +318,7 @@ extern "C" {
/// Control the actuator (vibrate) on paired controllers.
///
/// * `port` - use 1 for the first paired controller, etc.
/// * `state` - see ::SceCtrlActuator
/// * `state` - see [SceCtrlActuator](crate::ctrl::SceCtrlActuator)
///
/// Returns 0 on success, < 0 on error.
pub fn sceCtrlSetActuator(
Expand All @@ -343,7 +343,7 @@ extern "C" {

/// Get controller port information.
///
/// * `info` (out) - see ::SceCtrlPortInfo
/// * `info` (out) - see [SceCtrlPortInfo](crate::ctrl::SceCtrlPortInfo)
///
/// Returns 0 on success, < 0 on error.
pub fn sceCtrlGetControllerPortInfo(
Expand Down

0 comments on commit 049386e

Please sign in to comment.