vitasdk
Documentation of the vitasdk
hpremote.h
Go to the documentation of this file.
1
6#ifndef _PSP2KERN_HPREMOTE_H_
7#define _PSP2KERN_HPREMOTE_H_
8
9#include <psp2kern/types.h>
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
21
28
43typedef void (*SceHprmConnectCallback)(SceBool headphone_detect,
44 SceBool audio_out_dock_exists, SceBool headphone_exists,
45 SceHprmDeviceState remote_state, SceHprmDeviceState microphone_state,
46 void *argp);
47
108VITASDK_BUILD_ASSERT_EQ(0xAC, SceHprmInternalState); // size is from FW 3.60
109
116
130
140
147
157
168
187
197
212
224
237
238#ifdef __cplusplus
239}
240#endif
241
242#endif /* _PSP2KERN_HPREMOTE_H_ */
#define VITASDK_BUILD_ASSERT_EQ(__size__, __name__)
Definition build_utils.h:13
void * connect_callback_arg
Caller-owned argument passed to the direct connection callback.
Definition hpremote.h:106
SceBool ksceHprmIsMicrophoneExist(void)
Check whether a headset microphone is connected.
SceUInt8 pending_headphone_detect
Latest raw headphone-detect signal awaiting debounce.
Definition hpremote.h:93
SceUID detection_thread_id
Headset-detection worker thread.
Definition hpremote.h:87
SceHprmConnectedDevice
Connected-device bits delivered to callbacks registered with ksceHprmRegisterCallback.
Definition hpremote.h:23
SceBool ksceHprmGetHpDetect(void)
Get the debounced Syscon headphone-detect signal.
SceInt8 microphone_state
One of SceHprmDeviceState.
Definition hpremote.h:104
SceInt8 remote_state
One of SceHprmDeviceState; the FW 3.60 module only sets -1 or 0.
Definition hpremote.h:103
SceHprmConnectCallback connect_callback
Direct connection callback, or NULL.
Definition hpremote.h:105
SceUInt8 pending_interface_connect
Latest raw interface-connect signal awaiting debounce.
Definition hpremote.h:96
int ksceHprmShutdown(void)
Suspend headset probing.
SceInt32 detection_state
Detection state-machine index described above.
Definition hpremote.h:88
SceUInt8 syscon_microphone_connect
Latest Syscon microphone-connect signal, 0 or 1.
Definition hpremote.h:92
int ksceHprmRegisterCallback(SceUID callback_id)
Register a kernel callback UID for connection-state notifications.
SceUInt32 interface_debounce_history
Shift register of recent interface-connect samples.
Definition hpremote.h:99
SceUInt8 headphone_detect
Debounced Syscon headphone-detect signal, 0 or 1.
Definition hpremote.h:91
int ksceHprmUnregisterCallback(SceUID callback_id)
Unregister a kernel callback UID.
void(* SceHprmConnectCallback)(SceBool headphone_detect, SceBool audio_out_dock_exists, SceBool headphone_exists, SceHprmDeviceState remote_state, SceHprmDeviceState microphone_state, void *argp)
Direct connection callback installed by ksceHprmSetConnectCallback.
Definition hpremote.h:43
SceUInt8 reserved1[4]
Set to 0 during initialization and otherwise unused on FW 3.60.
Definition hpremote.h:100
SceUInt8 notification_pending
Whether connection callbacks need to be notified.
Definition hpremote.h:101
SceUID callback_ids[32]
Kernel callback UIDs, or a negative value for an unused slot.
Definition hpremote.h:89
SceBool ksceHprmIsHeadphoneExist(void)
Check whether headphones are connected.
int ksceHprmReset(void)
Request a new headset connection probe.
SceUInt8 interface_connect
Debounced Syscon interface-connect signal, 0 or 1.
Definition hpremote.h:95
SceUInt8 audio_out_dock_exists
Whether the multiconnector is in audio-output mode.
Definition hpremote.h:97
SceHprmDeviceState
Connection state reported for devices that require asynchronous detection.
Definition hpremote.h:16
int ksceHprmGetInternalState(SceHprmInternalState **state)
Get the module's internal state.
SceUInt32 headphone_debounce_history
Shift register of recent headphone-detect samples.
Definition hpremote.h:94
SceUInt8 reserved0
Set to 0 during initialization and otherwise unused on FW 3.60.
Definition hpremote.h:98
SceBool ksceHprmIsAudioOutDockExist(void)
Check whether an audio-output dock is connected to the multiconnector.
SceInt8 headphone_exists
Headphone connection state reported by the module, 0 or 1.
Definition hpremote.h:102
SceUID event_flag_id
Event flag used by the detection state machine.
Definition hpremote.h:86
SceUInt8 hardware_flags
Model-specific headset-detection behavior flags.
Definition hpremote.h:90
int ksceHprmSetConnectCallback(SceHprmConnectCallback callback, void *argp)
Install the direct connection callback.
SceBool ksceHprmIsRemoteExist(void)
Check whether a headset remote is connected.
@ SCE_HPRM_CONNECTED_DEVICE_HEADPHONE
Definition hpremote.h:24
@ SCE_HPRM_CONNECTED_DEVICE_REMOTE
Definition hpremote.h:25
@ SCE_HPRM_CONNECTED_DEVICE_MICROPHONE
Definition hpremote.h:26
@ SCE_HPRM_DEVICE_STATE_PENDING
Detection is still pending.
Definition hpremote.h:17
@ SCE_HPRM_DEVICE_STATE_CONNECTED
The device is connected.
Definition hpremote.h:19
@ SCE_HPRM_DEVICE_STATE_NOT_CONNECTED
The device is not connected.
Definition hpremote.h:18
SceHpremote module state on FW 3.60.
Definition hpremote.h:85
SceLsdbDbBlobCallback callback
Definition lsdb.h:6
int SceBool
Definition types.h:59
int32_t SceInt32
Definition types.h:44
int SceUID
UIDs are used to describe many different kernel objects.
Definition types.h:90
uint32_t SceUInt32
Definition types.h:45
int8_t SceInt8
Definition types.h:35
uint8_t SceUInt8
Definition types.h:36