PSXSDK
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Macros | Functions | Variables
pad.c File Reference
#include <stdio.h>
#include <string.h>
#include <strings.h>
#include <psx.h>

Macros

#define TX_RDY   0x0001
 
#define RX_RDY   0x0002
 
#define TX_EMPTY   0x0004
 
#define PARITY_ERR   0x0008
 
#define RX_OVERRUN   0x0010
 
#define FRAMING_ERR   0x0020
 
#define SYNC_DETECT   0x0040
 
#define DSR   0x0080
 
#define CTS   0x0100
 
#define IRQ   0x0200
 
#define TX_PERM   0x0001
 
#define DTR   0x0002
 
#define RX_PERM   0x0004
 
#define BREAK   0x0008
 
#define RESET_ERR   0x0010
 
#define RTS   0x0020
 
#define PADSIO_RESET   0x0040
 
#define PADSIO_DATA(x)   *((unsigned char*)(0x1f801040 + (x<<4)))
 
#define PADSIO_STATUS(x)   *((unsigned short*)(0x1f801044 + (x<<4)))
 
#define PADSIO_MODE(x)   *((unsigned short*)(0x1f801048 + (x<<4)))
 
#define PADSIO_CTRL(x)   *((unsigned short*)(0x1f80104a + (x<<4)))
 
#define PADSIO_BAUD(x)   *((unsigned short*)(0x1f80104e + (x<<4)))
 

Functions

void QueryPAD (int pad_n, unsigned char *in, unsigned char *out, int len)
 
void pad_read_raw (int pad_n, unsigned char *arr)
 
void pad_escape_mode (int pad_n, int enable)
 
void pad_enable_vibration (int pad_n)
 
void pad_set_vibration (int pad_n, unsigned char small, unsigned char big)
 

Variables

unsigned char readpad_vibrations [4][2]
 
int querypad_rxrdy = 1
 

Macro Definition Documentation

#define BREAK   0x0008
#define CTS   0x0100
#define DSR   0x0080
#define DTR   0x0002
#define FRAMING_ERR   0x0020
#define IRQ   0x0200
#define PADSIO_BAUD (   x)    *((unsigned short*)(0x1f80104e + (x<<4)))
#define PADSIO_CTRL (   x)    *((unsigned short*)(0x1f80104a + (x<<4)))
#define PADSIO_DATA (   x)    *((unsigned char*)(0x1f801040 + (x<<4)))
#define PADSIO_MODE (   x)    *((unsigned short*)(0x1f801048 + (x<<4)))
#define PADSIO_RESET   0x0040
#define PADSIO_STATUS (   x)    *((unsigned short*)(0x1f801044 + (x<<4)))
#define PARITY_ERR   0x0008
#define RESET_ERR   0x0010
#define RTS   0x0020
#define RX_OVERRUN   0x0010
#define RX_PERM   0x0004
#define RX_RDY   0x0002
#define SYNC_DETECT   0x0040
#define TX_EMPTY   0x0004
#define TX_PERM   0x0001
#define TX_RDY   0x0001

Function Documentation

void pad_enable_vibration ( int  pad_n)
void pad_escape_mode ( int  pad_n,
int  enable 
)
void pad_read_raw ( int  pad_n,
unsigned char *  arr 
)
void pad_set_vibration ( int  pad_n,
unsigned char  small,
unsigned char  big 
)
void QueryPAD ( int  pad_n,
unsigned char *  in,
unsigned char *  out,
int  len 
)

Variable Documentation

int querypad_rxrdy = 1
unsigned char readpad_vibrations[4][2]