RetroArch
Classes | Macros | Typedefs | Functions | Variables
pad.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <irq.h>
#include <video.h>
#include <system.h>
#include "asm.h"
#include "processor.h"
#include "si.h"
#include "pad.h"
Include dependency graph for pad.c:

Classes

struct  _keyinput
 

Macros

#define PAD_PRODPADS   6
 
#define _SHIFTL(v, s, w)   ((u32) (((u32)(v) & ((0x01 << (w)) - 1)) << (s)))
 
#define _SHIFTR(v, s, w)   ((u32)(((u32)(v) >> (s)) & ((0x01 << (w)) - 1)))
 
#define PAD_ENABLEDMASK(chan)   (0x80000000>>chan);
 

Typedefs

typedef struct _keyinput keyinput
 
typedef void(* SPECCallback) (u32, u32 *, PADStatus *)
 

Functions

static void __pad_enable (u32 chan)
 
static void __pad_disable (u32 chan)
 
static void __pad_doreset ()
 
static s32 __pad_onreset (s32 final)
 
void udelay (int)
 
static void SPEC0_MakeStatus (u32 chan, u32 *data, PADStatus *status)
 
static void SPEC1_MakeStatus (u32 chan, u32 *data, PADStatus *status)
 
static s8 __pad_clampS8 (s8 var, s8 org)
 
static u8 __pad_clampU8 (u8 var, u8 org)
 
static void SPEC2_MakeStatus (u32 chan, u32 *data, PADStatus *status)
 
static void __pad_clampstick (s8 *px, s8 *py, s8 max, s8 xy, s8 min)
 
static void __pad_clamptrigger (u8 *trigger)
 
static void __pad_updateorigin (s32 chan)
 
static void __pad_probecallback (s32 chan, u32 type)
 
static void __pad_origincallback (s32 chan, u32 type)
 
static void __pad_originupdatecallback (s32 chan, u32 type)
 
static void __pad_typeandstatuscallback (s32 chan, u32 type)
 
static void __pad_receivecheckcallback (s32 chan, u32 type)
 
static void __pad_samplinghandler (u32 irq, void *ctx)
 
u32 __PADDisableRecalibration (s32 disable)
 
u32 PAD_Init ()
 
u32 PAD_Read (PADStatus *status)
 
u32 PAD_Reset (u32 mask)
 
u32 PAD_Recalibrate (u32 mask)
 
u32 PAD_Sync ()
 
void PAD_SetSpec (u32 spec)
 
void PAD_ControlMotor (s32 chan, u32 cmd)
 
sampling_callback PAD_SetSamplingCallback (sampling_callback cb)
 
void PAD_Clamp (PADStatus *status)
 
u32 PAD_ScanPads ()
 
u16 PAD_ButtonsUp (int pad)
 
u16 PAD_ButtonsDown (int pad)
 
u16 PAD_ButtonsHeld (int pad)
 
s8 PAD_SubStickX (int pad)
 
s8 PAD_SubStickY (int pad)
 
s8 PAD_StickX (int pad)
 
s8 PAD_StickY (int pad)
 
u8 PAD_TriggerL (int pad)
 
u8 PAD_TriggerR (int pad)
 

Variables

static sampling_callback __pad_samplingcallback = NULL
 
static SPECCallback __pad_makestatus = NULL
 
static u32 __pad_initialized = 0
 
static u32 __pad_enabledbits = 0
 
static u32 __pad_resettingbits = 0
 
static u32 __pad_recalibratebits = 0
 
static u32 __pad_waitingbits = 0
 
static u32 __pad_pendingbits = 0
 
static u32 __pad_checkingbits = 0
 
static u32 __pad_resettingchan = 32
 
static u32 __pad_spec = 5
 
static u32 __pad_analogmode = 0x00000300
 
static u32 __pad_cmdreadorigin = 0x41000000
 
static u32 __pad_cmdcalibrate = 0x42000000
 
static u32 __pad_xpatchbits = 0xf0000000
 
