1 |
1026 |
ivang |
/*===============================================================*\
|
2 |
|
|
| Project: RTEMS remote gdb over serial line |
|
3 |
|
|
+-----------------------------------------------------------------+
|
4 |
|
|
| File: termios_printk.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 polled output via termios polled drivers |
|
13 |
|
|
| |
|
14 |
|
|
+-----------------------------------------------------------------+
|
15 |
|
|
| date history ID |
|
16 |
|
|
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
17 |
|
|
| 13.04.02 creation doe |
|
18 |
|
|
\*===============================================================*/
|
19 |
|
|
/*
|
20 |
|
|
* termios_printk.h,v 1.1 2002/06/27 21:25:14 joel Exp
|
21 |
|
|
*/
|
22 |
|
|
#ifndef _TERMIOS_PRINTK_H
|
23 |
|
|
#define _TERMIOS_PRINTK_H
|
24 |
|
|
|
25 |
|
|
#include <rtems.h>
|
26 |
|
|
#include <termios.h>
|
27 |
|
|
|
28 |
|
|
typedef struct {
|
29 |
|
|
unsigned32 baudrate; /* debug baud rate, e.g. 57600 */
|
30 |
|
|
void (*callout)(void); /* callout pointer during polling */
|
31 |
|
|
const char *devname; /* debug device, e.g. "/dev/tty01" */
|
32 |
|
|
} termios_printk_conf_t;
|
33 |
|
|
|
34 |
|
|
/*
|
35 |
|
|
* must be defined in init module...
|
36 |
|
|
*/
|
37 |
|
|
extern termios_printk_conf_t termios_printk_conf;
|
38 |
|
|
|
39 |
|
|
/*=========================================================================*\
|
40 |
|
|
| Function: |
|
41 |
|
|
\*-------------------------------------------------------------------------*/
|
42 |
|
|
void termios_printk_outputchar
|
43 |
|
|
/*-------------------------------------------------------------------------*\
|
44 |
|
|
| Purpose: |
|
45 |
|
|
| send one character to serial port |
|
46 |
|
|
+---------------------------------------------------------------------------+
|
47 |
|
|
| Input Parameters: |
|
48 |
|
|
\*-------------------------------------------------------------------------*/
|
49 |
|
|
(
|
50 |
|
|
char c /* character to print */
|
51 |
|
|
);
|
52 |
|
|
/*-------------------------------------------------------------------------*\
|
53 |
|
|
| Return Value: |
|
54 |
|
|
| <none> |
|
55 |
|
|
\*=========================================================================*/
|
56 |
|
|
|
57 |
|
|
/*=========================================================================*\
|
58 |
|
|
| Function: |
|
59 |
|
|
\*-------------------------------------------------------------------------*/
|
60 |
|
|
char termios_printk_inputchar
|
61 |
|
|
/*-------------------------------------------------------------------------*\
|
62 |
|
|
| Purpose: |
|
63 |
|
|
| wait for one character from serial port |
|
64 |
|
|
+---------------------------------------------------------------------------+
|
65 |
|
|
| Input Parameters: |
|
66 |
|
|
\*-------------------------------------------------------------------------*/
|
67 |
|
|
(
|
68 |
|
|
void /* none */
|
69 |
|
|
);
|
70 |
|
|
/*-------------------------------------------------------------------------*\
|
71 |
|
|
| Return Value: |
|
72 |
|
|
| received character |
|
73 |
|
|
\*=========================================================================*/
|
74 |
|
|
|
75 |
|
|
|
76 |
|
|
/*=========================================================================*\
|
77 |
|
|
| Function: |
|
78 |
|
|
\*-------------------------------------------------------------------------*/
|
79 |
|
|
int termios_printk_open
|
80 |
|
|
|
81 |
|
|
/*-------------------------------------------------------------------------*\
|
82 |
|
|
| Purpose: |
|
83 |
|
|
| try to open given serial debug port |
|
84 |
|
|
+---------------------------------------------------------------------------+
|
85 |
|
|
| Input Parameters: |
|
86 |
|
|
\*-------------------------------------------------------------------------*/
|
87 |
|
|
(
|
88 |
|
|
const char *dev_name, /* name of device to open */
|
89 |
|
|
unsigned32 baudrate /* baud rate to use */
|
90 |
|
|
);
|
91 |
|
|
/*-------------------------------------------------------------------------*\
|
92 |
|
|
| Return Value: |
|
93 |
|
|
| 0 on success, -1 and errno otherwise |
|
94 |
|
|
\*=========================================================================*/
|
95 |
|
|
#endif /* _TERMIOS_PRINTK_H */
|