1 | /*===============================================================*\ |
---|
2 | | Project: RTEMS configure remote gdb over serial line | |
---|
3 | +-----------------------------------------------------------------+ |
---|
4 | | File: termios_printk_cnf.h | |
---|
5 | +-----------------------------------------------------------------+ |
---|
6 | | Copyright (c) 2002 IMD | |
---|
7 | | Ingenieurbuero fuer Microcomputertechnik Th. Doerfler | |
---|
8 | | <Thomas.Doerfler@imd-systems.de> | |
---|
9 | | all rights reserved | |
---|
10 | +-----------------------------------------------------------------+ |
---|
11 | | this file declares intialization functions to add | |
---|
12 | | printk support via polled termios | |
---|
13 | | | |
---|
14 | +-----------------------------------------------------------------+ |
---|
15 | | date history ID | |
---|
16 | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
---|
17 | | 13.05.02 creation doe | |
---|
18 | \*===============================================================*/ |
---|
19 | /* |
---|
20 | * $Id$ |
---|
21 | */ |
---|
22 | #ifndef _TERMIOS_PRINTK_CNF_H |
---|
23 | #define _TERMIOS_PRINTK_CNF_H |
---|
24 | |
---|
25 | #include <rtems/termios_printk.h> |
---|
26 | |
---|
27 | #ifdef __cplusplus |
---|
28 | extern "C" { |
---|
29 | #endif |
---|
30 | |
---|
31 | #ifdef CONFIGURE_INIT |
---|
32 | |
---|
33 | /* |
---|
34 | * fallback for baud rate to use |
---|
35 | */ |
---|
36 | #ifndef CONFIGURE_TERMIOS_PRINTK_BAUDRATE |
---|
37 | #define CONFIGURE_TERMIOS_PRINTK_BAUDRATE 9600 |
---|
38 | #endif |
---|
39 | |
---|
40 | /* |
---|
41 | * fallback for device name to use |
---|
42 | */ |
---|
43 | #ifndef CONFIGURE_TERMIOS_PRINTK_DEVNAME |
---|
44 | #define CONFIGURE_TERMIOS_PRINTK_DEVNAME "/dev/console" |
---|
45 | #endif |
---|
46 | |
---|
47 | #ifdef CONFIGURE_USE_TERMIOS_PRINTK |
---|
48 | /* |
---|
49 | * fill in termios_printk_conf structure |
---|
50 | */ |
---|
51 | termios_printk_conf_t termios_printk_conf = { |
---|
52 | CONFIGURE_TERMIOS_PRINTK_BAUDRATE, |
---|
53 | |
---|
54 | #ifdef CONFIGURE_TERMIOS_PRINTK_CALLOUT |
---|
55 | CONFIGURE_TERMIOS_PRINTK_CALLOUT, |
---|
56 | #else |
---|
57 | NULL, |
---|
58 | #endif |
---|
59 | CONFIGURE_TERMIOS_PRINTK_DEVNAME, |
---|
60 | }; |
---|
61 | #endif |
---|
62 | |
---|
63 | int termios_printk_init(void) { |
---|
64 | #ifdef CONFIGURE_USE_TERMIOS_PRINTK |
---|
65 | return termios_printk_open(termios_printk_conf.devname, |
---|
66 | termios_printk_conf.baudrate); |
---|
67 | #else |
---|
68 | return 0; |
---|
69 | #endif |
---|
70 | } |
---|
71 | |
---|
72 | #endif /* CONFIGURE_INIT */ |
---|
73 | |
---|
74 | #ifdef __cplusplus |
---|
75 | } |
---|
76 | #endif |
---|
77 | |
---|
78 | #endif /* _TERMIOS_PRINTK_CNF_H */ |
---|