static u32 __pad_recalibrated = 0
 
static u32 __pad_type [PAD_CHANMAX]
 
static s8 __pad_origin [PAD_CHANMAX][12]
 
static u32 __pad_cmdprobedevice [PAD_CHANMAX]
 
static keyinput __pad_keys [PAD_CHANMAX]
 
static u8 __pad_clampregion [8] = {30, 180, 15, 72, 40, 15, 59, 31}
 
static vu32 *const _siReg = (u32*)0xCC006400
 
static vu16 *const _viReg = (u16*)0xCC002000
 
u32 __PADFixBits
 
static sys_resetinfo pad_resetinfo
 

Macro Definition Documentation

◆ _SHIFTL

#define _SHIFTL (   v,
  s,
  w 
)    ((u32) (((u32)(v) & ((0x01 << (w)) - 1)) << (s)))

◆ _SHIFTR

#define _SHIFTR (   v,
  s,
  w 
)    ((u32)(((u32)(v) >> (s)) & ((0x01 << (w)) - 1)))

◆ PAD_ENABLEDMASK

#define PAD_ENABLEDMASK (   chan)    (0x80000000>>chan);

◆ PAD_PRODPADS

#define PAD_PRODPADS   6

Typedef Documentation

◆ keyinput

typedef struct _keyinput keyinput

◆ SPECCallback

typedef void(* SPECCallback) (u32, u32 *, PADStatus *)

Function Documentation

◆ __pad_clampS8()

static s8 __pad_clampS8 ( s8  var,
s8  org 
)
static
Here is the caller graph for this function:

◆ __pad_clampstick()

static void __pad_clampstick ( s8 px,
s8 py,
s8  max,
s8  xy,
s8  min 
)
static
Here is the caller graph for this function:

◆ __pad_clamptrigger()

static void __pad_clamptrigger ( u8 trigger)
static
Here is the caller graph for this function:

◆ __pad_clampU8()

static u8 __pad_clampU8 ( u8  var,
u8  org 
)
static
Here is the caller graph for this function:

◆ __pad_disable()

static void __pad_disable ( u32  chan)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __pad_doreset()

static void __pad_doreset ( )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __pad_enable()

static void __pad_enable ( u32  chan)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __pad_onreset()

static s32 __pad_onreset ( s32  final)
static
Here is the call graph for this function:

◆ __pad_origincallback()

