PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
padData.c File Reference
#include "irx.h"
#include "types.h"
#include "sio2man.h"
#include "sifman.h"
#include "sio2Cmds.h"
#include "padData.h"
#include "stdio.h"
#include "freepad.h"
+ Include dependency graph for padData.c:

Go to the source code of this file.

Data Structures

struct  padData_t
 

Functions

static int pd_set_change_slot_buffer (s32 *status)
 
u32 pdGetInSize (u8 id)
 
u32 pdGetOutSize (u8 id)
 
u32 pdGetRegData (u32 id)
 
u32 pdSetRegData (u32 port, u32 slot, u32 reg_data)
 
u32 setupReadData (u32 port, u32 slot, u32 val)
 
u32 pdSetActive (u32 port, u32 slot, u32 active)
 
u32 pdIsActive (u32 port, u32 slot)
 
static u32 mtapChangeSlot (u32 slot)
 
u32 pdSetStat70bit (u32 port, u32 slot, u32 val)
 
static u32 setupTransferData (u32 index, u32 port, u32 slot)
 
u32 readStat6cBit (u32 bit, sio2_transfer_data_t *td)
 
u32 readSio2OutBuffer (u32 bit, u32 port, u32 slot)
 
u32 padTransfer (u32 slot)
 
void pdTransfer (void)
 
u32 pdGetStat70bit (u32 port, u32 slot)
 
void pdReset (void)
 
static u32 SlotCheckConnection (u32 port, u32 slot)
 
u32 pdCheckConnection (u32 port, u32 slot)
 
s32 pdGetError (u32 port, u32 slot)
 
u32 pdSetCtrl1 (u32 port, u32 slot, u32 ctrl)
 
u32 pdSetCtrl2 (u32 port, u32 slot, u32 ctrl)
 
u32 pdSetInSize (u32 port, u32 slot, u32 size)
 
u32 pdSetOutSize (u32 port, u32 slot, u32 size)
 
u32 pdSetInBuffer (u32 port, u32 slot, u32 size, const u8 *buf)
 
u32 pdGetOutBuffer (u32 port, u32 slot, u32 size, u8 *buf)
 

Variables

static padData_t padData [2][4]
 
static sio2_transfer_data_t sio2_td
 
static u8 sio2_in_buffer [256]
 
static u8 sio2_out_buffer [256]
 
static s32 change_slot_buffer [8]
 
static int transferCount
 

Detailed Description

IOP pad driver

Definition in file padData.c.


Data Structure Documentation

◆ padData_t

struct padData_t

Definition at line 24 of file padData.c.

Data Fields
u32 active
u32 unused_4
u32 unused_8
u32 stat70bit
u32 in_size
u32 out_size
u8 in_buffer[32]
u8 out_buffer[32]
u32 port_ctrl1
u32 port_ctrl2
u32 reg_data
u32 error

Function Documentation

◆ pd_set_change_slot_buffer()

static int pd_set_change_slot_buffer ( s32 *  status)
static

Definition at line 50 of file padData.c.

◆ pdGetInSize()

u32 pdGetInSize ( u8  id)

Definition at line 67 of file padData.c.

◆ pdGetOutSize()

u32 pdGetOutSize ( u8  id)

Definition at line 74 of file padData.c.

◆ pdGetRegData()

u32 pdGetRegData ( u32  id)

Definition at line 81 of file padData.c.

◆ pdSetRegData()

u32 pdSetRegData ( u32  port,
u32  slot,
u32  reg_data 
)

Definition at line 92 of file padData.c.

◆ setupReadData()

u32 setupReadData ( u32  port,
u32  slot,
u32  val 
)

Definition at line 104 of file padData.c.

◆ pdSetActive()

u32 pdSetActive ( u32  port,
u32  slot,
u32  active 
)

Definition at line 138 of file padData.c.

◆ pdIsActive()

u32 pdIsActive ( u32  port,
u32  slot 
)

Definition at line 147 of file padData.c.

◆ mtapChangeSlot()

static u32 mtapChangeSlot ( u32  slot)
static

Definition at line 152 of file padData.c.

◆ pdSetStat70bit()

u32 pdSetStat70bit ( u32  port,
u32  slot,
u32  val 
)

Definition at line 177 of file padData.c.

◆ setupTransferData()

static u32 setupTransferData ( u32  index,
u32  port,
u32  slot 
)
static

Definition at line 186 of file padData.c.

◆ readStat6cBit()

u32 readStat6cBit ( u32  bit,
sio2_transfer_data_t td 
)

Definition at line 211 of file padData.c.

◆ readSio2OutBuffer()

u32 readSio2OutBuffer ( u32  bit,
u32  port,
u32  slot 
)

Definition at line 216 of file padData.c.

◆ padTransfer()

u32 padTransfer ( u32  slot)

Definition at line 250 of file padData.c.

◆ pdTransfer()

void pdTransfer ( void  )

Definition at line 333 of file padData.c.

◆ pdGetStat70bit()

u32 pdGetStat70bit ( u32  port,
u32  slot 
)

Definition at line 360 of file padData.c.

◆ pdReset()

void pdReset ( void  )

Definition at line 365 of file padData.c.

◆ SlotCheckConnection()

static u32 SlotCheckConnection ( u32  port,
u32  slot 
)
static

Definition at line 385 of file padData.c.

◆ pdCheckConnection()

u32 pdCheckConnection ( u32  port,
u32  slot 
)

Definition at line 440 of file padData.c.

◆ pdGetError()

s32 pdGetError ( u32  port,
u32  slot 
)

Definition at line 498 of file padData.c.

◆ pdSetCtrl1()

u32 pdSetCtrl1 ( u32  port,
u32  slot,
u32  ctrl 
)

Definition at line 506 of file padData.c.

◆ pdSetCtrl2()

u32 pdSetCtrl2 ( u32  port,
u32  slot,
u32  ctrl 
)

Definition at line 517 of file padData.c.

◆ pdSetInSize()

u32 pdSetInSize ( u32  port,
u32  slot,
u32  size 
)

Definition at line 529 of file padData.c.

◆ pdSetOutSize()

u32 pdSetOutSize ( u32  port,
u32  slot,
u32  size 
)

Definition at line 540 of file padData.c.

◆ pdSetInBuffer()

u32 pdSetInBuffer ( u32  port,
u32  slot,
u32  size,
const u8 *  buf 
)

Definition at line 552 of file padData.c.

◆ pdGetOutBuffer()

u32 pdGetOutBuffer ( u32  port,
u32  slot,
u32  size,
u8 *  buf 
)

Definition at line 572 of file padData.c.

Variable Documentation

◆ padData

padData_t padData[2][4]
static

Definition at line 40 of file padData.c.

◆ sio2_td

sio2_transfer_data_t sio2_td
static

Definition at line 42 of file padData.c.

◆ sio2_in_buffer

u8 sio2_in_buffer[256]
static

Definition at line 43 of file padData.c.

◆ sio2_out_buffer

u8 sio2_out_buffer[256]
static

Definition at line 44 of file padData.c.

◆ change_slot_buffer

s32 change_slot_buffer[8]
static

Definition at line 45 of file padData.c.

◆ transferCount

int transferCount
static

Definition at line 47 of file padData.c.