Skip to main content

psp/sys/
usb.rs

1use crate::sys::SceUid;
2use core::ffi::c_void;
3
4/// For use with `sceUsbActivate` and `sceUsbDeactivate`.
5pub const USB_CAM_PID: i32 = 0x282;
6
7pub const USB_BUS_DRIVER_NAME: &str = "USBBusDriver";
8pub const USB_CAM_DRIVER_NAME: &str = "USBCamDriver";
9pub const USB_CAM_MIC_DRIVER_NAME: &str = "USBCamMicDriver";
10pub const USB_STOR_DRIVER_NAME: &str = "USBStor_Driver";
11
12bitflags::bitflags! {
13    #[repr(transparent)]
14    pub struct UsbState: i32 {
15        const ACTIVATED = 0x200;
16        const CONNECTED = 0x020;
17        const ESTABLISHED = 0x002;
18    }
19}
20
21psp_extern! {
22    #![name = "sceUsb"]
23    #![flags = 0x4001]
24    #![version = (0x00, 0x00)]
25
26    #[psp(0xAE5DE6AF)]
27    /// Start a USB driver.
28    ///
29    /// # Parameters
30    ///
31    /// - `driver_name`: name of the USB driver to start. You probably want to
32    ///   use `USB_BUS_DRIVER_NAME`. Other driver name constants are also
33    ///   available for the camera.
34    /// - `size`: Size of arguments to pass to USB driver start
35    /// - `args`: Arguments to pass to USB driver start
36    ///
37    /// # Return Value
38    ///
39    /// 0 on success
40    pub fn sceUsbStart(
41        driver_name: *const u8,
42        size: i32,
43        args: *mut c_void,
44    ) -> i32;
45
46    #[psp(0xC2464FA0)]
47    /// Stop a USB driver.
48    ///
49    /// # Parameters
50    ///
51    /// - `driver_name`: name of the USB driver to stop
52    /// - `size`: Size of arguments to pass to USB driver start
53    /// - `args`: Arguments to pass to USB driver start
54    ///
55    /// # Return Value
56    ///
57    /// 0 on success
58    pub fn sceUsbStop(
59        driver_name: *const u8,
60        size: i32,
61        args: *mut c_void,
62    ) -> i32;
63
64    #[psp(0x586DB82C)]
65    /// Activate a USB driver.
66    ///
67    /// # Parameters
68    ///
69    /// - `pid`: Product ID for the default USB Driver. An example is the
70    ///   constant `USB_CAM_PID`.
71    ///
72    /// # Return Value
73    ///
74    /// 0 on success
75    pub fn sceUsbActivate(pid: u32) -> i32;
76
77    #[psp(0xC572A9C8)]
78    /// Deactivate USB driver.
79    ///
80    /// # Parameters
81    ///
82    /// - `pid`: Product ID for the default USB driver
83    ///
84    /// # Return Value
85    ///
86    /// 0 on success
87    pub fn sceUsbDeactivate(pid: u32) -> i32;
88
89    #[psp(0xC21645A4)]
90    /// Get USB state
91    ///
92    /// # Return Value
93    ///
94    /// USB `State`.
95    pub fn sceUsbGetState() -> UsbState;
96
97    #[psp(0x112CC951)]
98    /// Get state of a specific USB driver
99    ///
100    /// # Parameters
101    ///
102    /// - `driver_name`: name of USB driver to get status from
103    ///
104    /// # Return Value
105    ///
106    /// 1 if the driver has been started, 2 if it is stopped
107    pub fn sceUsbGetDrvState(driver_name: *const u8) -> i32;
108}
109
110/// Structure for `sceUsbCamSetupStill`
111#[repr(C)]
112#[derive(Debug, Copy, Clone)]
113pub struct UsbCamSetupStillParam {
114    /// Size of the `UsbCamSetupStillParam` structure.
115    pub size: i32,
116    /// Resolution.
117    pub resolution: UsbCamResolution,
118    /// Size of the jpeg image.
119    pub jpeg_size: i32,
120    /// Reverse effect to apply. Zero or more of `UsbCamReverseFlags`.
121    pub reverse_flags: UsbCamReverseFlags,
122    /// Delay to apply to take the picture.
123    pub delay: UsbCamDelay,
124    /// JPEG compression level, a value from 1-63.
125    ///
126    /// 1 -> less compression, better quality; 63 -> max compression, worse quality.
127    pub comp_level: i32,
128}
129
130/// Structure for `sceUsbCamSetupStillEx`
131#[repr(C)]
132#[derive(Debug, Copy, Clone)]
133pub struct UsbCamSetupStillExParam {
134    /// Size of the `UsbCamSetupStillExParam` structure.
135    pub size: i32,
136    /// Unknown, set it to 9 at the moment.
137    pub unk: u32,
138    /// Resolution.
139    pub resolution: UsbCamResolutionEx,
140    /// Size of the jpeg image.
141    pub jpeg_size: i32,
142    /// JPEG compression level, a value from 1-63.
143    ///
144    /// 1 -> less compression, better quality; 63 -> max compression, worse quality.
145    pub comp_level: i32,
146    /// Unknown, set it to 0 at the moment.
147    pub unk2: u32,
148    /// Unknown, set it to 1 at the moment.
149    pub unk3: u32,
150    /// Flag that indicates whether to flip the image.
151    pub flip: i32,
152    /// Flag that indicates whether to mirror the image.
153    pub mirror: i32,
154    /// Delay to apply to take the picture.
155    pub delay: UsbCamDelay,
156    /// Unknown, set it to 0 at the moment.
157    pub unk4: [u32; 5usize],
158}
159
160#[repr(C)]
161#[derive(Debug, Copy, Clone)]
162pub struct UsbCamSetupVideoParam {
163    /// Size of the `UsbCamSetupVideoParam` structure.
164    pub size: i32,
165    /// Resolution.
166    pub resolution: UsbCamResolution,
167    /// Framerate.
168    pub framerate: UsbCamFrameRate,
169    /// White balance.
170    pub white_balance: UsbCamWb,
171    /// Saturation (0-255).
172    pub saturation: i32,
173    /// Brightness (0-255).
174    pub brightness: i32,
175    /// Contrast (0-255).
176    pub contrast: i32,
177    /// Sharpness (0-255).
178    pub sharpness: i32,
179    /// Effect mode.
180    pub effect_mode: UsbCamEffectMode,
181    /// Size of jpeg video frame.
182    pub frame_size: i32,
183    /// Unknown. Set it to 0 at the moment.
184    pub unk: u32,
185    /// Exposure value.
186    pub evl_evel: UsbCamEvLevel,
187}
188
189#[repr(C)]
190#[derive(Debug, Copy, Clone)]
191pub struct UsbCamSetupVideoExParam {
192    /// Size of the `UsbCamSetupVideoParam` structure
193    pub size: i32,
194    pub unk: u32,
195    /// Resolution.
196    pub resolution: UsbCamResolutionEx,
197    /// Framerate.
198    pub framerate: UsbCamFrameRate,
199    /// Unknown. Set it to 2 at the moment
200    pub unk2: u32,
201    /// Unknown. Set it to 3 at the moment
202    pub unk3: u32,
203    /// White balance.
204    pub white_balance: UsbCamWb,
205    /// Saturation (0-255)
206    pub saturation: i32,
207    /// Brightness (0-255)
208    pub brightness: i32,
209    /// Contrast (0-255)
210    pub contrast: i32,
211    /// Sharpness (0-255)
212    pub sharpness: i32,
213    /// Unknown. Set it to 0 at the moment
214    pub unk4: u32,
215    /// Unknown. Set it to 1 at the moment
216    pub unk5: u32,
217    /// Unknown. Set it to 0 at the moment
218    pub unk6: [u32; 3usize],
219    /// Effect mode.
220    pub effect_mode: UsbCamEffectMode,
221    /// Unknown. Set it to 1 at the moment
222    pub unk7: u32,
223    /// Unknown. Set it to 10 at the moment
224    pub unk8: u32,
225    /// Unknown. Set it to 2 at the moment
226    pub unk9: u32,
227    /// Unknown. Set it to 500 at the moment
228    pub unk10: u32,
229    /// Unknown. Set it to 1000 at the moment
230    pub unk11: u32,
231    /// Size of jpeg video frame
232    pub frame_size: i32,
233    /// Unknown. Set it to 0 at the moment
234    pub unk12: u32,
235    /// Exposure value.
236    pub ev_level: UsbCamEvLevel,
237}
238
239/// Resolutions for `sceUsbCamSetupStill` & `sceUsbCamSetupVideo`
240///
241/// DO NOT use on `sceUsbCamSetupStillEx` & `sceUsbCamSetupVideoEx`
242#[repr(i32)]
243#[derive(Copy, Clone, Debug)]
244pub enum UsbCamResolution {
245    Px160_120 = 0,
246    Px176_144 = 1,
247    Px320_240 = 2,
248    Px352_288 = 3,
249    Px640_480 = 4,
250    Px1024_768 = 5,
251    Px1280_960 = 6,
252    Px480_272 = 7,
253    Px360_272 = 8,
254}
255
256/// Resolutions for `sceUsbCamSetupStillEx` & `sceUsbCamSetupVideoEx`
257///
258/// DO NOT use on `sceUsbCamSetupStill` & `sceUsbCamSetupVideo`
259#[derive(Copy, Clone, Debug)]
260#[repr(i32)]
261pub enum UsbCamResolutionEx {
262    Px160_120 = 0,
263    Px176_144 = 1,
264    Px320_240 = 2,
265    Px352_288 = 3,
266    Px360_272 = 4,
267    Px480_272 = 5,
268    Px640_480 = 6,
269    Px1024_768 = 7,
270    Px1280_960 = 8,
271}
272
273bitflags::bitflags! {
274    /// Flags for reverse effects.
275    #[repr(transparent)]
276    #[derive(Copy, Clone, Debug)]
277    pub struct UsbCamReverseFlags: i32 {
278        const FLIP = 1;
279        const MIRROR = 0x100;
280    }
281}
282
283/// Delay to take pictures
284#[repr(i32)]
285#[derive(Copy, Clone, Debug)]
286pub enum UsbCamDelay {
287    NoDelay = 0,
288    Delay10Sec = 1,
289    Delay20Sec = 2,
290    Delay30Sec = 3,
291}
292
293/// Usbcam framerates
294#[repr(i32)]
295#[derive(Copy, Clone, Debug)]
296pub enum UsbCamFrameRate {
297    /// 3.75 FPS
298    Fps3_75 = 0,
299    /// 5 FPS
300    Fps5 = 1,
301    /// 7.5 FPS
302    Fps7_5 = 2,
303    /// 10 FPS
304    Fps10 = 3,
305    /// 15 FPS
306    Fps15 = 4,
307    /// 20 FPS
308    Fps20 = 5,
309    /// 30 FPS
310    Fps30 = 6,
311    /// 60 FPS
312    Fps60 = 7,
313}
314
315/// White balance values
316#[repr(i32)]
317#[derive(Copy, Clone, Debug)]
318pub enum UsbCamWb {
319    Auto = 0,
320    Daylight = 1,
321    Fluorescent = 2,
322    Incadescent = 3,
323}
324
325/// Effect modes
326#[repr(i32)]
327#[derive(Copy, Clone, Debug)]
328pub enum UsbCamEffectMode {
329    Normal = 0,
330    Negative = 1,
331    Blackwhite = 2,
332    Sepia = 3,
333    Blue = 4,
334    Red = 5,
335    Green = 6,
336}
337
338/// Exposure levels
339#[repr(i32)]
340#[derive(Copy, Clone, Debug)]
341pub enum UsbCamEvLevel {
342    /// +2.0
343    Pos2_0 = 0,
344    /// +1.7
345    Pos1_7 = 1,
346    /// +1.5
347    Pos1_5 = 2,
348    /// +1.3
349    Pos1_3 = 3,
350    /// +1.0
351    Pos1_0 = 4,
352    /// +0.7
353    Pos0_7 = 5,
354    /// +0.5
355    Pos0_5 = 6,
356    /// +0.3
357    Pos0_3 = 7,
358    /// 0.0
359    Zero = 8,
360    /// -0.3
361    Neg0_3,
362    /// -0.5
363    Neg0_5,
364    /// -0.7
365    Neg0_7,
366    /// -1.0
367    Neg1_0,
368    /// -1.3
369    Neg1_3,
370    /// -1.5
371    Neg1_5,
372    /// -1.7
373    Neg1_7,
374    /// -2.0
375    Neg2_0,
376}
377
378psp_extern! {
379    #![name = "sceUsbCam"]
380    #![flags = 0x4009]
381    #![version = (0x00, 0x00)]
382
383    #[psp(0x3F0CF289)]
384    /// Setups the parameters to take a still image.
385    ///
386    /// # Parameters
387    ///
388    /// - `param`: pointer to a `UsbCamSetupStillParam`
389    ///
390    /// # Return Value
391    ///
392    /// 0 on success, < 0 on error
393    pub fn sceUsbCamSetupStill(param: *mut UsbCamSetupStillParam) -> i32;
394
395    #[psp(0x0A41A298)]
396    /// Setups the parameters to take a still image (with more options)
397    ///
398    /// # Parameters
399    ///
400    /// - `param`: pointer to a `UsbCamSetupStillExParam`
401    ///
402    /// # Return Value
403    ///
404    /// 0 on success, < 0 on error
405    pub fn sceUsbCamSetupStillEx(param: *mut UsbCamSetupStillExParam) -> i32;
406
407    #[psp(0x61BE5CAC)]
408    /// Gets a still image. The function doesn't return until the image
409    /// has been acquired.
410    ///
411    /// # Parameters
412    ///
413    /// - `buf`: The buffer that receives the image jpeg data
414    /// - `size`: The size of the buffer.
415    ///
416    /// # Return Value
417    ///
418    /// size of acquired image on success, < 0 on error
419    pub fn sceUsbCamStillInputBlocking(buf: *mut u8, size: usize) -> i32;
420
421    #[psp(0xFB0A6C5D)]
422    /// Gets a still image.
423    ///
424    /// The function returns inmediately, and the completion has to be handled
425    /// by calling `sceUsbCamStillWaitInputEnd` or
426    /// `sceUsbCamStillPollInputEnd`.
427    ///
428    /// # Parameters
429    ///
430    /// - `buf`: The buffer that receives the image jpeg data
431    /// - `size`: The size of the buffer.
432    ///
433    /// # Return Value
434    ///
435    /// 0 on success, < 0 on error
436    pub fn sceUsbCamStillInput(buf: *mut u8, size: usize) -> i32;
437
438    #[psp(0x7563AFA1)]
439    /// Waits untils still input has been finished.
440    ///
441    /// # Return Value
442    ///
443    /// the size of the acquired image on success, < 0 on error
444    pub fn sceUsbCamStillWaitInputEnd() -> i32;
445
446    #[psp(0x1A46CFE7)]
447    /// Polls the status of still input completion.
448    ///
449    /// # Return Value
450    ///
451    /// the size of the acquired image if still input has ended, 0 if the input
452    /// has not ended, < 0 on error.
453    pub fn sceUsbCamStillPollInputEnd() -> i32;
454
455    #[psp(0xA720937C)]
456    /// Cancels the still input.
457    ///
458    /// # Return Value
459    ///
460    /// 0 on success, < 0 on error
461    pub fn sceUsbCamStillCancelInput() -> i32;
462
463    #[psp(0xE5959C36)]
464    /// Gets the size of the acquired still image.
465    ///
466    /// # Return Value
467    ///
468    /// the size of the acquired image on success, < 0 on error
469    pub fn sceUsbCamStillGetInputLength() -> i32;
470
471    #[psp(0x17F7B2FB)]
472    /// Set ups the parameters for video capture.
473    ///
474    /// # Parameters
475    ///
476    /// - `param`: Pointer to a `UsbCamSetupVideoParam` structure.
477    /// - `work_area`: Pointer to a buffer used as work area by the driver.
478    /// - `work_area_size`: Size of the work area.
479    ///
480    /// # Return Value
481    ///
482    /// 0 on success, < 0 on error
483    pub fn sceUsbCamSetupVideo(
484        param: *mut UsbCamSetupVideoParam,
485        work_area: *mut c_void,
486        work_area_size: i32,
487    ) -> i32;
488
489    #[psp(0xCFE9E999)]
490    /// Set ups the parameters for video capture (with more options)
491    ///
492    /// # Parameters
493    ///
494    /// - `param`: Pointer to a `UsbCamSetupVideoExParam` structure.
495    /// - `work_area`: Pointer to a buffer used as work area by the driver.
496    /// - `work_area_size`: Size of the work area.
497    ///
498    /// # Return Value
499    ///
500    /// 0 on success, < 0 on error
501    pub fn sceUsbCamSetupVideoEx(
502        param: *mut UsbCamSetupVideoExParam,
503        work_area: *mut c_void,
504        work_area_size: i32,
505    ) -> i32;
506
507    #[psp(0x574A8C3F)]
508    /// Starts video input from the camera.
509    ///
510    /// # Return Value
511    ///
512    /// 0 on success, < 0 on error
513    pub fn sceUsbCamStartVideo() -> i32;
514
515    #[psp(0x6CF32CB9)]
516    /// Stops video input from the camera.
517    ///
518    /// # Return Value
519    ///
520    /// 0 on success, < 0 on error
521    pub fn sceUsbCamStopVideo() -> i32;
522
523    #[psp(0x7DAC0C71)]
524    /// Reads a video frame. The function doesn't return until the frame
525    /// has been acquired.
526    ///
527    /// # Parameters
528    ///
529    /// - `buf`: The buffer that receives the frame jpeg data
530    /// - `size`: The size of the buffer.
531    ///
532    /// # Return Value
533    ///
534    /// size of acquired frame on success, < 0 on error
535    pub fn sceUsbCamReadVideoFrameBlocking(buf: *mut u8, size: usize) -> i32;
536
537    #[psp(0x99D86281)]
538    /// Reads a video frame. The function returns inmediately, and
539    /// the completion has to be handled by calling `sceUsbCamWaitReadVideoFrameEnd`
540    /// or `sceUsbCamPollReadVideoFrameEnd`.
541    ///
542    /// # Parameters
543    ///
544    /// - `buf`: The buffer that receives the frame jpeg data
545    /// - `size`: The size of the buffer.
546    ///
547    /// # Return Value
548    ///
549    /// 0 on success, < 0 on error
550    pub fn sceUsbCamReadVideoFrame(buf: *mut u8, size: usize) -> i32;
551
552    #[psp(0xF90B2293)]
553    /// Waits untils the current frame has been read.
554    ///
555    /// # Return Value
556    ///
557    /// the size of the acquired frame on sucess, < 0 on error
558    pub fn sceUsbCamWaitReadVideoFrameEnd() -> i32;
559
560    #[psp(0x41E73E95)]
561    /// Polls the status of video frame read completion.
562    ///
563    /// # Return Value
564    ///
565    /// the size of the acquired frame if it has been read,
566    /// 0 if the frame has not yet been read, < 0 on error.
567    pub fn sceUsbCamPollReadVideoFrameEnd() -> i32;
568
569    #[psp(0xDF9D0C92)]
570    /// Gets the size of the acquired frame.
571    ///
572    /// # Return Value
573    ///
574    /// the size of the acquired frame on success, < 0 on error
575    pub fn sceUsbCamGetReadVideoFrameSize() -> i32;
576
577    #[psp(0x6E205974)]
578    /// Sets the saturation
579    ///
580    /// # Parameters
581    ///
582    /// - `saturation`: The saturation (0-255)
583    ///
584    /// # Return Value
585    ///
586    /// 0 on success, < 0 on error
587    pub fn sceUsbCamSetSaturation(saturation: i32) -> i32;
588
589    #[psp(0x4F3D84D5)]
590    /// Sets the brightness
591    ///
592    /// # Parameters
593    ///
594    /// - `brightness`: The brightness (0-255)
595    ///
596    /// # Return Value
597    ///
598    /// 0 on success, < 0 on error
599    pub fn sceUsbCamSetBrightness(brightness: i32) -> i32;
600
601    #[psp(0x09C26C7E)]
602    /// Sets the contrast
603    ///
604    /// # Parameters
605    ///
606    /// - `contrast`: The contrast (0-255)
607    ///
608    /// # Return Value
609    ///
610    /// 0 on success, < 0 on error
611    pub fn sceUsbCamSetContrast(contrast: i32) -> i32;
612
613    #[psp(0x622F83CC)]
614    /// Sets the sharpness
615    ///
616    /// # Parameters
617    ///
618    /// - `sharpness`: The sharpness (0-255)
619    ///
620    /// # Return Value
621    ///
622    /// 0 on success, < 0 on error
623    pub fn sceUsbCamSetSharpness(sharpness: i32) -> i32;
624
625    #[psp(0xD4876173)]
626    /// Sets the image effect mode
627    ///
628    /// # Parameters
629    ///
630    /// - `effect_mode`: The effect mode, one of `UsbCamEffectMode`
631    ///
632    /// # Return Value
633    ///
634    /// 0 on success, < 0 on error
635    pub fn sceUsbCamSetImageEffectMode(effect_mode: UsbCamEffectMode) -> i32;
636
637    #[psp(0x1D686870)]
638    /// Sets the exposure level
639    ///
640    /// # Parameters
641    ///
642    /// - `exposure_level`: The exposure level, one of `UsbCamEvLevel`
643    ///
644    /// # Return Value
645    ///
646    /// 0 on success, < 0 on error
647    pub fn sceUsbCamSetEvLevel(exposure_level: UsbCamEvLevel) -> i32;
648
649    #[psp(0x951BEDF5)]
650    /// Sets the reverse mode
651    ///
652    /// # Parameters
653    ///
654    /// - `reverse_flags`: The reverse flags, zero or more of `UsbCamReverseFlags`
655    ///
656    /// # Return Value
657    ///
658    /// 0 on success, < 0 on error
659    pub fn sceUsbCamSetReverseMode(reverse_flags: UsbCamReverseFlags) -> i32;
660
661    #[psp(0xC484901F)]
662    /// Sets the zoom.
663    ///
664    /// # Parameters
665    ///
666    /// - `zoom`: The zoom level starting by 10. (10 = 1X, 11 = 1.1X, etc)
667    ///
668    /// @returns 0 on success, < 0 on error
669    pub fn sceUsbCamSetZoom(zoom: i32) -> i32;
670
671    #[psp(0x383E9FA8)]
672    /// Gets the current saturation
673    ///
674    /// # Parameters
675    ///
676    /// - `saturation`: pointer to a variable that receives the current saturation
677    ///
678    /// # Return Value
679    ///
680    /// 0 on success, < 0 on error
681    pub fn sceUsbCamGetSaturation(saturation: *mut i32) -> i32;
682
683    #[psp(0x70F522C5)]
684    /// Gets the current brightness
685    ///
686    /// # Parameters
687    ///
688    /// - `brightness`: pointer to a variable that receives the current brightness
689    ///
690    /// # Return Value
691    ///
692    /// 0 on success, < 0 on error
693    pub fn sceUsbCamGetBrightness(brightness: *mut i32) -> i32;
694
695    #[psp(0xA063A957)]
696    /// Gets the current contrast
697    ///
698    /// # Parameters
699    ///
700    /// - `contrast`: pointer to a variable that receives the current contrast
701    ///
702    /// # Return Value
703    ///
704    /// 0 on success, < 0 on error
705    pub fn sceUsbCamGetContrast(contrast: *mut i32) -> i32;
706
707    #[psp(0xFDB68C23)]
708    /// Gets the current sharpness
709    ///
710    /// # Parameters
711    ///
712    /// - `sharpness`: pointer to a variable that receives the current sharpness
713    ///
714    /// # Return Value
715    ///
716    /// 0 on success, < 0 on error
717    pub fn sceUsbCamGetSharpness(sharpness: *mut i32) -> i32;
718
719    #[psp(0x994471E0)]
720    /// Gets the current image efect mode
721    ///
722    /// # Parameters
723    ///
724    /// - `effect_mode`: pointer to a variable that receives the current effect mode
725    ///
726    /// # Return Value
727    ///
728    /// 0 on success, < 0 on error
729    pub fn sceUsbCamGetImageEffectMode(
730        effect_mode: *mut UsbCamEffectMode,
731    ) -> i32;
732
733    #[psp(0x2BCD50C0)]
734    /// Gets the current exposure level.
735    ///
736    /// # Parameters
737    ///
738    /// - `exposure_level`: pointer to a variable that receives the current exposure level
739    ///
740    /// # Return Value
741    ///
742    /// 0 on success, < 0 on error
743    pub fn sceUsbCamGetEvLevel(exposure_level: *mut UsbCamEvLevel) -> i32;
744
745    #[psp(0xD5279339)]
746    /// Gets the current reverse mode.
747    ///
748    /// # Parameters
749    ///
750    /// - `reverse_flags`: pointer to a variable that receives the current reverse mode flags
751    ///
752    /// # Return Value
753    ///
754    /// 0 on success, < 0 on error
755    pub fn sceUsbCamGetReverseMode(
756        reverse_flags: *mut UsbCamReverseFlags,
757    ) -> i32;
758
759    #[psp(0x9E8AAF8D)]
760    /// Gets the current zoom.
761    ///
762    /// # Parameters
763    ///
764    /// - `zoom`: pointer to a variable that receives the current zoom
765    ///
766    /// # Return Value
767    ///
768    /// 0 on success, < 0 on error
769    pub fn sceUsbCamGetZoom(zoom: *mut i32) -> i32;
770
771    #[psp(0xF93C4669)]
772    /// Sets if the image should be automatically reversed, depending of the position
773    /// of the camera.
774    ///
775    /// # Parameters
776    ///
777    /// - `on`: 1 to set the automatic reversal of the image, 0 to set it off
778    ///
779    /// # Return Value
780    ///
781    /// 0 on success, < 0 on error
782    pub fn sceUsbCamAutoImageReverseSW(on: i32) -> i32;
783
784    #[psp(0x11A1F128)]
785    /// Gets the state of the autoreversal of the image.
786    ///
787    /// # Return Value
788    ///
789    /// 1 if it is set to automatic, 0 otherwise
790    pub fn sceUsbCamGetAutoImageReverseState() -> i32;
791
792    #[psp(0x4C34F553)]
793    /// Gets the direction of the camera lens
794    ///
795    /// # Return Value
796    ///
797    /// 1 if the camera is "looking to you", 0 if the camera
798    /// is "looking to the other side".
799    pub fn sceUsbCamGetLensDirection() -> i32;
800}
801
802psp_extern! {
803    #![name = "sceUsbstorBoot"]
804    #![flags = 0x4009]
805    #![version = (0x00, 0x00)]
806
807    #[psp(0x1F080078)]
808    /// Register an eventFlag to send notifications to.
809    ///
810    /// # Parameters
811    ///
812    /// - `event_flag`: Event flag created with `sceKernelCreateEventFlag`
813    ///
814    /// # Return Value
815    ///
816    /// 0 on success
817    pub fn sceUsbstorBootRegisterNotify(event_flag: SceUid) -> i32;
818
819    #[psp(0xA55C9E16)]
820    /// Unregister a previously registered event flag.
821    ///
822    /// # Parameters
823    ///
824    /// - `event_flag`: event flag created with `sceKernelCreateEventFlag`
825    ///
826    /// # Return Value
827    ///
828    /// 0 on success
829    pub fn sceUsbstorBootUnregisterNotify(event_flag: u32) -> i32;
830
831    #[psp(0xE58818A8)]
832    /// Tell the USBstorBoot driver the size of MS
833    ///
834    /// # Note
835    ///
836    /// I'm not sure if this is the actual size of the media or not as it seems
837    /// to have no bearing on what size windows detects. PSPPET passes 0x800000.
838    ///
839    /// # Parameters
840    ///
841    /// - `size`: capacity of memory stick
842    ///
843    /// # Return Value
844    ///
845    /// 0 on success
846    pub fn sceUsbstorBootSetCapacity(size: u32) -> i32;
847}