PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
sio2man.c File Reference
#include <irx.h>
#include <defs.h>
#include <types.h>
#include <loadcore.h>
#include <intrman.h>
#include <dmacman.h>
#include <stdio.h>
#include <thbase.h>
#include <thevent.h>
#include <ioman.h>
#include "xsio2man.h"
+ Include dependency graph for sio2man.c:

Go to the source code of this file.

Macros

#define SIO2_REG_BASE   0xbf808200
 
#define SIO2_REG_PORT0_CTRL1   0xbf808240
 
#define SIO2_REG_PORT0_CTRL2   0xbf808244
 
#define SIO2_REG_DATA_OUT   0xbf808260
 
#define SIO2_REG_DATA_IN   0xbf808264
 
#define SIO2_REG_CTRL   0xbf808268
 
#define SIO2_REG_STAT6C   0xbf80826c
 
#define SIO2_REG_STAT70   0xbf808270
 
#define SIO2_REG_STAT74   0xbf808274
 
#define SIO2_REG_UNKN78   0xbf808278
 
#define SIO2_REG_UNKN7C   0xbf80827c
 
#define SIO2_REG_STAT   0xbf808280
 
#define EF_PAD_TRANSFER_INIT   0x00000001
 
#define EF_PAD_TRANSFER_READY   0x00000002
 
#define EF_MC_TRANSFER_INIT   0x00000004
 
#define EF_MC_TRANSFER_READY   0x00000008
 
#define EF_TRANSFER_START   0x00000010
 
#define EF_TRANSFER_FINISH   0x00000020
 
#define EF_TRANSFER_RESET   0x00000040
 
#define EF_SIO2_INTR_COMPLETE   0x00000080
 
#define EPRINTF(format, args...)   printf("%s: " format, _irx_id.n , ## args)
 

Functions

 IRX_ID ("sio2man", 1, 1)
 
int sio2_intr_handler (void *arg)
 
void send_td (sio2_transfer_data_t *td)
 
void recv_td (sio2_transfer_data_t *td)
 
void main_thread (void *unused)
 
int create_main_thread (void)
 
int create_event_flag (void)
 
void shutdown (void)
 
int _start (int argc, char *argv[])
 
void sio2_pad_transfer_init (void)
 
void sio2_mc_transfer_init (void)
 
int sio2_transfer (sio2_transfer_data_t *td)
 
void sio2_ctrl_set (u32 val)
 
u32 sio2_ctrl_get ()
 
u32 sio2_stat6c_get ()
 
void sio2_portN_ctrl1_set (int N, u32 val)
 
u32 sio2_portN_ctrl1_get (int N)
 
void sio2_portN_ctrl2_set (int N, u32 val)
 
u32 sio2_portN_ctrl2_get (int N)
 
u32 sio2_stat70_get ()
 
void sio2_regN_set (int N, u32 val)
 
u32 sio2_regN_get (int N)
 
u32 sio2_stat74_get ()
 
void sio2_unkn78_set (u32 val)
 
u32 sio2_unkn78_get ()
 
void sio2_unkn7c_set (u32 val)
 
u32 sio2_unkn7c_get ()
 
void sio2_data_out (u8 val)
 
u8 sio2_data_in ()
 
void sio2_stat_set (u32 val)
 
u32 sio2_stat_get ()
 

Variables

struct irx_export_table _exp_sio2man
 
int init = 0
 
int event_flag = -1
 
int thid = -1
 
sio2_transfer_data_ttransfer_data = NULL
 
int(* mtap_change_slot_cb )(s32 *) = NULL
 
int(* mtap_get_slot_max_cb )(int) = NULL
 
int(* mtap_get_slot_max2_cb )(int) = NULL
 
void(* mtap_update_slots_cb )(void) = NULL
 

Detailed Description

SIO2 logging utility.

Definition in file sio2man.c.

Macro Definition Documentation

◆ SIO2_REG_BASE

#define SIO2_REG_BASE   0xbf808200

