source: rtems/cpukit/include/rtems/console.h @ 2afb22b

Last change on this file since 2afb22b was ac28f15, checked in by Sebastian Huber <sebastian.huber@…>, on Nov 3, 2017 at 7:33:16 AM

Add simple console driver

Update #3170.
Update #3199.

  • Property mode set to 100644
File size: 4.3 KB
Line 
1/**
2 * @file
3 *
4 * @brief Console Driver for all Boards
5 *
6 * This file describes the Console Device Driver for all boards.
7 * This driver provides support for the standard C Library.
8 */
9
10/*
11 *  COPYRIGHT (c) 1989-2011.
12 *  On-Line Applications Research Corporation (OAR).
13 *
14 *  The license and distribution terms for this file may be
15 *  found in the file LICENSE in this distribution or at
16 *  http://www.rtems.org/license/LICENSE.
17 */
18
19#ifndef _RTEMS_CONSOLE_H
20#define _RTEMS_CONSOLE_H
21
22#include <rtems/io.h> /* rtems_device_driver */
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28/**
29 * This macro defines the standard name for the console device
30 * that is available to applications.
31 */
32#define CONSOLE_DEVICE_NAME "/dev/console"
33
34/**
35 * This macro defines the standard device driver table entry for
36 * a console device driver.
37 */
38#define CONSOLE_DRIVER_TABLE_ENTRY \
39  { console_initialize, console_open, console_close, \
40    console_read, console_write, console_control }
41
42/**
43 * @brief Console initialization entry point.
44 *
45 * This method initializes the console device driver.
46 *
47 * @param[in] major is the device driver major number.
48 * @param[in] minor is the device driver minor number.
49 * @param[in] arg is the parameters to this call.
50 *
51 * @retval RTEMS_SUCCESSFUL The device driver is successfully initialized.
52 */
53rtems_device_driver console_initialize(
54  rtems_device_major_number  major,
55  rtems_device_minor_number  minor,
56  void                      *arg
57);
58
59/**
60 * @brief Console open entry point.
61 *
62 * This method opens a specific device supported by the
63 * console device driver.
64 *
65 * @param[in] major is the device driver major number
66 * @param[in] minor is the device driver minor number
67 * @param[in] arg is the parameters to this call
68 *
69 * @retval RTEMS_SUCCESSFUL The device driver is successfully opened.
70 */
71rtems_device_driver console_open(
72  rtems_device_major_number  major,
73  rtems_device_minor_number  minor,
74  void                      *arg
75);
76
77/**
78 * @brief Console close entry point.
79 *
80 * This method closes a specific device supported by the
81 * console device driver.
82 *
83 * @param[in] major is the device driver major number
84 * @param[in] minor is the device driver minor number
85 * @param[in] arg is the parameters to this call
86 *
87 * @retval RTEMS_SUCCESSFUL The device driver is successfully closed.
88 */
89rtems_device_driver console_close(
90  rtems_device_major_number  major,
91  rtems_device_minor_number  minor,
92  void                      *arg
93);
94
95/**
96 * @brief Console read entry point.
97 *
98 * This method reads from a specific device supported by the
99 * console device driver.
100 *
101 * @param[in] major is the device driver major number
102 * @param[in] minor is the device driver minor number
103 * @param[in] arg is the parameters to this call
104 *
105 * @retval RTEMS_SUCCESSFUL The device is successfully read from.
106 */
107rtems_device_driver console_read(
108  rtems_device_major_number  major,
109  rtems_device_minor_number  minor,
110  void                      *arg
111);
112
113/**
114 * @brief Console write entry point.
115 *
116 * This method writes to a specific device supported by the
117 * console device driver.
118 *
119 * @param[in] major is the device driver major number
120 * @param[in] minor is the device driver minor number
121 * @param[in] arg is the parameters to this call
122 *
123 * @retval RTEMS_SUCCESSFUL The device is successfully written.
124 */
125rtems_device_driver console_write(
126  rtems_device_major_number  major,
127  rtems_device_minor_number  minor,
128  void                      *arg
129);
130
131/**
132 * @brief Console IO control entry point.
133 *
134 * This method performs an IO Control operation on a
135 * specific device supported by the console device driver.
136 *
137 * @param[in] major is the device driver major number
138 * @param[in] minor is the device driver minor number
139 * @param[in] arg is the parameters to this call
140 *
141 * @retval RTEMS_SUCCESSFUL the device driver IO control operation is
142 *         successfully performed.
143 */
144rtems_device_driver console_control(
145  rtems_device_major_number  major,
146  rtems_device_minor_number  minor,
147  void                      *arg
148);
149
150/**
151 * @brief Initializes a simple console device.
152 *
153 * This device writes via rtems_putc() and reads via getchark().  The Termios
154 * framework is not used.  There is no support to change device settings, e.g.
155 * baud, stop bits, parity, etc.
156 */
157void _Console_simple_Initialize( void );
158
159#ifdef __cplusplus
160}
161#endif
162
163#endif
164/* end of include file */
Note: See TracBrowser for help on using the repository browser.