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

Subversion Repositories or1200_soc

[/] [or1200_soc/] [trunk/] [boards/] [de1_board/] [sw/] [tests/] [debug/] [serial.c] - Rev 22

Compare with Previous | Blame | View Log

//
//
//
 
#include "de1_or1200.h"
#include "serial.h"
 
 
//
// use 57600 baud
 
void init_serial( void )
{
 	REG8(0x50000003) = 0x83;
	REG8(0x50000001) = 0x00;
// 	REG8(0x50000000) = 0x06;
	REG8(0x50000000) = 0x1a;  // 57600 baud w/ clk=24MHz
// 	REG8(0x50000000) = 0x2b; // 57600 baud w/ clk=40MHz
	REG8(0x50000003) = 0x03;
	REG8(0x50000002) = 0x01;
 
}
 
void NS16550_putc( char c )
{
	while ( (LSR_BASE & LSR_THRE) == 0);
	THR_BASE = c;
}
 
 
int puts( char *s )
{
	while (*s) {
		NS16550_putc (*s++);
	}
}
 
 
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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