static void __pad_origincallback ( s32  chan,
u32  type 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __pad_originupdatecallback()

static void __pad_originupdatecallback ( s32  chan,
u32  type 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __pad_probecallback()

static void __pad_probecallback ( s32  chan,
u32  type 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __pad_receivecheckcallback()

static void __pad_receivecheckcallback ( s32  chan,
u32  type 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __pad_samplinghandler()

static void __pad_samplinghandler ( u32  irq,
void ctx 
)
static
Here is the caller graph for this function:

◆ __pad_typeandstatuscallback()

static void __pad_typeandstatuscallback ( s32  chan,
u32  type 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __pad_updateorigin()

static void __pad_updateorigin ( s32  chan)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __PADDisableRecalibration()

u32 __PADDisableRecalibration ( s32  disable)

◆ PAD_ButtonsDown()

u16 PAD_ButtonsDown ( int  pad)
Here is the caller graph for this function:

◆ PAD_ButtonsHeld()

u16 PAD_ButtonsHeld ( int  pad)
Here is the caller graph for this function:

◆ PAD_ButtonsUp()

u16 PAD_ButtonsUp ( int  pad)

◆ PAD_Clamp()

void PAD_Clamp ( PADStatus status)
Here is the call graph for this function:

◆ PAD_ControlMotor()

void PAD_ControlMotor ( s32  chan,
u32  cmd 
)
Here is the call graph for this function:

◆ PAD_Init()

u32 PAD_Init ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PAD_Read()

u32 PAD_Read ( PADStatus status)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PAD_Recalibrate()

u32 PAD_Recalibrate ( u32  mask)
Here is the caller graph for this function:

◆ PAD_Reset()

u32 PAD_Reset ( u32  mask)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PAD_ScanPads()

u32 PAD_ScanPads ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PAD_SetSamplingCallback()

sampling_callback PAD_SetSamplingCallback ( sampling_callback  cb)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PAD_SetSpec()

void PAD_SetSpec ( u32  spec)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PAD_StickX()

s8 PAD_StickX ( int  pad)
Here is the caller graph for this function:

◆ PAD_StickY()

s8 PAD_StickY ( int  pad)
Here is the caller graph for this function:

◆ PAD_SubStickX()

s8 PAD_SubStickX ( int  pad)
Here is the caller graph for this function:

◆ PAD_SubStickY()

s8 PAD_SubStickY ( int  pad)
Here is the caller graph for this function:

◆ PAD_Sync()

u32 PAD_Sync ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PAD_TriggerL()

u8 PAD_TriggerL ( int  pad)
Here is the caller graph for this function:

◆ PAD_TriggerR()

u8 PAD_TriggerR ( int  pad)
Here is the caller graph for this function:

◆ SPEC0_MakeStatus()

static void SPEC0_MakeStatus ( u32  chan,
u32 data,
PADStatus status 
)
static
Here is the caller graph for this function:

◆ SPEC1_MakeStatus()

static void SPEC1_MakeStatus ( u32  chan,
u32 data,
PADStatus status 
)
static
Here is the caller graph for this function:

◆ SPEC2_MakeStatus()

static void SPEC2_MakeStatus ( u32  chan,
u32 data,
PADStatus status 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ udelay()

void udelay ( int  )

Variable Documentation

◆ __pad_analogmode

u32 __pad_analogmode = 0x00000300
static

◆ __pad_checkingbits

u32 __pad_checkingbits = 0
static

◆ __pad_clampregion

u8 __pad_clampregion[8] = {30, 180, 15, 72, 40, 15, 59, 31}
static

◆ __pad_cmdcalibrate

u32 __pad_cmdcalibrate = 0x42000000
static

◆ __pad_cmdprobedevice

u32 __pad_cmdprobedevice[PAD_CHANMAX]
static

◆ __pad_cmdreadorigin

u32 __pad_cmdreadorigin = 0x41000000
static

◆ __pad_enabledbits

u32 __pad_enabledbits = 0
static

◆ __pad_initialized

u32 __pad_initialized = 0
static

◆ __pad_keys

keyinput __pad_keys[PAD_CHANMAX]
static

◆ __pad_makestatus

SPECCallback __pad_makestatus = NULL
static

◆ __pad_origin

s8 __pad_origin[PAD_CHANMAX][12]
static

◆ __pad_pendingbits

u32 __pad_pendingbits = 0
static

◆ __pad_recalibratebits

u32 __pad_recalibratebits = 0
static

◆ __pad_recalibrated

u32 __pad_recalibrated = 0
static

◆ __pad_resettingbits

u32 __pad_resettingbits = 0
static

◆ __pad_resettingchan

u32 __pad_resettingchan = 32
static

◆ __pad_samplingcallback

sampling_callback __pad_samplingcallback = NULL
static

◆ __pad_spec

u32 __pad_spec = 5
static

◆ __pad_type

u32 __pad_type[PAD_CHANMAX]
static

◆ __pad_waitingbits

u32 __pad_waitingbits = 0
static

◆ __pad_xpatchbits

u32 __pad_xpatchbits = 0xf0000000
static

◆ __PADFixBits

u32 __PADFixBits

◆ _siReg

vu32* const _siReg = (u32*)0xCC006400
static

◆ _viReg

vu16* const _viReg = (u16*)0xCC002000
static

◆ pad_resetinfo

sys_resetinfo pad_resetinfo
static
Initial value:
= {
{},
127
}
static s32 __pad_onreset(s32 final)
Definition: pad.c:81