vitasdk
Documentation of the vitasdk
ctrl.h
Go to the documentation of this file.
1 
7 #ifndef _PSP2KERN_CTRL_H_
8 #define _PSP2KERN_CTRL_H_
9 
10 #include <vitasdk/build_utils.h>
11 #include <psp2common/ctrl.h>
12 #include <psp2kern/types.h>
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
20  int (*readButtons)(int port, SceCtrlData *pad_data, int count);
21  int (*setActuator)(int port, const SceCtrlActuator* pState);
22  int (*getBatteryInfo)(int port, SceUInt8 *batt);
23  int (*disconnect)(int port);
24  int (*setTurnOffInterval)(int port);
26  int (*changePortAssign)(int port1, int port2);
27  int (*unk0)(void);
29  int (*setLightBar)(int port, SceUInt8 r, SceUInt8 g, SceUInt8 b);
30  int (*resetLightBar)(int port);
31  int (*unk1)(int port);
32  int (*singleControllerMode)(int port);
35 
44 
52 int ksceCtrlGetSamplingMode(int *pMode);
53 
63 int ksceCtrlPeekBufferPositive(int port, SceCtrlData *pad_data, int count);
64 
74 int ksceCtrlPeekBufferNegative(int port, SceCtrlData *pad_data, int count);
75 
85 int ksceCtrlReadBufferPositive(int port, SceCtrlData *pad_data, int count);
86 
96 int ksceCtrlReadBufferNegative(int port, SceCtrlData *pad_data, int count);
97 
107 int ksceCtrlSetRapidFire(int port, int idx, const SceCtrlRapidFireRule* pRule);
108 
117 int ksceCtrlClearRapidFire(int port, int idx);
118 
126 
137 int ksceCtrlSetButtonIntercept(int intercept);
138 
146 int ksceCtrlGetButtonIntercept(int *intercept);
147 
163 int ksceCtrlSetButtonEmulation(unsigned int port, unsigned char slot,
164  unsigned int userButtons, unsigned int kernelButtons,
165  unsigned int uiMake);
166 
185 int ksceCtrlSetAnalogEmulation(unsigned int port, unsigned char slot,
186  unsigned char user_lX, unsigned char user_lY,
187  unsigned char user_rX, unsigned char user_rY,
188  unsigned char kernel_lX, unsigned char kernel_lY,
189  unsigned char kernel_rX, unsigned char kernel_rY,
190  unsigned int uiMake);
191 
202 
213 int ksceCtrlUpdateMaskForNonShell(int clear_mask, int set_mask);
214 
225 int ksceCtrlUpdateMaskForAll(int clear_mask, int set_mask);
226 
234 int ksceCtrlGetMaskForNonShell(uint32_t *mask);
235 
243 int ksceCtrlGetMaskForAll(uint32_t *mask);
244 
245 #ifdef __cplusplus
246 }
247 #endif
248 
249 #endif /* _PSP2KERN_CTRL_H_ */
int ksceCtrlSetRapidFire(int port, int idx, const SceCtrlRapidFireRule *pRule)
Set rules for button rapid fire.
int ksceCtrlPeekBufferNegative(int port, SceCtrlData *pad_data, int count)
Get the controller state information (polling, negative logic).
int ksceCtrlSetButtonEmulation(unsigned int port, unsigned char slot, unsigned int userButtons, unsigned int kernelButtons, unsigned int uiMake)
Emulate buttons for the digital pad.
int(* disconnect)(int port)
Definition: ctrl.h:23
int ksceCtrlUpdateMaskForNonShell(int clear_mask, int set_mask)
Update ctrl mask for non shell process.
int(* getBatteryInfo)(int port, SceUInt8 *batt)
Definition: ctrl.h:22
int ksceCtrlGetButtonIntercept(int *intercept)
Gets intercept.
int(* unk1)(int port)
Definition: ctrl.h:31
int ksceCtrlReadBufferNegative(int port, SceCtrlData *pad_data, int count)
Get the controller state information (blocking, negative logic).
int(* setLightBar)(int port, SceUInt8 r, SceUInt8 g, SceUInt8 b)
Definition: ctrl.h:29
int(* readButtons)(int port, SceCtrlData *pad_data, int count)
Definition: ctrl.h:20
int ksceCtrlGetMaskForAll(uint32_t *mask)
Get ctrl mask for all process.
int ksceCtrlGetSamplingMode(int *pMode)
Get the current controller mode.
int(* setActuator)(int port, const SceCtrlActuator *pState)
Definition: ctrl.h:21
int ksceCtrlPeekBufferPositive(int port, SceCtrlData *pad_data, int count)
Get the controller state information (polling, positive logic).
int ksceCtrlGetMaskForNonShell(uint32_t *mask)
Get ctrl mask for non shell process.
int ksceCtrlRegisterVirtualControllerDriver(SceCtrlVirtualControllerDriver *driver)
Register virtual controller driver.
int ksceCtrlUpdateMaskForAll(int clear_mask, int set_mask)
Update ctrl mask for all process.
int(* changePortAssign)(int port1, int port2)
Definition: ctrl.h:26
int ksceCtrlSetAnalogEmulation(unsigned int port, unsigned char slot, unsigned char user_lX, unsigned char user_lY, unsigned char user_rX, unsigned char user_rY, unsigned char kernel_lX, unsigned char kernel_lY, unsigned char kernel_rX, unsigned char kernel_rY, unsigned int uiMake)
Emulate values for the analog pad's X- and Y-axis.
int(* unk0)(void)
Definition: ctrl.h:27
int ksceCtrlGetControllerPortInfo(SceCtrlPortInfo *info)
Get controller port information.
int ksceCtrlReadBufferPositive(int port, SceCtrlData *pad_data, int count)
Get the controller state information (blocking, positive logic).
int(* singleControllerMode)(int port)
Definition: ctrl.h:32
int ksceCtrlClearRapidFire(int port, int idx)
Clear rules for button rapid fire.
int(* getControllerPortInfo)(SceCtrlPortInfo *info)
Definition: ctrl.h:28
int(* resetLightBar)(int port)
Definition: ctrl.h:30
int(* getActiveControllerPort)(void)
Definition: ctrl.h:25
int ksceCtrlSetButtonIntercept(int intercept)
Sets intercept.
int(* setTurnOffInterval)(int port)
Definition: ctrl.h:24
int ksceCtrlSetSamplingMode(int mode)
Set the controller mode.
Structure to pass as argument to ksceCtrlRegisterVirtualControllerDriver.
Definition: ctrl.h:19
VITASDK_BUILD_ASSERT_EQ(0x20, SceCtrlData)
Structure to pass as argument to sceCtrlSetActuator.
Definition: ctrl.h:132
Returned controller data.
Definition: ctrl.h:78
Structure to pass as argument to sceCtrlGetControllerPortInfo.
Definition: ctrl.h:140
Structure to pass as argument to sceCtrlSetRapidFire.
Definition: ctrl.h:121
uint8_t SceUInt8
Definition: types.h:36