PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
sio2man.h
Go to the documentation of this file.
1/*
2# _____ ___ ____ ___ ____
3# ____| | ____| | | |____|
4# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5#-----------------------------------------------------------------------
6# Copyright (c) 2003 Marcus R. Brown <mrbrown@0xd6.org>
7# Licenced under Academic Free License version 2.0
8# Review ps2sdk README & LICENSE files for further details.
9*/
10
16#ifndef __SIO2MAN_H__
17#define __SIO2MAN_H__
18
19#include <types.h>
20#include <irx.h>
21
22struct _sio2_dma_arg { // size 12
23 void *addr;
24 int size;
25 int count;
26};
27
28typedef struct {
29 u32 stat6c;
30
31 u32 port_ctrl1[4];
32 u32 port_ctrl2[4];
33
34 u32 stat70;
35
36 u32 regdata[16];
37
38 u32 stat74;
39
40 u32 in_size;
41 u32 out_size;
42 u8 *in;
43 u8 *out;
44
45 struct _sio2_dma_arg in_dma;
46 struct _sio2_dma_arg out_dma;
48
49void sio2_ctrl_set(u32 val);
50u32 sio2_ctrl_get(void);
51u32 sio2_stat6c_get(void);
52void sio2_portN_ctrl1_set(int N, u32 val);
53u32 sio2_portN_ctrl1_get(int N);
54void sio2_portN_ctrl2_set(int N, u32 val);
55u32 sio2_portN_ctrl2_get(int N);
56u32 sio2_stat70_get(void);
57void sio2_regN_set(int N, u32 val);
58u32 sio2_regN_get(int N);
59u32 sio2_stat74_get(void);
60void sio2_unkn78_set(u32 val);
61u32 sio2_unkn78_get(void);
62void sio2_unkn7c_set(u32 val);
63u32 sio2_unkn7c_get(void);
64void sio2_data_out(u8 val);
65u8 sio2_data_in(void);
66void sio2_stat_set(u32 val);
67u32 sio2_stat_get(void);
68void sio2_pad_transfer_init(void);
69void sio2_mc_transfer_init(void);
70int sio2_transfer(sio2_transfer_data_t *td);
71
72#define sio2man_IMPORTS_start DECLARE_IMPORT_TABLE(sio2man, 1, 1)
73#define sio2man_IMPORTS_end END_IMPORT_TABLE
74
75#define I_sio2_ctrl_set DECLARE_IMPORT(4, sio2_ctrl_set)
76#define I_sio2_ctrl_get DECLARE_IMPORT(5, sio2_ctrl_get)
77#define I_sio2_stat6c_get DECLARE_IMPORT(6, sio2_stat6c_get)
78#define I_sio2_portN_ctrl1_set DECLARE_IMPORT(7, sio2_portN_ctrl1_set)
79#define I_sio2_portN_ctrl1_get DECLARE_IMPORT(8, sio2_portN_ctrl1_get)
80#define I_sio2_portN_ctrl2_set DECLARE_IMPORT(9, sio2_portN_ctrl2_set)
81#define I_sio2_portN_ctrl2_get DECLARE_IMPORT(10, sio2_portN_ctrl2_get)
82#define I_sio2_stat70_get DECLARE_IMPORT(11, sio2_stat70_get)
83#define I_sio2_regN_set DECLARE_IMPORT(12, sio2_regN_set)
84#define I_sio2_regN_get DECLARE_IMPORT(13, sio2_regN_get)
85#define I_sio2_stat74_get DECLARE_IMPORT(14, sio2_stat74_get)
86#define I_sio2_unkn78_set DECLARE_IMPORT(15, sio2_unkn78_set)
87#define I_sio2_unkn78_get DECLARE_IMPORT(16, sio2_unkn78_get)
88#define I_sio2_unkn7c_set DECLARE_IMPORT(17, sio2_unkn7c_set)
89#define I_sio2_unkn7c_get DECLARE_IMPORT(18, sio2_unkn7c_get)
90#define I_sio2_data_out DECLARE_IMPORT(19, sio2_data_out)
91#define I_sio2_data_in DECLARE_IMPORT(20, sio2_data_in)
92#define I_sio2_stat_set DECLARE_IMPORT(21, sio2_stat_set)
93#define I_sio2_stat_get DECLARE_IMPORT(22, sio2_stat_get)
94#define I_sio2_pad_transfer_init DECLARE_IMPORT(23, sio2_pad_transfer_init)
95#define I_sio2_mc_transfer_init DECLARE_IMPORT(24, sio2_mc_transfer_init)
96#define I_sio2_transfer DECLARE_IMPORT(25, sio2_transfer)
97
98#endif /* __SIO2MAN_H__ */