From 049386ed938d0237116a1da2b1130dee23b2db76 Mon Sep 17 00:00:00 2001 From: Gabriel GRONDIN Date: Wed, 21 Apr 2021 08:26:39 +0200 Subject: [PATCH] Changed: `ctrl` documentation (see message) * Improve doc by adding links to various elements in `ctrl`. --- src/ctrl.rs | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/ctrl.rs b/src/ctrl.rs index 7c3550b..cc3dc33 100644 --- a/src/ctrl.rs +++ b/src/ctrl.rs @@ -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. @@ -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, } @@ -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, @@ -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, @@ -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 @@ -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], @@ -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( @@ -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( @@ -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( @@ -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. @@ -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. @@ -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. @@ -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. @@ -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. @@ -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. @@ -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( @@ -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( @@ -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(