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

Classes

union  _sicomcsr
 
struct  _sipacket
 
struct  _sicntrl
 
struct  _xy
 

Macros

#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 SISR_ERRORMASK(chn)   (0x0f000000>>((chn)<<3))
 
#define SIPOLL_ENABLE(chn)   (0x80000000>>((chn)+24))
 
#define SICOMCSR_TCINT   (1<<31)
 
#define SICOMCSR_TCINT_ENABLE   (1<<30)
 
#define SICOMCSR_COMERR   (1<<29)
 
#define SICOMCSR_RDSTINT   (1<<28)
 
#define SICOMCSR_RDSTINT_ENABLE   (1<<27)
 
#define SICOMCSR_TSTART   (1<<0)
 
#define SISR_UNDERRUN   0x0001
 
#define SISR_OVERRUN   0x0002
 
#define SISR_COLLISION   0x0004
 
#define SISR_NORESPONSE   0x0008
 
#define SISR_WRST   0x0010
 
#define SISR_RDST   0x0020
 

Typedefs

typedef union _sicomcsr sicomcsr
 

Functions

static u32 __si_transfer (s32 chan, void *out, u32 out_len, void *in, u32 in_len, SICallback cb)
 
static __inline__ struct _xy__si_getxy ()
 
static __inline__ void __si_cleartcinterrupt ()
 
static void __si_alarmhandler (syswd_t thealarm, void *cbarg)
 
static u32 __si_completetransfer ()
 
static void __si_calltypandstatuscallback (s32 chan, u32 type)
 
static void __si_gettypecallback (s32 chan, u32 type)
 
static void __si_transfernext (u32 chan)
 
static void __si_interrupthandler (u32 irq, void *ctx)
 
u32 SI_Sync ()
 
u32 SI_Busy ()
 
u32 SI_IsChanBusy (s32 chan)
 
void SI_SetXY (u16 line, u8 cnt)
 
void SI_EnablePolling (u32 poll)
 
void SI_DisablePolling (u32 poll)
 
void SI_SetSamplingRate (u32 samplingrate)
 
void SI_RefreshSamplingRate ()
 
u32 SI_GetStatus (s32 chan)
 
u32 SI_GetResponseRaw (s32 chan)
 
u32 SI_GetResponse (s32 chan, void *buf)
 
void SI_SetCommand (s32 chan, u32 cmd)
 
u32 SI_GetCommand (s32 chan)
 
u32 SI_Transfer (s32 chan, void *out, u32 out_len, void *in, u32 in_len, SICallback cb, u32 us_delay)
 
u32 SI_GetType (s32 chan)
 
u32 SI_GetTypeAsync (s32 chan, SICallback cb)
 
void SI_TransferCommands ()
 
u32 SI_RegisterPollingHandler (RDSTHandler handler)
 
u32 SI_UnregisterPollingHandler (RDSTHandler handler)
 
u32 SI_EnablePollingInterrupt (s32 enable)
 
void __si_init ()
 

Variables

static struct _sipacket sipacket [4]
 
static struct _sicntrl sicntrl
 
static struct _xy xy [2][12]
 
u32 __PADFixBits = 0
 
static u32 sampling_rate = 0
 
static u32 cmdtypeandstatus = 0
 
static u32 cmdfixdevice [4] = {0,0,0,0}
 
static u32 si_type [4] = {8,8,8,8}
 
static u32 inputBufferVCount [4] = {0,0,0,0}
 
static u32 inputBufferValid [4] = {0,0,0,0}
 
static u32 inputBuffer [4][2] = {{0,0},{0,0},{0,0},{0,0}}
 
static RDSTHandler rdstHandlers [4] = {NULL,NULL,NULL,NULL}
 
static u64 typeTime [4] = {0,0,0,0}
 
static u64 xferTime [4] = {0,0,0,0}
 
static SICallback typeCallback [4][4]
 
static syswd_t si_alarm [4]
 
static vu16 *const _viReg = (u16*)0xCC002000
 

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)))

◆ SICOMCSR_COMERR

#define SICOMCSR_COMERR   (1<<29)

◆ SICOMCSR_RDSTINT

#define SICOMCSR_RDSTINT   (1<<28)

◆ SICOMCSR_RDSTINT_ENABLE

#define SICOMCSR_RDSTINT_ENABLE   (1<<27)

◆ SICOMCSR_TCINT

#define SICOMCSR_TCINT   (1<<31)

◆ SICOMCSR_TCINT_ENABLE

#define SICOMCSR_TCINT_ENABLE   (1<<30)

◆ SICOMCSR_TSTART

#define SICOMCSR_TSTART   (1<<0)

◆ SIPOLL_ENABLE

#define SIPOLL_ENABLE (   chn)    (0x80000000>>((chn)+24))

◆ SISR_COLLISION

#define SISR_COLLISION   0x0004

◆ SISR_ERRORMASK

#define SISR_ERRORMASK (   chn)    (0x0f000000>>((chn)<<3))

◆ SISR_NORESPONSE

#define SISR_NORESPONSE   0x0008

◆ SISR_OVERRUN

#define SISR_OVERRUN   0x0002

◆ SISR_RDST

