C8051F32x firmware infrastructure

Sign in or create your account | Project List | Help

C8051F32x firmware infrastructure Git Source Tree

Root/fw/common/uart.h

1/*
2 * common/uart.h - UART initialization and debug output
3 *
4 * Written 2008 by Werner Almesberger
5 * Copyright 2008 Werner Almesberger
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 */
12
13
14#ifndef UART_H
15#define UART_H
16
17#include <stdint.h>
18#include <stdio.h>
19
20#include "config.h"
21
22
23#ifdef CONFIG_DEBUG
24#define debug printk
25#define CONFIG_PRINTK
26#else
27#define debug(...)
28#endif
29
30#ifdef CONFIG_ERROR
31#define error printk
32#define CONFIG_PRINTK
33#else
34#define error(...)
35#endif
36
37#ifdef CONFIG_PRINTK
38#define printk printf_fast
39#else
40#define printk(...)
41#endif
42
43void putchar(char c);
44void uart_init(uint8_t brg_mhz);
45
46#endif /* !UART_H */
47

Archive Download this file

Branches:
master



interactive