PSP2SDK  dirty-f9e4f2d
The free SDK for PSP2
Data Structures | Typedefs | Enumerations | Functions
include/psp2/ctrl.h File Reference

Header file which defines control related variables and functions. More...

#include <stdint.h>
Include dependency graph for ctrl.h:

Go to the source code of this file.

Data Structures

struct  SceCtrlData
struct  SceCtrlRapidFireRule

Typedefs

typedef struct SceCtrlData SceCtrlData
typedef struct SceCtrlRapidFireRule SceCtrlRapidFireRule

Enumerations

enum  { SCE_CTRL_ERROR_INVALID_ARG = 0x80340001, SCE_CTRL_ERROR_PRIV_REQUIRED = 0x80340002, SCE_CTRL_ERROR_FATAL = 0x803400FF }
enum  {
  PSP2_CTRL_SELECT = 0x000001, PSP2_CTRL_START = 0x000008, PSP2_CTRL_UP = 0x000010, PSP2_CTRL_RIGHT = 0x000020,
  PSP2_CTRL_DOWN = 0x000040, PSP2_CTRL_LEFT = 0x000080, PSP2_CTRL_LTRIGGER = 0x000100, PSP2_CTRL_RTRIGGER = 0x000200,
  PSP2_CTRL_TRIANGLE = 0x001000, PSP2_CTRL_CIRCLE = 0x002000, PSP2_CTRL_CROSS = 0x004000, PSP2_CTRL_SQUARE = 0x008000,
  PSP2_CTRL_ANY = 0x010000
}
enum  { PSP2_CTRL_MODE_DIGITAL = 0, PSP2_CTRL_MODE_ANALOG, PSP2_CTRL_MODE_ANALOG_WIDE }

Functions

int sceCtrlSetSamplingMode (int mode)
int sceCtrlGetSamplingMode (int *pMode)
int sceCtrlPeekBufferPositive (int port, SceCtrlData *pad_data, int count)
int sceCtrlPeekBufferNegative (int port, SceCtrlData *pad_data, int count)
int sceCtrlReadBufferPositive (int port, SceCtrlData *pad_data, int count)
int sceCtrlReadBufferNegative (int port, SceCtrlData *pad_data, int count)
int sceCtrlSetRapidFire (int port, int idx, const SceCtrlRapidFireRule *pRule)
int sceCtrlClearRapidFire (int port, int idx)

Detailed Description

Header file which defines control related variables and functions.

Copyright (C) 2015 PSP2SDK Project

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.


Typedef Documentation

typedef struct SceCtrlData SceCtrlData

Returned controller data

Structure to pass as argument to sceCtrlSetRapidFire


Enumeration Type Documentation

anonymous enum

Enumeration for the digital controller buttons.

Enumerator:
PSP2_CTRL_SELECT 

Select button.

PSP2_CTRL_START 

Start button.

PSP2_CTRL_UP 

Up D-Pad button.

PSP2_CTRL_RIGHT 

Right D-Pad button.

PSP2_CTRL_DOWN 

Down D-Pad button.

PSP2_CTRL_LEFT 

Left D-Pad button.

PSP2_CTRL_LTRIGGER 

Left trigger.

PSP2_CTRL_RTRIGGER 

Right trigger.

PSP2_CTRL_TRIANGLE 

Triangle button.

PSP2_CTRL_CIRCLE 

Circle button.

PSP2_CTRL_CROSS 

Cross button.

PSP2_CTRL_SQUARE 

Square button.

PSP2_CTRL_ANY 

Any input intercepted.

anonymous enum

Controller mode.

Enumerator:
PSP2_CTRL_MODE_DIGITAL 

Digitial buttons only.

PSP2_CTRL_MODE_ANALOG 

Digital buttons + Analog support.

PSP2_CTRL_MODE_ANALOG_WIDE 

Same as PSP2_CTRL_MODE_ANALOG, but with larger range for analog sticks.


Function Documentation

int sceCtrlClearRapidFire ( int  port,
int  idx 
)

Clear rules for button rapid fire

Parameters:
[in]port- use 0.
[in]idx- rule index between 0-15
Returns:
0, <0 on error.
int sceCtrlGetSamplingMode ( int *  pMode)

Get the current controller mode.

Parameters:
[out]pMode- Return value, see ::CtrlMode.
Returns:
The current mode, <0 on error.
int sceCtrlPeekBufferNegative ( int  port,
SceCtrlData pad_data,
int  count 
)

Get the controller state information (polling, negative logic).

Parameters:
[in]port- use 0.
[out]*pad_data- see SceCtrlData.
[in]count- Buffers count.
Returns:
Buffers count, between 1 and 'count'. <0 on error.
int sceCtrlPeekBufferPositive ( int  port,
SceCtrlData pad_data,
int  count 
)

Get the controller state information (polling, positive logic).

Parameters:
[in]port- use 0.
[out]*pad_data- see SceCtrlData.
[in]count- Buffers count.
Returns:
Buffers count, between 1 and 'count'. <0 on error.
int sceCtrlReadBufferNegative ( int  port,
SceCtrlData pad_data,
int  count 
)

Get the controller state information (blocking, negative logic).

Parameters:
[in]port- use 0.
[out]*pad_data- see SceCtrlData.
[in]count- Buffers count.
Returns:
Buffers count, between 1 and 'count'. <0 on error.
int sceCtrlReadBufferPositive ( int  port,
SceCtrlData pad_data,
int  count 
)

Get the controller state information (blocking, positive logic).

Parameters:
[in]port- use 0.
[out]*pad_data- see SceCtrlData.
[in]count- Buffers count.
Returns:
Buffers count, between 1 and 'count'. <0 on error.
int sceCtrlSetRapidFire ( int  port,
int  idx,
const SceCtrlRapidFireRule pRule 
)

Set rules for button rapid fire

Parameters:
[in]port- use 0.
[in]idx- rule index between 0-15
[in]pRule- structure SceCtrlRapidFireRule.
Returns:
0, <0 on error.
int sceCtrlSetSamplingMode ( int  mode)

Set the controller mode.

Parameters:
[in]mode- One of ::CtrlMode.
Returns:
The previous mode, <0 on error.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines