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

Commit 049386e

Browse files
committed
Changed: ctrl documentation (see message)
* Improve doc by adding links to various elements in `ctrl`.
1 parent 8bd87f9 commit 049386e

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

src/ctrl.rs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ pub enum SceCtrlErrorCode {
1616
/// Enumeration for the digital controller buttons.
1717
///
1818
/// Notes :
19-
/// > L1/R1/L3/R3 only can bind using ::sceCtrlPeekBufferPositiveExt2 and ::sceCtrlReadBufferPositiveExt2
19+
/// > L1/R1/L3/R3 only can bind using [sceCtrlPeekBufferPositiveExt2](crate::ctrl::sceCtrlPeekBufferPositiveExt2) and [sceCtrlReadBufferPositiveExt2](crate::ctrl::sceCtrlReadBufferPositiveExt2)
2020
///
2121
/// > Values bigger than 0x00010000 can be intercepted only with shell privileges
2222
///
23-
/// > Vita's L Trigger and R Trigger are mapped to L1 and R1 when using ::sceCtrlPeekBufferPositiveExt2 and ::sceCtrlReadBufferPositiveExt2
23+
/// > Vita's L Trigger and R Trigger are mapped to L1 and R1 when using [sceCtrlPeekBufferPositiveExt2](crate::ctrl::sceCtrlPeekBufferPositiveExt2) and [sceCtrlReadBufferPositiveExt2](crate::ctrl::sceCtrlReadBufferPositiveExt2)
2424
#[repr(C)]
2525
pub enum SceCtrlButtons {
2626
/// Select button.
@@ -102,7 +102,7 @@ pub enum SceCtrlPadInputMode {
102102
SCE_CTRL_MODE_DIGITAL = 0,
103103
/// Digital buttons + Analog support.
104104
SCE_CTRL_MODE_ANALOG = 1,
105-
/// Same as ::SCE_CTRL_MODE_ANALOG, but with larger range for analog sticks.
105+
/// Same as [SCE_CTRL_MODE_ANALOG](crate::ctrl::SceCtrlPadInputMode::SCE_CTRL_MODE_ANALOG), but with larger range for analog sticks.
106106
SCE_CTRL_MODE_ANALOG_WIDE = 2,
107107
}
108108

@@ -111,7 +111,7 @@ pub enum SceCtrlPadInputMode {
111111
pub struct SceCtrlData {
112112
/// The current read frame.
113113
pub timeStamp: u64,
114-
/// Bit mask containing zero or more of ::SceCtrlButtons.
114+
/// Bit mask containing zero or more of [SceCtrlButtons](crate::ctrl::SceCtrlButtons).
115115
pub buttons: u32,
116116
/// Left analogue stick, X axis.
117117
pub lx: u8,
@@ -149,7 +149,7 @@ pub struct SceCtrlData {
149149
_reserved: [u8; 4],
150150
}
151151

152-
/// Structure to pass as argument to ::sceCtrlSetRapidFire
152+
/// Structure to pass as argument to [sceCtrlSetRapidFire](crate::ctrl::sceCtrlSetRapidFire)
153153
#[repr(C)]
154154
pub struct SceCtrlRapidFireRule {
155155
pub Mask: u32,
@@ -160,7 +160,7 @@ pub struct SceCtrlRapidFireRule {
160160
pub Break: u32,
161161
}
162162

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

174-
/// Structure to pass as argument to ::sceCtrlGetControllerPortInfo
174+
/// Structure to pass as argument to [sceCtrlGetControllerPortInfo](crate::ctrl::sceCtrlGetControllerPortInfo)
175175
#[repr(C)]
176176
pub struct SceCtrlPortInfo {
177-
/// Controller type of each port (See ::SceCtrlExternalInputMode)
177+
/// Controller type of each port (See [SceCtrlExternalInputMode](crate::ctrl::SceCtrlExternalInputMode))
178178
pub port: [u8; 5],
179179
/// Unknown
180180
unk: [u8; 11],
@@ -184,7 +184,7 @@ pub struct SceCtrlPortInfo {
184184
extern "C" {
185185
/// Set the controller mode.
186186
///
187-
/// * `mode` - One of ::SceCtrlPadInputMode.
187+
/// * `mode` - One of [SceCtrlPadInputMode](crate::ctrl::SceCtrlPadInputMode).
188188
///
189189
/// Returns he previous mode, < 0 on error.
190190
pub fn sceCtrlSetSamplingMode(
@@ -193,7 +193,7 @@ extern "C" {
193193

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

203203
/// Get the current controller mode.
204204
///
205-
/// * `pMode` (out) - Return value, see ::SceCtrlPadInputMode.
205+
/// * `pMode` (out) - Return value, see [SceCtrlPadInputMode](crate::ctrl::SceCtrlPadInputMode).
206206
///
207207
/// Returns the previous mode, < 0 on error.
208208
pub fn sceCtrlGetSamplingMode(
@@ -212,7 +212,7 @@ extern "C" {
212212
/// Get the controller state information (polling, positive logic).
213213
///
214214
/// * `port` - use 0.
215-
/// * `*pad_data` (out) - see ::SceCtrlData.
215+
/// * `*pad_data` (out) - see [SceCtrlData](crate::ctrl::SceCtrlData).
216216
/// * `count` - Buffers count. Up to 64 buffers can be requested.
217217
///
218218
/// Returns buffers count, between 1 and 'count'. < 0 on error.
@@ -227,7 +227,7 @@ extern "C" {
227227
/// This function will bind L/R trigger value to L1/R1 instead of LTRIGGER/RTRIGGER
228228
///
229229
/// * `port` - use 0.
230-
/// * `*pad_data` (out) - see ::SceCtrlData.
230+
/// * `*pad_data` (out) - see [SceCtrlData](crate::ctrl::SceCtrlData).
231231
/// * `count` - Buffers count. Up to 64 buffers can be requested.
232232
///
233233
/// Returns buffers count, between 1 and 'count'. < 0 on error.
@@ -240,7 +240,7 @@ extern "C" {
240240
/// Get the controller state information (polling, negative logic).
241241
///
242242
/// * `port` - use 0.
243-
/// * `*pad_data` (out) - see ::SceCtrlData.
243+
/// * `*pad_data` (out) - see [SceCtrlData](crate::ctrl::SceCtrlData).
244244
/// * `count` - Buffers count. Up to 64 buffers can be requested.
245245
///
246246
/// Returns buffers count, between 1 and 'count'. < 0 on error.
@@ -253,7 +253,7 @@ extern "C" {
253253
/// Get the controller state information (blocking, positive logic).
254254
///
255255
/// * `port` - use 0.
256-
/// * `*pad_data` (out) - see ::SceCtrlData.
256+
/// * `*pad_data` (out) - see [SceCtrlData](crate::ctrl::SceCtrlData).
257257
/// * `count` - Buffers count. Up to 64 buffers can be requested.
258258
///
259259
/// Returns buffers count, between 1 and 'count'. < 0 on error.
@@ -268,7 +268,7 @@ extern "C" {
268268
/// This function will bind L/R trigger value to L1/R1 instead of LTRIGGER/RTRIGGER
269269
///
270270
/// * `port` - use 0.
271-
/// * `*pad_data` (out) - see ::SceCtrlData.
271+
/// * `*pad_data` (out) - see [SceCtrlData](crate::ctrl::SceCtrlData).
272272
/// * `count` - Buffers count. Up to 64 buffers can be requested.
273273
///
274274
/// Returns buffers count, between 1 and 'count'. < 0 on error.
@@ -281,7 +281,7 @@ extern "C" {
281281
/// Get the controller state information (blocking, negative logic).
282282
///
283283
/// * `port` - use 0.
284-
/// * `*pad_data` (out) - see ::SceCtrlData.
284+
/// * `*pad_data` (out) - see [SceCtrlData](crate::ctrl::SceCtrlData).
285285
/// * `count` - Buffers count. Up to 64 buffers can be requested.
286286
///
287287
/// Returns buffers count, between 1 and 'count'. < 0 on error.
@@ -295,7 +295,7 @@ extern "C" {
295295
///
296296
/// * `port` - use 0.
297297
/// * `idx` - rule index between 0-15
298-
/// * `pRule` - structure ::SceCtrlRapidFireRule.
298+
/// * `pRule` - structure [SceCtrlRapidFireRule](crate::ctrl::SceCtrlRapidFireRule).
299299
///
300300
/// Returns 0 on success, < 0 on error.
301301
pub fn sceCtrlSetRapidFire(
@@ -318,7 +318,7 @@ extern "C" {
318318
/// Control the actuator (vibrate) on paired controllers.
319319
///
320320
/// * `port` - use 1 for the first paired controller, etc.
321-
/// * `state` - see ::SceCtrlActuator
321+
/// * `state` - see [SceCtrlActuator](crate::ctrl::SceCtrlActuator)
322322
///
323323
/// Returns 0 on success, < 0 on error.
324324
pub fn sceCtrlSetActuator(
@@ -343,7 +343,7 @@ extern "C" {
343343

344344
/// Get controller port information.
345345
///
346-
/// * `info` (out) - see ::SceCtrlPortInfo
346+
/// * `info` (out) - see [SceCtrlPortInfo](crate::ctrl::SceCtrlPortInfo)
347347
///
348348
/// Returns 0 on success, < 0 on error.
349349
pub fn sceCtrlGetControllerPortInfo(

0 commit comments

Comments
 (0)