PSP2SDK
dirty-f9e4f2d
The free SDK for PSP2
|
00001 00012 #ifndef _PSP2_TOUCH_H_ 00013 #define _PSP2_TOUCH_H_ 00014 00015 #ifdef __cplusplus 00016 extern "C" { 00017 #endif 00018 00019 #include <psp2/types.h> 00020 00021 // SCE_TOUCH_MAX_REPORT = 8 00022 enum { 00023 SCE_TOUCH_MAX_REPORT = 8 00024 }; 00025 00032 enum { 00033 SCE_TOUCH_PORT_FRONT = 0, 00034 SCE_TOUCH_PORT_BACK = 1, 00035 SCE_TOUCH_PORT_MAX_NUM = 2 00036 }; 00037 00043 enum { 00044 SCE_TOUCH_SAMPLING_STATE_START = 0, 00045 SCE_TOUCH_SAMPLING_STATE_STOP = 1 00046 }; 00047 00053 enum { 00054 SCE_TOUCH_REPORT_INFO_HIDE_UPPER_LAYER = 0x0001 00055 }; 00056 00058 enum { 00059 SCE_TOUCH_ERROR_INVALID_ARG = 0x80350001, 00060 SCE_TOUCH_ERROR_PRIV_REQUIRED = 0x80350002, 00061 SCE_TOUCH_ERROR_FATAL = 0x803500ff 00062 }; 00063 00064 typedef struct SceTouchPanelInfo { 00065 SceInt16 minAaX; 00066 SceInt16 minAaY; 00067 SceInt16 maxAaX; 00068 SceInt16 maxAaY; 00069 SceInt16 minDispX; 00070 SceInt16 minDispY; 00071 SceInt16 maxDispX; 00072 SceInt16 maxDispY; 00073 SceUInt8 minForce; 00074 SceUInt8 maxForce; 00075 SceUInt8 reserved[30]; 00076 } SceTouchPanelInfo; 00077 00078 typedef struct SceTouchReport { 00079 SceUInt8 id; 00080 SceUInt8 force; 00081 SceInt16 x; 00082 SceInt16 y; 00083 SceUInt8 reserved[8]; 00084 SceUInt16 info; 00085 } SceTouchReport; 00086 00087 typedef struct SceTouchData { 00088 SceUInt64 timeStamp; 00089 SceUInt32 status; 00090 SceUInt32 reportNum; 00091 SceTouchReport report[SCE_TOUCH_MAX_REPORT]; 00092 } SceTouchData; 00093 00100 int sceTouchGetPanelInfo(SceUInt32 port, SceTouchPanelInfo *pPanelInfo); 00101 00109 int sceTouchRead(SceUInt32 port, SceTouchData *pData, SceUInt32 nBufs); 00110 00118 int sceTouchPeek(SceUInt32 port, SceTouchData *pData, SceUInt32 nBufs); 00119 00126 int sceTouchSetSamplingState(SceUInt32 port, SceUInt32 state); 00127 00134 int sceTouchGetSamplingState(SceUInt32 port, SceUInt32 *pState); 00135 00141 int sceTouchEnableTouchForce(SceUInt32 port); 00142 00148 int sceTouchDisableTouchForce(SceUInt32 port); 00149 00150 #ifdef __cplusplus 00151 } 00152 #endif 00153 00154 #endif