OpenCores
URL https://opencores.org/ocsvn/or1200_soc/or1200_soc/trunk

Subversion Repositories or1200_soc

[/] [or1200_soc/] [trunk/] [boards/] [de1_board/] [sw/] [tests/] [uboot/] [serial.c] - Blame information for rev 25

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 25 qaztronic
//
2
//
3
//
4
 
5
#include "de1_or1200.h"
6
#include "serial.h"
7
 
8
 
9
//
10
// use 57600 baud
11
 
12
void init_serial( void )
13
{
14
        REG8(0x50000003) = 0x83;
15
        REG8(0x50000001) = 0x00;
16
//      REG8(0x50000000) = 0x06;
17
        REG8(0x50000000) = 0x1a;  // 57600 baud w/ clk=24MHz
18
//      REG8(0x50000000) = 0x2b; // 57600 baud w/ clk=40MHz
19
        REG8(0x50000003) = 0x03;
20
        REG8(0x50000002) = 0x01;
21
 
22
}
23
 
24
void NS16550_putc( char c )
25
{
26
        while ( (LSR_BASE & LSR_THRE) == 0);
27
        THR_BASE = c;
28
}
29
 
30
 
31
int puts( char *s )
32
{
33
        while (*s) {
34
                NS16550_putc (*s++);
35
        }
36
}
37
 
38
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.