@@ -14,13 +14,13 @@ pub enum SceCtrlErrorCode {
14
14
}
15
15
16
16
/// Enumeration for the digital controller buttons.
17
- ///
17
+ ///
18
18
/// Notes :
19
- /// > L1/R1/L3/R3 only can bind using :: sceCtrlPeekBufferPositiveExt2 and :: sceCtrlReadBufferPositiveExt2
20
- ///
19
+ /// > L1/R1/L3/R3 only can bind using [ sceCtrlPeekBufferPositiveExt2] and [ sceCtrlReadBufferPositiveExt2]
20
+ ///
21
21
/// > Values bigger than 0x00010000 can be intercepted only with shell privileges
22
- ///
23
- /// > Vita's L Trigger and R Trigger are mapped to L1 and R1 when using :: sceCtrlPeekBufferPositiveExt2 and :: sceCtrlReadBufferPositiveExt2
22
+ ///
23
+ /// > Vita's L Trigger and R Trigger are mapped to L1 and R1 when using [ sceCtrlPeekBufferPositiveExt2] and [ sceCtrlReadBufferPositiveExt2]
24
24
#[ repr( C ) ]
25
25
pub enum SceCtrlButtons {
26
26
/// Select button.
@@ -59,7 +59,7 @@ pub enum SceCtrlButtons {
59
59
SCE_CTRL_SQUARE = 0x00008000 ,
60
60
/// Input not available because intercercepted by another application
61
61
SCE_CTRL_INTERCEPTED = 0x00010000 ,
62
- // SCE_CTRL_PSBUTTON : defined in SceCtrlButtons Implementation
62
+ // SCE_CTRL_PSBUTTON : defined in SceCtrlButtons Implementation
63
63
/// Headphone plugged in.
64
64
SCE_CTRL_HEADPHONE = 0x00080000 ,
65
65
/// Volume up button.
@@ -73,11 +73,11 @@ pub enum SceCtrlButtons {
73
73
/// Implementation for SceCtrlButtons : Fixing missing enum variant
74
74
impl SceCtrlButtons {
75
75
/// L2 button.
76
- pub const SCE_CTRL_L2 : SceCtrlButtons = SceCtrlButtons :: SCE_CTRL_LTRIGGER ;
76
+ pub const SCE_CTRL_L2 : SceCtrlButtons = SceCtrlButtons :: SCE_CTRL_LTRIGGER ;
77
77
/// R2 button.
78
- pub const SCE_CTRL_R2 : SceCtrlButtons = SceCtrlButtons :: SCE_CTRL_RTRIGGER ;
78
+ pub const SCE_CTRL_R2 : SceCtrlButtons = SceCtrlButtons :: SCE_CTRL_RTRIGGER ;
79
79
/// Playstation (Home) button.
80
- pub const SCE_CTRL_PSBUTTON : SceCtrlButtons = SceCtrlButtons :: SCE_CTRL_INTERCEPTED ;
80
+ pub const SCE_CTRL_PSBUTTON : SceCtrlButtons = SceCtrlButtons :: SCE_CTRL_INTERCEPTED ;
81
81
}
82
82
83
83
/// Enumeration for the controller types.
@@ -102,7 +102,7 @@ pub enum SceCtrlPadInputMode {
102
102
SCE_CTRL_MODE_DIGITAL = 0 ,
103
103
/// Digital buttons + Analog support.
104
104
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.
106
106
SCE_CTRL_MODE_ANALOG_WIDE = 2 ,
107
107
}
108
108
@@ -111,7 +111,7 @@ pub enum SceCtrlPadInputMode {
111
111
pub struct SceCtrlData {
112
112
/// The current read frame.
113
113
pub timeStamp : u64 ,
114
- /// Bit mask containing zero or more of :: SceCtrlButtons.
114
+ /// Bit mask containing zero or more of [ SceCtrlButtons] .
115
115
pub buttons : u32 ,
116
116
/// Left analogue stick, X axis.
117
117
pub lx : u8 ,
@@ -149,7 +149,7 @@ pub struct SceCtrlData {
149
149
_reserved : [ u8 ; 4 ] ,
150
150
}
151
151
152
- /// Structure to pass as argument to :: sceCtrlSetRapidFire
152
+ /// Structure to pass as argument to [ sceCtrlSetRapidFire]
153
153
#[ repr( C ) ]
154
154
pub struct SceCtrlRapidFireRule {
155
155
pub Mask : u32 ,
@@ -160,7 +160,7 @@ pub struct SceCtrlRapidFireRule {
160
160
pub Break : u32 ,
161
161
}
162
162
163
- /// Structure to pass as argument to :: sceCtrlSetActuator
163
+ /// Structure to pass as argument to [ sceCtrlSetActuator]
164
164
#[ repr( C ) ]
165
165
pub struct SceCtrlActuator {
166
166
/// Vibration strength of the small motor
@@ -171,220 +171,166 @@ pub struct SceCtrlActuator {
171
171
unk : [ u8 ; 6 ] ,
172
172
}
173
173
174
- /// Structure to pass as argument to :: sceCtrlGetControllerPortInfo
174
+ /// Structure to pass as argument to [ sceCtrlGetControllerPortInfo]
175
175
#[ repr( C ) ]
176
176
pub struct SceCtrlPortInfo {
177
- /// Controller type of each port (See :: SceCtrlExternalInputMode)
177
+ /// Controller type of each port (See [ SceCtrlExternalInputMode] )
178
178
pub port : [ u8 ; 5 ] ,
179
179
/// Unknown
180
180
unk : [ u8 ; 11 ] ,
181
181
}
182
182
183
183
#[ cfg_attr( not( feature = "dox" ) , link( kind = "static" , name = "SceCtrl_stub" ) ) ]
184
184
extern "C" {
185
- /// Set the controller mode.
186
- ///
187
- /// * `mode` - One of :: SceCtrlPadInputMode.
188
- ///
185
+ /// Set the controller mode
186
+ ///
187
+ /// * `mode` - One of [ SceCtrlPadInputMode] .
188
+ ///
189
189
/// Returns he previous mode, < 0 on error.
190
- pub fn sceCtrlSetSamplingMode (
191
- mode : SceCtrlPadInputMode
192
- ) -> i32 ;
190
+ pub fn sceCtrlSetSamplingMode ( mode : SceCtrlPadInputMode ) -> i32 ;
193
191
194
- /// Set the controller extend mode.
192
+ /// Set the controller extend mode
193
+ ///
194
+ /// * `mode` - One of [SceCtrlPadInputMode].
195
195
///
196
- /// * `mode` - One of ::SceCtrlPadInputMode.
197
- ///
198
196
/// Returns the previous mode, < 0 on error.
199
- pub fn sceCtrlSetSamplingModeExt (
200
- mode : SceCtrlPadInputMode
201
- ) -> i32 ;
197
+ pub fn sceCtrlSetSamplingModeExt ( mode : SceCtrlPadInputMode ) -> i32 ;
202
198
203
- /// Get the current controller mode.
199
+ /// Get the current controller mode
200
+ ///
201
+ /// * `pMode` (out) - Return value, see [SceCtrlPadInputMode].
204
202
///
205
- /// * `pMode` (out) - Return value, see ::SceCtrlPadInputMode.
206
- ///
207
203
/// Returns the previous mode, < 0 on error.
208
- pub fn sceCtrlGetSamplingMode (
209
- pMode : * mut SceCtrlPadInputMode
210
- ) -> i32 ;
204
+ pub fn sceCtrlGetSamplingMode ( pMode : * mut SceCtrlPadInputMode ) -> i32 ;
211
205
212
- /// Get the controller state information (polling, positive logic).
206
+ /// Get the controller state information (polling, positive logic)
213
207
///
214
208
/// * `port` - use 0.
215
- /// * `*pad_data` (out) - see :: SceCtrlData.
209
+ /// * `*pad_data` (out) - see [ SceCtrlData] .
216
210
/// * `count` - Buffers count. Up to 64 buffers can be requested.
217
- ///
211
+ ///
218
212
/// Returns buffers count, between 1 and 'count'. < 0 on error.
219
- pub fn sceCtrlPeekBufferPositive (
220
- port : i32 ,
221
- pad_data : * mut SceCtrlData ,
222
- count : i32
223
- ) -> i32 ;
213
+ pub fn sceCtrlPeekBufferPositive ( port : i32 , pad_data : * mut SceCtrlData , count : i32 ) -> i32 ;
224
214
225
- /// Get the controller state information (polling, positive logic).
215
+ /// Get the controller state information (polling, positive logic)
216
+ ///
217
+ /// This function will bind L/R trigger value to L1/R1 instead of LTRIGGER/RTRIGGER.
226
218
///
227
- /// This function will bind L/R trigger value to L1/R1 instead of LTRIGGER/RTRIGGER
228
- ///
229
219
/// * `port` - use 0.
230
- /// * `*pad_data` (out) - see :: SceCtrlData.
220
+ /// * `*pad_data` (out) - see [ SceCtrlData] .
231
221
/// * `count` - Buffers count. Up to 64 buffers can be requested.
232
- ///
222
+ ///
233
223
/// Returns buffers count, between 1 and 'count'. < 0 on error.
234
- pub fn sceCtrlPeekBufferPositiveExt2 (
235
- port : i32 ,
236
- pad_data : * mut SceCtrlData ,
237
- count : i32
238
- ) -> i32 ;
224
+ pub fn sceCtrlPeekBufferPositiveExt2 ( port : i32 , pad_data : * mut SceCtrlData , count : i32 ) -> i32 ;
239
225
240
- /// Get the controller state information (polling, negative logic).
241
- ///
226
+ /// Get the controller state information (polling, negative logic)
227
+ ///
242
228
/// * `port` - use 0.
243
- /// * `*pad_data` (out) - see :: SceCtrlData.
229
+ /// * `*pad_data` (out) - see [ SceCtrlData] .
244
230
/// * `count` - Buffers count. Up to 64 buffers can be requested.
245
- ///
231
+ ///
246
232
/// Returns buffers count, between 1 and 'count'. < 0 on error.
247
- pub fn sceCtrlPeekBufferNegative (
248
- port : i32 ,
249
- pad_data : * mut SceCtrlData ,
250
- count : i32
251
- ) -> i32 ;
233
+ pub fn sceCtrlPeekBufferNegative ( port : i32 , pad_data : * mut SceCtrlData , count : i32 ) -> i32 ;
252
234
253
- /// Get the controller state information (blocking, positive logic).
254
- ///
235
+ /// Get the controller state information (blocking, positive logic)
236
+ ///
255
237
/// * `port` - use 0.
256
- /// * `*pad_data` (out) - see :: SceCtrlData.
238
+ /// * `*pad_data` (out) - see [ SceCtrlData] .
257
239
/// * `count` - Buffers count. Up to 64 buffers can be requested.
258
- ///
240
+ ///
259
241
/// Returns buffers count, between 1 and 'count'. < 0 on error.
260
- pub fn sceCtrlReadBufferPositive (
261
- port : i32 ,
262
- pad_data : * mut SceCtrlData ,
263
- count : i32
264
- ) -> i32 ;
242
+ pub fn sceCtrlReadBufferPositive ( port : i32 , pad_data : * mut SceCtrlData , count : i32 ) -> i32 ;
265
243
266
- /// Get the controller extended state information (blocking, positive logic).
244
+ /// Get the controller extended state information (blocking, positive logic)
245
+ ///
246
+ /// This function will bind L/R trigger value to L1/R1 instead of LTRIGGER/RTRIGGER.
267
247
///
268
- /// This function will bind L/R trigger value to L1/R1 instead of LTRIGGER/RTRIGGER
269
- ///
270
248
/// * `port` - use 0.
271
- /// * `*pad_data` (out) - see :: SceCtrlData.
249
+ /// * `*pad_data` (out) - see [ SceCtrlData] .
272
250
/// * `count` - Buffers count. Up to 64 buffers can be requested.
273
- ///
251
+ ///
274
252
/// Returns buffers count, between 1 and 'count'. < 0 on error.
275
- pub fn sceCtrlReadBufferPositiveExt2 (
276
- port : i32 ,
277
- pad_data : * mut SceCtrlData ,
278
- count : i32
279
- ) -> i32 ;
253
+ pub fn sceCtrlReadBufferPositiveExt2 ( port : i32 , pad_data : * mut SceCtrlData , count : i32 ) -> i32 ;
280
254
281
- /// Get the controller state information (blocking, negative logic).
282
- ///
255
+ /// Get the controller state information (blocking, negative logic)
256
+ ///
283
257
/// * `port` - use 0.
284
- /// * `*pad_data` (out) - see :: SceCtrlData.
258
+ /// * `*pad_data` (out) - see [ SceCtrlData] .
285
259
/// * `count` - Buffers count. Up to 64 buffers can be requested.
286
- ///
260
+ ///
287
261
/// Returns buffers count, between 1 and 'count'. < 0 on error.
288
- pub fn sceCtrlReadBufferNegative (
289
- port : i32 ,
290
- pad_data : * mut SceCtrlData ,
291
- count : i32
292
- ) -> i32 ;
262
+ pub fn sceCtrlReadBufferNegative ( port : i32 , pad_data : * mut SceCtrlData , count : i32 ) -> i32 ;
293
263
294
- /// Set rules for button rapid fire.
295
- ///
264
+ /// Set rules for button rapid fire
265
+ ///
296
266
/// * `port` - use 0.
297
- /// * `idx` - rule index between 0-15
298
- /// * `pRule` - structure :: SceCtrlRapidFireRule.
299
- ///
267
+ /// * `idx` - rule index between 0-15.
268
+ /// * `pRule` - structure [ SceCtrlRapidFireRule] .
269
+ ///
300
270
/// Returns 0 on success, < 0 on error.
301
- pub fn sceCtrlSetRapidFire (
302
- port : i32 ,
303
- idx : i32 ,
304
- pRule : * const SceCtrlRapidFireRule
305
- ) ;
271
+ pub fn sceCtrlSetRapidFire ( port : i32 , idx : i32 , pRule : * const SceCtrlRapidFireRule ) ;
306
272
307
- /// Clear rules for button rapid fire.
308
- ///
273
+ /// Clear rules for button rapid fire
274
+ ///
309
275
/// * `port` - use 0.
310
- /// * `idx` - rule index between 0-15
311
- ///
276
+ /// * `idx` - rule index between 0-15.
277
+ ///
312
278
/// Returns 0 on success, < 0 on error.
313
- pub fn sceCtrlClearRapidFire (
314
- port : i32 ,
315
- idx : i32
316
- ) -> i32 ;
279
+ pub fn sceCtrlClearRapidFire ( port : i32 , idx : i32 ) -> i32 ;
317
280
318
- /// Control the actuator (vibrate) on paired controllers.
319
- ///
281
+ /// Control the actuator (vibrate) on paired controllers
282
+ ///
320
283
/// * `port` - use 1 for the first paired controller, etc.
321
- /// * `state` - see :: SceCtrlActuator
322
- ///
284
+ /// * `state` - see [ SceCtrlActuator].
285
+ ///
323
286
/// Returns 0 on success, < 0 on error.
324
- pub fn sceCtrlSetActuator (
325
- port : i32 ,
326
- pState : * const SceCtrlActuator
327
- ) -> i32 ;
287
+ pub fn sceCtrlSetActuator ( port : i32 , pState : * const SceCtrlActuator ) -> i32 ;
328
288
329
- /// Control the light bar on paired controllers.
330
- ///
289
+ /// Control the light bar on paired controllers
290
+ ///
331
291
/// * `port` - use 1 for the first paired controller, etc.
332
- /// * `r` - red intensity
333
- /// * `g` - green intensity
334
- /// * `b` - blue intensity
335
- ///
292
+ /// * `r` - red intensity.
293
+ /// * `g` - green intensity.
294
+ /// * `b` - blue intensity.
295
+ ///
336
296
/// Returns 0 on success, < 0 on error.
337
- pub fn sceCtrlSetLightBar (
338
- port : i32 ,
339
- r : SceUInt8 ,
340
- g : SceUInt8 ,
341
- b : SceUInt8
342
- ) -> i32 ;
297
+ pub fn sceCtrlSetLightBar ( port : i32 , r : SceUInt8 , g : SceUInt8 , b : SceUInt8 ) -> i32 ;
343
298
344
299
/// Get controller port information.
345
- ///
346
- /// * `info` (out) - see :: SceCtrlPortInfo
347
- ///
300
+ ///
301
+ /// * `info` (out) - see [ SceCtrlPortInfo].
302
+ ///
348
303
/// Returns 0 on success, < 0 on error.
349
- pub fn sceCtrlGetControllerPortInfo (
350
- info : * mut SceCtrlPortInfo
351
- ) -> i32 ;
304
+ pub fn sceCtrlGetControllerPortInfo ( info : * mut SceCtrlPortInfo ) -> i32 ;
352
305
353
- /// Get controller battery information.
354
- ///
306
+ /// Get controller battery information
307
+ ///
355
308
/// * `port` - use 1 for the first paired controller, etc.
356
- /// * `batt` (out) - battery level, between 0-5, 0xEE charging, 0xEF charged
357
- ///
309
+ /// * `batt` (out) - battery level, between 0-5, 0xEE charging, 0xEF charged.
310
+ ///
358
311
/// Returns 0 on success, < 0 on error.
359
- pub fn sceCtrlGetBatteryInfo (
360
- port : i32 ,
361
- batt : * mut SceUInt8
362
- ) -> i32 ;
312
+ pub fn sceCtrlGetBatteryInfo ( port : i32 , batt : * mut SceUInt8 ) -> i32 ;
363
313
364
- /// Sets intercept.
365
- ///
366
- /// If true, allows the current thread to intercept controls. The use case
367
- /// might be, for example, a game plugin that wishes to capture input without
368
- /// having the input sent to the game thread.
369
- ///
370
- /// * `intercept` - Boolean value
371
- ///
314
+ /// Sets intercept
315
+ ///
316
+ /// If true, allows the current thread to intercept controls.
317
+ /// The use case might be, for example, a game plugin that wishes to
318
+ /// capture input without having the input sent to the game thread.
319
+ ///
320
+ /// * `intercept` - Boolean value.
321
+ ///
372
322
/// Returns 0 on success, < 0 on error.
373
- pub fn sceCtrlSetButtonIntercept (
374
- intercept : i32
375
- ) -> i32 ;
323
+ pub fn sceCtrlSetButtonIntercept ( intercept : i32 ) -> i32 ;
376
324
377
- /// Gets intercept.
378
- ///
379
- /// * `intercept` (out) - Boolean value
325
+ /// Gets intercept
326
+ ///
327
+ /// * `intercept` (out) - Boolean value.
380
328
///
381
329
/// Returns 0 on success, < 0 on error.
382
- pub fn sceCtrlGetButtonIntercept (
383
- intercept : * mut i32
384
- ) -> i32 ;
330
+ pub fn sceCtrlGetButtonIntercept ( intercept : * mut i32 ) -> i32 ;
385
331
386
- /// Check if multi controller is supported.
332
+ /// Check if multi controller is supported
387
333
///
388
- /// Returns 1 if yes, 0 if no
334
+ /// Returns 1 if yes, 0 if no.
389
335
pub fn sceCtrlIsMultiControllerSupported ( ) -> i32 ;
390
336
}
0 commit comments