SSBM Decomp
Toggle main menu visibility
Loading...
Searching...
No Matches
OSSerial.h
Go to the documentation of this file.
1
#ifndef _DOLPHIN_OSSERIAL_H
2
#define _DOLPHIN_OSSERIAL_H
3
4
#include <
dolphin/hw_regs.h
>
5
6
#define CHAN_NONE -1
7
8
#define SI_MAX_CHAN 4
9
10
#define SI_COMCSR_IDX 13
11
#define SI_STATUS_IDX 14
12
13
#define SI_COMCSR_TCINT_MASK (1 << 31)
14
#define SI_COMCSR_TCINTMSK_MASK (1 << 30)
15
#define SI_COMCSR_COMERR_MASK (1 << 29)
16
#define SI_COMCSR_RDSTINT_MASK (1 << 28)
17
#define SI_COMCSR_RDSTINTMSK_MASK (1 << 27)
18
// 4 bits of padding
19
#define SI_COMCSR_OUTLNGTH_MASK \
20
(1 << 22) | (1 << 21) | (1 << 20) | (1 << 19) | (1 << 18) | (1 << 17) | \
21
(1 << 16)
22
// 1 bit of padding
23
#define SI_COMCSR_INLNGTH_MASK \
24
(1 << 14) | (1 << 13) | (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | \
25
(1 << 8)
26
// 5 bits of padding
27
#define SI_COMCSR_CHANNEL_MASK (1 << 2) | (1 << 1)
28
#define SI_COMCSR_TSTART_MASK (1 << 0)
29
30
typedef
void (*
SITypeAndStatusCallback
)(
long
chan,
unsigned
long
type);
31
32
struct
SIControl
{
33
long
chan
;
34
unsigned
long
poll
;
35
unsigned
long
inputBytes
;
36
void
*
input
;
37
void (*
callback
)(long,
unsigned
long,
struct
OSContext
*);
38
};
39
40
struct
SIPacket
{
41
long
chan
;
42
void
*
output
;
43
unsigned
long
outputBytes
;
44
void
*
input
;
45
unsigned
long
inputBytes
;
46
void (*
callback
)(long,
unsigned
long,
struct
OSContext
*);
47
long
long
time
;
48
};
49
50
int
SIBusy
();
51
BOOL
SIIsChanBusy
(
int
chan);
52
BOOL
SIRegisterPollingHandler
(
__OSInterruptHandler
);
53
BOOL
SIUnregisterPollingHandler
(
__OSInterruptHandler
);
54
void
SIInit
();
55
unsigned
long
SISync
();
56
unsigned
long
SIGetStatus
(
int
);
57
void
SISetCommand
(
long
chan,
unsigned
long
command);
58
unsigned
long
SIGetCommand
(
long
chan);
59
void
SITransferCommands
();
60
unsigned
long
SISetXY
(
unsigned
long
x,
unsigned
long
y);
61
unsigned
long
SIEnablePolling
(
unsigned
long
poll);
62
unsigned
long
SIDisablePolling
(
unsigned
long
poll);
63
int
SIGetResponse
(
long
chan,
void
* data);
64
int
SITransfer
(
long
chan,
void
* output,
unsigned
long
outputBytes,
void
* input,
65
unsigned
long
inputBytes,
66
void
(*
callback
)(
long
,
unsigned
long
,
struct
OSContext
*),
67
OSTime
delay);
68
unsigned
long
SIGetType
(
long
chan);
69
unsigned
long
SIGetTypeAsync
(
long
chan,
SITypeAndStatusCallback
callback
);
70
71
#endif
// _DOLPHIN_OSSERIAL_H
SITransferCommands
void SITransferCommands()
SIInit
void SIInit()
SIGetStatus
unsigned long SIGetStatus(int)
SIUnregisterPollingHandler
BOOL SIUnregisterPollingHandler(__OSInterruptHandler)
SITypeAndStatusCallback
void(* SITypeAndStatusCallback)(long chan, unsigned long type)
Definition
OSSerial.h:30
SISetXY
unsigned long SISetXY(unsigned long x, unsigned long y)
SISetCommand
void SISetCommand(long chan, unsigned long command)
SIIsChanBusy
BOOL SIIsChanBusy(int chan)
SIDisablePolling
unsigned long SIDisablePolling(unsigned long poll)
SIGetCommand
unsigned long SIGetCommand(long chan)
SIBusy
int SIBusy()
SIRegisterPollingHandler
BOOL SIRegisterPollingHandler(__OSInterruptHandler)
SIGetTypeAsync
unsigned long SIGetTypeAsync(long chan, SITypeAndStatusCallback callback)
SITransfer
int SITransfer(long chan, void *output, unsigned long outputBytes, void *input, unsigned long inputBytes, void(*callback)(long, unsigned long, struct OSContext *), OSTime delay)
SISync
unsigned long SISync()
SIGetType
unsigned long SIGetType(long chan)
SIEnablePolling
unsigned long SIEnablePolling(unsigned long poll)
SIGetResponse
int SIGetResponse(long chan, void *data)
BOOL
int BOOL
Definition
types.h:20
callback
static void callback(HSD_GObj *gobj)
Definition
ftdonkeyspeciallw.c:89
hw_regs.h
__OSInterruptHandler
void(* __OSInterruptHandler)(__OSInterrupt interrupt, OSContext *context)
Definition
os.h:18
OSTime
s64 OSTime
Definition
os.h:10
OSContext
Definition
OSContext.h:138
SIControl
Definition
OSSerial.h:32
SIControl::callback
void(* callback)(long, unsigned long, struct OSContext *)
Definition
OSSerial.h:37
SIControl::input
void * input
Definition
OSSerial.h:36
SIControl::inputBytes
unsigned long inputBytes
Definition
OSSerial.h:35
SIControl::chan
long chan
Definition
OSSerial.h:33
SIControl::poll
unsigned long poll
Definition
OSSerial.h:34
SIPacket
Definition
OSSerial.h:40
SIPacket::input
void * input
Definition
OSSerial.h:44
SIPacket::callback
void(* callback)(long, unsigned long, struct OSContext *)
Definition
OSSerial.h:46
SIPacket::inputBytes
unsigned long inputBytes
Definition
OSSerial.h:45
SIPacket::time
long long time
Definition
OSSerial.h:47
SIPacket::outputBytes
unsigned long outputBytes
Definition
OSSerial.h:43
SIPacket::output
void * output
Definition
OSSerial.h:42
SIPacket::chan
long chan
Definition
OSSerial.h:41
extern
dolphin
include
dolphin
os
OSSerial.h
Generated by
1.17.0