diff options
author | TheOfficialFloW | 2017-01-12 17:55:47 +0100 |
---|---|---|
committer | Sunguk Lee | 2017-01-13 01:55:47 +0900 |
commit | 48c0c2da0b94b7e63677471cbeeaa1006ea6fd2d (patch) | |
tree | 2a2849ebce6c1e3a61bb41051eb11c3881969080 /include/user/udcd.h | |
parent | Add SceMtpIfDriver::SceMtpIf NIDs (diff) | |
download | vds-libraries-48c0c2da0b94b7e63677471cbeeaa1006ea6fd2d.tar.gz |
Added usb nids and headers (#120)
Diffstat (limited to 'include/user/udcd.h')
-rw-r--r-- | include/user/udcd.h | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/include/user/udcd.h b/include/user/udcd.h new file mode 100644 index 0000000..789d717 --- /dev/null +++ b/include/user/udcd.h @@ -0,0 +1,96 @@ +#ifndef _PSP2_UDCD_H_ +#define _PSP2_UDCD_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * USB Status + */ +#define SCE_UDCD_STATUS_CONNECTION_NEW 0x0001 +#define SCE_UDCD_STATUS_CONNECTION_ESTABLISHED 0x0002 +#define SCE_UDCD_STATUS_CONNECTION_SUSPENDED 0x0004 +#define SCE_UDCD_STATUS_CABLE_DISCONNECTED 0x0010 +#define SCE_UDCD_STATUS_CABLE_CONNECTED 0x0020 +#define SCE_UDCD_STATUS_DEACTIVATED 0x0100 +#define SCE_UDCD_STATUS_ACTIVATED 0x0200 +#define SCE_UDCD_STATUS_IS_CHARGING 0x0400 +#define SCE_UDCD_STATUS_USE_USB_CHARGING 0x0800 +#define SCE_UDCD_STATUS_UNKNOWN_1000 0x1000 +#define SCE_UDCD_STATUS_UNKNOWN_2000 0x2000 + +typedef struct { + uint8_t info[64]; +} SceUdcdDeviceInfo; + +typedef struct { + int unk_00; + int unk_04; + int unk_08; + int unk_0C; + int unk_10; + const char *driverName; +} SceUdcdWaitParam; + +typedef struct { + int unk_00; + int state; + int cable; + int connection; + int use_usb_charging; + int unk_14; +} SceUdcdDeviceState; + +/** + * Get device state + * + * @param[out] state - Device state + * + * @return 0 on success, < 0 on error. +*/ +int sceUdcdGetDeviceState(SceUdcdDeviceState *state); + +/** + * Get device information + * + * @param[out] devInfo - Device information + * + * @return 0 on success, < 0 on error. +*/ +int sceUdcdGetDeviceInfo(SceUdcdDeviceInfo *devInfo); + +/** + * Register callback + * + * @param[in] cbid - Callback UID + * @param[in] state - State + * + * @return 0 on success, < 0 on error. +*/ +int sceUdcdRegisterCallback(SceUID cbid, int state); + +/** + * Unregister callback + * + * @param[in] cbid - Callback UID + * + * @return 0 on success, < 0 on error. +*/ +int sceUdcdUnregisterCallback(SceUID cbid); + +/** + * Wait for state + * + * @param[in] waitParam - Wait parameter + * @param[in] state - State + * + * @return 0 on success, < 0 on error. +*/ +int sceUdcdWaitState(SceUdcdWaitParam *waitParam, int state); + +#ifdef __cplusplus +} +#endif + +#endif /* _PSP2_UDCD_H_ */ |