[PATCH 2/4] bsps: Basic console driver for Termios devices

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Jul 7 11:39:17 UTC 2014


---
 c/src/lib/libbsp/shared/console-termios.c |   73 +++++++++++++++++++++++++++++
 1 files changed, 73 insertions(+), 0 deletions(-)
 create mode 100644 c/src/lib/libbsp/shared/console-termios.c

diff --git a/c/src/lib/libbsp/shared/console-termios.c b/c/src/lib/libbsp/shared/console-termios.c
new file mode 100644
index 0000000..f57b06c
--- /dev/null
+++ b/c/src/lib/libbsp/shared/console-termios.c
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2014 embedded brains GmbH.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Dornierstr. 4
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems at embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#include <rtems/console.h>
+#include <rtems/termiostypes.h>
+
+rtems_device_driver console_open(
+  rtems_device_major_number  major,
+  rtems_device_minor_number  minor,
+  void                      *arg
+)
+{
+  return rtems_termios_device_open( major, minor, arg );
+}
+
+rtems_device_driver console_close(
+  rtems_device_major_number  major,
+  rtems_device_minor_number  minor,
+  void                      *arg
+)
+{
+  (void) major;
+  (void) minor;
+
+  return rtems_termios_device_close( arg );
+}
+
+rtems_device_driver console_read(
+  rtems_device_major_number  major,
+  rtems_device_minor_number  minor,
+  void                      *arg
+)
+{
+  (void) major;
+  (void) minor;
+
+  return rtems_termios_read( arg );
+}
+
+rtems_device_driver console_write(
+  rtems_device_major_number  major,
+  rtems_device_minor_number  minor,
+  void                      *arg
+)
+{
+  (void) major;
+  (void) minor;
+
+  return rtems_termios_write( arg );
+}
+
+rtems_device_driver console_control(
+  rtems_device_major_number  major,
+  rtems_device_minor_number  minor,
+  void                      *arg
+)
+{
+  (void) major;
+  (void) minor;
+
+  return rtems_termios_ioctl( arg );
+}
-- 
1.7.7




More information about the devel mailing list