LibXenon
Bare-metal Xbox 360 homebrew library
Loading...
Searching...
No Matches
libxenon
drivers
xenon_uart
xenon_uart.c
Go to the documentation of this file.
1
#include <stdint.h>
2
3
#define BASE 0xea001000
4
5
void
putch
(
unsigned
char
c
)
6
{
7
if
(
c
==
'\n'
)
putch
(
'\r'
);
8
9
while
(!((*(
volatile
uint32_t
*)(
BASE
+ 0x18))&0x02000000));
10
*(
volatile
uint32_t
*)(
BASE
+ 0x14) = (
c
<< 24) & 0xFF000000;
11
}
12
13
int
kbhit
(
void
)
14
{
15
uint32_t
status
;
16
17
do
18
status
= *(
volatile
uint32_t
*)(
BASE
+ 0x18);
19
while
(
status
& ~0x03000000);
20
21
return
!!(
status
& 0x01000000);
22
}
23
24
int
getch
(
void
)
25
{
26
while
(!
kbhit
());
27
return
(*(
volatile
uint32_t
*)(
BASE
+ 0x10)) >> 24;
28
}
29
30
void
uart_puts
(
unsigned
char
*s)
31
{
32
while
(*s)
putch
(*s++);
33
}
status
u32 status
Definition:
ehci_defs.h:15
uint32_t
u32 uint32_t
Definition:
libfdt_env.h:11
putch
void putch(unsigned char c)
Definition:
xenon_uart.c:5
BASE
#define BASE
Definition:
xenon_uart.c:3
uart_puts
void uart_puts(unsigned char *s)
Definition:
xenon_uart.c:30
kbhit
int kbhit(void)
Definition:
xenon_uart.c:13
getch
int getch(void)
Definition:
xenon_uart.c:24
c
u8 c
Definition:
xenos_edid.h:7
Generated by
1.9.5