Definition at line 54 of file sio2man.c.

◆ SIO2_REG_PORT0_CTRL1

#define SIO2_REG_PORT0_CTRL1   0xbf808240

Definition at line 55 of file sio2man.c.

◆ SIO2_REG_PORT0_CTRL2

#define SIO2_REG_PORT0_CTRL2   0xbf808244

Definition at line 56 of file sio2man.c.

◆ SIO2_REG_DATA_OUT

#define SIO2_REG_DATA_OUT   0xbf808260

Definition at line 57 of file sio2man.c.

◆ SIO2_REG_DATA_IN

#define SIO2_REG_DATA_IN   0xbf808264

Definition at line 58 of file sio2man.c.

◆ SIO2_REG_CTRL

#define SIO2_REG_CTRL   0xbf808268

Definition at line 59 of file sio2man.c.

◆ SIO2_REG_STAT6C

#define SIO2_REG_STAT6C   0xbf80826c

Definition at line 60 of file sio2man.c.

◆ SIO2_REG_STAT70

#define SIO2_REG_STAT70   0xbf808270

Definition at line 61 of file sio2man.c.

◆ SIO2_REG_STAT74

#define SIO2_REG_STAT74   0xbf808274

Definition at line 62 of file sio2man.c.

◆ SIO2_REG_UNKN78

#define SIO2_REG_UNKN78   0xbf808278

Definition at line 63 of file sio2man.c.

◆ SIO2_REG_UNKN7C

#define SIO2_REG_UNKN7C   0xbf80827c

Definition at line 64 of file sio2man.c.

◆ SIO2_REG_STAT

#define SIO2_REG_STAT   0xbf808280

Definition at line 65 of file sio2man.c.

◆ EF_PAD_TRANSFER_INIT

#define EF_PAD_TRANSFER_INIT   0x00000001

Definition at line 68 of file sio2man.c.

◆ EF_PAD_TRANSFER_READY

#define EF_PAD_TRANSFER_READY   0x00000002

Definition at line 69 of file sio2man.c.

◆ EF_MC_TRANSFER_INIT

#define EF_MC_TRANSFER_INIT   0x00000004

Definition at line 70 of file sio2man.c.

◆ EF_MC_TRANSFER_READY

#define EF_MC_TRANSFER_READY   0x00000008

Definition at line 71 of file sio2man.c.

◆ EF_TRANSFER_START

#define EF_TRANSFER_START   0x00000010

Definition at line 91 of file sio2man.c.

◆ EF_TRANSFER_FINISH

#define EF_TRANSFER_FINISH   0x00000020

Definition at line 92 of file sio2man.c.

◆ EF_TRANSFER_RESET

#define EF_TRANSFER_RESET   0x00000040

Definition at line 93 of file sio2man.c.

◆ EF_SIO2_INTR_COMPLETE

#define EF_SIO2_INTR_COMPLETE   0x00000080

Definition at line 94 of file sio2man.c.

◆ EPRINTF

