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

Subversion Repositories amber

[/] [amber/] [trunk/] [sw/] [boot-loader-ethmac/] [serial.c] - Blame information for rev 81

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 78 csantifort
/*----------------------------------------------------------------
2
//                                                              //
3
//  boot-loader-ethmac.c                                        //
4
//                                                              //
5
//  This file is part of the Amber project                      //
6
//  http://www.opencores.org/project,amber                      //
7
//                                                              //
8
//  Description                                                 //
9
//  The main functions for the boot loader application. This    //
10
//  application is embedded in the FPGA's SRAM and is used      //
11
//  to load larger applications into the DDR3 memory on         //
12
//  the development board.                                      //
13
//                                                              //
14
//  Author(s):                                                  //
15
//      - Conor Santifort, csantifort.amber@gmail.com           //
16
//                                                              //
17
//////////////////////////////////////////////////////////////////
18
//                                                              //
19
// Copyright (C) 2010-2013 Authors and OPENCORES.ORG            //
20
//                                                              //
21
// This source file may be used and distributed without         //
22
// restriction provided that this copyright statement is not    //
23
// removed from the file and that any derivative work contains  //
24
// the original copyright notice and the associated disclaimer. //
25
//                                                              //
26
// This source file is free software; you can redistribute it   //
27
// and/or modify it under the terms of the GNU Lesser General   //
28
// Public License as published by the Free Software Foundation; //
29
// either version 2.1 of the License, or (at your option) any   //
30
// later version.                                               //
31
//                                                              //
32
// This source is distributed in the hope that it will be       //
33
// useful, but WITHOUT ANY WARRANTY; without even the implied   //
34
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      //
35
// PURPOSE.  See the GNU Lesser General Public License for more //
36
// details.                                                     //
37
//                                                              //
38
// You should have received a copy of the GNU Lesser General    //
39
// Public License along with this source; if not, download it   //
40
// from http://www.opencores.org/lgpl.shtml                     //
41
//                                                              //
42
----------------------------------------------------------------*/
43
#include "amber_registers.h"
44
 
45
 
46 81 csantifort
#define DEBUG 1
47
 
48
#ifdef DEBUG
49
    #define trace(fmt, args...) print_serial("%s:%s:%d: "fmt"\n\r", __FILE__, __FUNCTION__, __LINE__, args)
50
#else
51
    #define trace(fmt, args...)
52
#endif
53
 
54
 
55
 
56 78 csantifort
void init_serial()
57
{
58
    /* Enable UART 0 */
59
    *(unsigned int *) ADR_AMBER_UART0_LCRH = 0x10;
60
}
61
 
62
 
63 81 csantifort
 
64 78 csantifort
/* Add a line to the line buffer */
65
void print_serial(const char *fmt, ...)
66
{
67
    int len;
68
    register unsigned long *varg = (unsigned long *)(&fmt);
69
    *varg++;
70
 
71
    /* Need to pass a pointer to a pointer to the location to
72
       write the character, to that the pointer to the location
73
       can be incremented by the final output function
74
    */
75
    len = print(0, fmt, varg);
76
}
77
 

powered by: WebSVN 2.1.0

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