psp/sys/
hprm.rs

1//! Headphone Remote
2
3bitflags::bitflags! {
4    #[repr(transparent)]
5    pub struct HprmKey: u32 {
6        const PLAY_PAUSE  = 0x1;
7        const FORWARD     = 0x4;
8        const BACK        = 0x8;
9        const VOL_UP      = 0x10;
10        const VOL_DOWN    = 0x20;
11        const HOLD        = 0x80;
12    }
13}
14
15psp_extern! {
16    #![name = "sceHprm"]
17    #![flags = 0x4001]
18    #![version = (0x00, 0x00)]
19
20    #[psp(0x1910B327)]
21    /// Peek at the current being pressed on the remote.
22    ///
23    /// # Parameters
24    ///
25    /// - `key`: Pointer to receive the key bitmap, should be an instance of ::Key
26    ///
27    /// # Return Value
28    ///
29    /// < 0 on error
30    pub fn sceHprmPeekCurrentKey(key: *mut HprmKey) -> i32;
31
32    #[psp(0x2BCEC83E)]
33    /// Peek at the current latch data.
34    ///
35    /// # Parameters
36    ///
37    /// - `latch`: Pointer a to a 4 dword array to contain the latch data.
38    ///
39    /// # Return Value
40    ///
41    /// < 0 on error.
42    pub fn sceHprmPeekLatch(latch: *mut [u32;4]) -> i32;
43
44    #[psp(0x40D2F9F0)]
45    /// Read the current latch data.
46    ///
47    /// # Parameters
48    ///
49    /// - `latch`: Pointer a to a 4 dword array to contain the latch data.
50    ///
51    /// # Return Value
52    ///
53    /// < 0 on error.
54    pub fn sceHprmReadLatch(latch: *mut [u32;4]) -> i32;
55
56    #[psp(0x7E69EDA4)]
57    /// Determines whether the headphones are plugged in.
58    ///
59    /// # Return Value
60    ///
61    /// 1 if the headphones are plugged in, else 0.
62    pub fn sceHprmIsHeadphoneExist() -> i32;
63
64    #[psp(0x208DB1BD)]
65    /// Determines whether the remote is plugged in.
66    ///
67    /// # Return Value
68    ///
69    /// 1 if the remote is plugged in, else 0.
70    pub fn sceHprmIsRemoteExist() -> i32;
71
72    #[psp(0x219C58F1)]
73    /// Determines whether the microphone is plugged in.
74    ///
75    /// # Return Value
76    ///
77    /// 1 if the microphone is plugged in, else 0.
78    pub fn sceHprmIsMicrophoneExist() -> i32;
79}