#define SISR_RDST   0x0020

◆ SISR_UNDERRUN

#define SISR_UNDERRUN   0x0001

◆ SISR_WRST

#define SISR_WRST   0x0010

Typedef Documentation

◆ sicomcsr

typedef union _sicomcsr sicomcsr

Function Documentation

◆ __si_alarmhandler()

static void __si_alarmhandler ( syswd_t  thealarm,
void cbarg 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __si_calltypandstatuscallback()

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

◆ __si_cleartcinterrupt()

static __inline__ void __si_cleartcinterrupt ( )
static
Here is the caller graph for this function:

◆ __si_completetransfer()

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

◆ __si_gettypecallback()

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

◆ __si_getxy()

static __inline__ struct _xy* __si_getxy ( )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __si_init()

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

◆ __si_interrupthandler()

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

◆ __si_transfer()

static u32 __si_transfer ( s32  chan,
void out,
u32  out_len,
void in,
u32  in_len,
SICallback  cb 
)
static
Here is the caller graph for this function:

◆ __si_transfernext()

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

◆ SI_Busy()

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

◆ SI_DisablePolling()

void SI_DisablePolling ( u32  poll)
Here is the caller graph for this function:

◆ SI_EnablePolling()

void SI_EnablePolling ( u32  poll)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SI_EnablePollingInterrupt()

u32 SI_EnablePollingInterrupt ( s32  enable)
Here is the caller graph for this function:

◆ SI_GetCommand()

u32 SI_GetCommand ( s32  chan)

◆ SI_GetResponse()

u32 SI_GetResponse ( s32  chan,
void buf 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SI_GetResponseRaw()

u32 SI_GetResponseRaw ( s32  chan)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SI_GetStatus()

u32 SI_GetStatus ( s32  chan)
Here is the caller graph for this function:

◆ SI_GetType()

u32 SI_GetType ( s32  chan)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SI_GetTypeAsync()

u32 SI_GetTypeAsync ( s32  chan,
SICallback  cb 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SI_IsChanBusy()

u32 SI_IsChanBusy ( s32  chan)
Here is the caller graph for this function:

◆ SI_RefreshSamplingRate()

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

◆ SI_RegisterPollingHandler()

u32 SI_RegisterPollingHandler ( RDSTHandler  handler)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SI_SetCommand()

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

◆ SI_SetSamplingRate()

void SI_SetSamplingRate ( u32  samplingrate)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SI_SetXY()

void SI_SetXY ( u16  line,
u8  cnt 
)
Here is the caller graph for this function:

◆ SI_Sync()

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

◆ SI_Transfer()

u32 SI_Transfer ( s32  chan,
void out,
u32  out_len,
void in,
u32  in_len,
SICallback  cb,
u32  us_delay 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SI_TransferCommands()

void SI_TransferCommands ( )
Here is the caller graph for this function:

◆ SI_UnregisterPollingHandler()

u32 SI_UnregisterPollingHandler ( RDSTHandler  handler)
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ __PADFixBits

u32 __PADFixBits = 0

◆ _viReg

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

◆ cmdfixdevice

u32 cmdfixdevice[4] = {0,0,0,0}
static

◆ cmdtypeandstatus

static u32 cmdtypeandstatus = 0
static

◆ inputBuffer

u32 inputBuffer[4][2] = {{0,0},{0,0},{0,0},{0,0}}
static

◆ inputBufferValid

u32 inputBufferValid[4] = {0,0,0,0}
static

◆ inputBufferVCount

u32 inputBufferVCount[4] = {0,0,0,0}
static

◆ rdstHandlers

RDSTHandler rdstHandlers[4] = {NULL,NULL,NULL,NULL}
static

◆ sampling_rate

u32 sampling_rate = 0
static

◆ si_alarm

syswd_t si_alarm[4]
static

◆ si_type

u32 si_type[4] = {8,8,8,8}
static

◆ sicntrl

struct _sicntrl sicntrl
static
Initial value:
= {
-1,
0,
0,
}
#define NULL
Pointer to 0.
Definition: gctypes.h:65

◆ sipacket

struct _sipacket sipacket[4]
static

◆ typeCallback

SICallback typeCallback[4][4]
static
Initial value:
#define NULL
Pointer to 0.
Definition: gctypes.h:65

◆ typeTime

u64 typeTime[4] = {0,0,0,0}
static

◆ xferTime

u64 xferTime[4] = {0,0,0,0}
static

◆ xy

struct _xy xy[2][12]
static
Initial value:
= {
{
{0x00F6,0x02},{0x000F,0x12},{0x001E,0x09},{0x002C,0x06},
{0x0034,0x05},{0x0041,0x04},{0x0057,0x03},{0x0057,0x03},
{0x0057,0x03},{0x0083,0x02},{0x0083,0x02},{0x0083,0x02}
},
{
{0x0128,0x02},{0x000F,0x15},{0x001D,0x0B},{0x002D,0x07},
{0x0034,0x06},{0x003F,0x05},{0x004E,0x04},{0x0068,0x03},
{0x0068,0x03},{0x0068,0x03},{0x0068,0x03},{0x009C,0x02}
}
}