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