source: rtems/c/src/libchip/serial/serial.h @ cd58d82

4.104.114.84.95
Last change on this file since cd58d82 was ee3b242b, checked in by Joel Sherrill <joel.sherrill@…>, on 06/13/98 at 16:03:57

Initial incarnation of libchip compiles.

  • Property mode set to 100644
File size: 2.4 KB
Line 
1/*
2 *  This file contains the TTY driver table definition
3 *
4 *  This driver uses the termios pseudo driver.
5 *
6 *  COPYRIGHT (c) 1998 by Radstone Technology
7 *
8 *
9 * THIS FILE IS PROVIDED TO YOU, THE USER, "AS IS", WITHOUT WARRANTY OF ANY
10 * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
11 * IMPLIED WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK
12 * AS TO THE QUALITY AND PERFORMANCE OF ALL CODE IN THIS FILE IS WITH YOU.
13 *
14 * You are hereby granted permission to use, copy, modify, and distribute
15 * this file, provided that this notice, plus the above copyright notice
16 * and disclaimer, appears in all copies. Radstone Technology will provide
17 * no support for this code.
18 *
19 *  $Id$
20 */
21
22#ifndef __LIBCHIP_SERIAL_h
23#define __LIBCHIP_SERIAL_h
24
25#include <ringbuf.h>
26
27typedef struct _console_fns {
28        boolean (*deviceProbe)(int minor);
29        int     (*deviceFirstOpen)(int major, int minor, void *arg);
30        int     (*deviceLastClose)(int major, int minor, void *arg);
31        int     (*deviceRead)(int minor);
32        int     (*deviceWrite)(int minor, const char *buf, int len);
33        void    (*deviceInitialize)(int minor);
34        void    (*deviceWritePolled)(int minor, char cChar);
35        int     deviceOutputUsesInterrupts;
36} console_fns;
37
38typedef struct _console_flow {
39        int     (*deviceStopRemoteTx)(int minor);
40        int     (*deviceStartRemoteTx)(int minor);
41} console_flow;
42
43typedef struct _console_tbl {
44        char            *sDeviceName;
45        console_fns     *pDeviceFns;
46        boolean         (*deviceProbe)(int minor);
47        console_flow    *pDeviceFlow;
48        unsigned32      ulMargin;
49        unsigned32      ulHysteresis;
50        void            *pDeviceParams;
51        unsigned32      ulCtrlPort1;
52        unsigned32      ulCtrlPort2;
53        unsigned32      ulDataPort;
54        unsigned8       (*getRegister)(unsigned32 port, unsigned8 register);
55        void            (*setRegister)(
56                            unsigned32 port, unsigned8 reg, unsigned8 value);
57        unsigned8       (*getData)(unsigned32 port);
58        void            (*setData)(unsigned32 port, unsigned8 value);
59        unsigned32      ulClock;
60        unsigned int    ulIntVector;
61} console_tbl;
62
63typedef struct _console_data {
64        void    *termios_data;
65        volatile boolean        bActive;
66        volatile Ring_buffer_t  TxBuffer;
67        /*
68         * This field may be used for any purpose required by the driver
69         */
70        void    *pDeviceContext;
71} console_data;
72
73extern console_tbl      Console_Port_Tbl[];
74extern console_data     Console_Port_Data[];
75extern unsigned long    Console_Port_Count;
76
77#endif
78/* end of include file */
Note: See TracBrowser for help on using the repository browser.