]> rtime.felk.cvut.cz Git - fpga/virtex2/uart.git/blob - software/uart.c
+ PWM output capability.
[fpga/virtex2/uart.git] / software / uart.c
1 #include "hardware.h"
2 #include "uart.h"
3
4 int putchar(int c) {
5   while (USTAT & 0x20) {}
6   UTX = c;
7   return 0;
8 }
9
10 int getchar() {
11   while (!(USTAT & 0x10)) {}
12   return URX;
13 }
14
15 int isRxEmpty() {
16   return (~USTAT) & 0x10;
17 }