source: rtems/c/src/libchip/serial/serial.h @ 7deeb16

4.104.114.84.95
Last change on this file since 7deeb16 was 36152b0e, checked in by Joel Sherrill <joel.sherrill@…>, on Jun 22, 1998 at 11:08:16 AM

Moved get and set register/data typedefs to this file.

  • Property mode set to 100644
File size: 2.6 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
27/*
28 *  Types for get and set register routines
29 */
30
31typedef unsigned8 (*getRegister_f)(unsigned32 port, unsigned8 register);
32typedef void      (*setRegister_f)(
33                            unsigned32 port, unsigned8 reg, unsigned8 value);
34typedef unsigned8 (*getData_f)(unsigned32 port);
35typedef void      (*setData_f)(unsigned32 port, unsigned8 value);
36
37typedef struct _console_fns {
38  boolean (*deviceProbe)(int minor);
39  int     (*deviceFirstOpen)(int major, int minor, void *arg);
40  int     (*deviceLastClose)(int major, int minor, void *arg);
41  int     (*deviceRead)(int minor);
42  int     (*deviceWrite)(int minor, const char *buf, int len);
43  void    (*deviceInitialize)(int minor);
44  void    (*deviceWritePolled)(int minor, char cChar);
45  int       deviceOutputUsesInterrupts;
46} console_fns;
47
48typedef struct _console_flow {
49  int (*deviceStopRemoteTx)(int minor);
50  int (*deviceStartRemoteTx)(int minor);
51} console_flow;
52
53typedef struct _console_tbl {
54  char          *sDeviceName;
55  console_fns   *pDeviceFns;
56  boolean      (*deviceProbe)(int minor);
57  console_flow  *pDeviceFlow;
58  unsigned32     ulMargin;
59  unsigned32     ulHysteresis;
60  void          *pDeviceParams;
61  unsigned32     ulCtrlPort1;
62  unsigned32     ulCtrlPort2;
63  unsigned32     ulDataPort;
64  getRegister_f  getRegister;
65  setRegister_f  setRegister;
66  getData_f      getData;
67  setData_f      setData;
68  unsigned32     ulClock;
69  unsigned int   ulIntVector;
70} console_tbl;
71
72typedef struct _console_data {
73  void                   *termios_data;
74  volatile boolean        bActive;
75  volatile Ring_buffer_t  TxBuffer;
76  /*
77   * This field may be used for any purpose required by the driver
78   */
79  void                   *pDeviceContext;
80} console_data;
81
82extern console_tbl  Console_Port_Tbl[];
83extern console_data Console_Port_Data[];
84extern unsigned long  Console_Port_Count;
85
86#endif
87/* end of include file */
Note: See TracBrowser for help on using the repository browser.