#define EPRINTF (   format,
  args... 
)    printf("%s: " format, _irx_id.n , ## args)

Definition at line 97 of file sio2man.c.

Function Documentation

◆ sio2_intr_handler()

int sio2_intr_handler ( void *  arg)

Definition at line 108 of file sio2man.c.

◆ send_td()

void send_td ( sio2_transfer_data_t td)

Definition at line 119 of file sio2man.c.

◆ recv_td()

void recv_td ( sio2_transfer_data_t td)

Definition at line 172 of file sio2man.c.

◆ main_thread()

void main_thread ( void *  unused)

Definition at line 193 of file sio2man.c.

◆ create_main_thread()

int create_main_thread ( void  )

Definition at line 308 of file sio2man.c.

◆ create_event_flag()

int create_event_flag ( void  )

Definition at line 320 of file sio2man.c.

◆ _start()

int _start ( int  argc,
char *  argv[] 
)

Definition at line 345 of file sio2man.c.

◆ sio2_pad_transfer_init()

void sio2_pad_transfer_init ( void  )

Definition at line 385 of file sio2man.c.

◆ sio2_mc_transfer_init()

void sio2_mc_transfer_init ( void  )

Definition at line 393 of file sio2man.c.

◆ sio2_transfer()

int sio2_transfer ( sio2_transfer_data_t td)

Definition at line 411 of file sio2man.c.

◆ sio2_ctrl_set()

void sio2_ctrl_set ( u32  val)

Definition at line 500 of file sio2man.c.

◆ sio2_ctrl_get()

u32 sio2_ctrl_get ( void  )

Definition at line 501 of file sio2man.c.

◆ sio2_stat6c_get()

u32 sio2_stat6c_get ( void  )

Definition at line 502 of file sio2man.c.

◆ sio2_portN_ctrl1_set()

void sio2_portN_ctrl1_set ( int  N,
u32  val 
)

Definition at line 503 of file sio2man.c.

◆ sio2_portN_ctrl1_get()

u32 sio2_portN_ctrl1_get ( int  N)

Definition at line 504 of file sio2man.c.

◆ sio2_portN_ctrl2_set()

void sio2_portN_ctrl2_set ( int  N,
u32  val 
)

Definition at line 505 of file sio2man.c.

◆ sio2_portN_ctrl2_get()

u32 sio2_portN_ctrl2_get ( int  N)

Definition at line 506 of file sio2man.c.

◆ sio2_stat70_get()

u32 sio2_stat70_get ( void  )

Definition at line 507 of file sio2man.c.

◆ sio2_regN_set()

void sio2_regN_set ( int  N,
u32  val 
)

Definition at line 508 of file sio2man.c.

◆ sio2_regN_get()

u32 sio2_regN_get ( int  N)

Definition at line 509 of file sio2man.c.

◆ sio2_stat74_get()

u32 sio2_stat74_get ( void  )

Definition at line 510 of file sio2man.c.

◆ sio2_unkn78_set()

void sio2_unkn78_set ( u32  val)

Definition at line 511 of file sio2man.c.

◆ sio2_unkn78_get()

u32 sio2_unkn78_get ( void  )

Definition at line 512 of file sio2man.c.

◆ sio2_unkn7c_set()

void sio2_unkn7c_set ( u32  val)

Definition at line 513 of file sio2man.c.

◆ sio2_unkn7c_get()

u32 sio2_unkn7c_get ( void  )

Definition at line 514 of file sio2man.c.

◆ sio2_data_out()

void sio2_data_out ( u8  val)

Definition at line 515 of file sio2man.c.

◆ sio2_data_in()

u8 sio2_data_in ( void  )

Definition at line 516 of file sio2man.c.

◆ sio2_stat_set()

void sio2_stat_set ( u32  val)

Definition at line 517 of file sio2man.c.

◆ sio2_stat_get()

u32 sio2_stat_get ( void  )

Definition at line 518 of file sio2man.c.

Variable Documentation

◆ init

static int init ( void  ) = 0

Definition at line 99 of file sio2man.c.

◆ event_flag

int event_flag = -1

Definition at line 100 of file sio2man.c.

◆ thid

int thid = -1

Definition at line 101 of file sio2man.c.

◆ transfer_data

sio2_transfer_data_t* transfer_data = NULL

Definition at line 102 of file sio2man.c.

◆ mtap_change_slot_cb

int(* mtap_change_slot_cb) (s32 *) ( s32 *  ) = NULL

Definition at line 103 of file sio2man.c.

◆ mtap_get_slot_max_cb

int(* mtap_get_slot_max_cb) (int) ( int  ) = NULL

Definition at line 104 of file sio2man.c.

◆ mtap_get_slot_max2_cb

int(* mtap_get_slot_max2_cb) (int) ( int  ) = NULL

Definition at line 105 of file sio2man.c.

◆ mtap_update_slots_cb

void(* mtap_update_slots_cb) (void) ( void  ) = NULL

Definition at line 106 of file sio2man.c.