![]() |
|
|||
0001 /* SPDX-License-Identifier: BSD-3-Clause */ 0002 /* 0003 usa90msg.h 0004 0005 Copyright (c) 1998-2003 InnoSys Incorporated. All Rights Reserved 0006 This file is available under a BSD-style copyright 0007 0008 Keyspan USB Async Message Formats for the USA19HS 0009 0010 Redistribution and use in source and binary forms, with or without 0011 modification, are permitted provided that the following conditions are 0012 met: 0013 0014 1. Redistributions of source code must retain this licence text 0015 without modification, this list of conditions, and the following 0016 disclaimer. The following copyright notice must appear immediately at 0017 the beginning of all source files: 0018 0019 Copyright (c) 1998-2003 InnoSys Incorporated. All Rights Reserved 0020 0021 This file is available under a BSD-style copyright 0022 0023 2. The name of InnoSys Incorporated may not be used to endorse or promote 0024 products derived from this software without specific prior written 0025 permission. 0026 0027 THIS SOFTWARE IS PROVIDED BY INNOSYS CORP. ``AS IS'' AND ANY EXPRESS OR 0028 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 0029 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN 0030 NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 0031 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 0032 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 0033 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 0034 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 0035 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 0036 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 0037 SUCH DAMAGE. 0038 0039 Revisions: 0040 0041 2003feb14 add setTxMode/txMode and cancelRxXoff to portControl 0042 2003mar21 change name of PARITY_0/1 to add MARK/SPACE 0043 */ 0044 0045 #ifndef __USA90MSG__ 0046 #define __USA90MSG__ 0047 0048 struct keyspan_usa90_portControlMessage 0049 { 0050 /* 0051 there are three types of "commands" sent in the control message: 0052 0053 1. configuration changes which must be requested by setting 0054 the corresponding "set" flag (and should only be requested 0055 when necessary, to reduce overhead on the device): 0056 */ 0057 0058 u8 setClocking, // host requests baud rate be set 0059 baudLo, // host does baud divisor calculation 0060 baudHi, // host does baud divisor calculation 0061 0062 setLcr, // host requests lcr be set 0063 lcr, // use PARITY, STOPBITS, DATABITS below 0064 0065 setRxMode, // set receive mode 0066 rxMode, // RXMODE_DMA or RXMODE_BYHAND 0067 0068 setTxMode, // set transmit mode 0069 txMode, // TXMODE_DMA or TXMODE_BYHAND 0070 0071 setTxFlowControl, // host requests tx flow control be set 0072 txFlowControl , // use TX_FLOW... bits below 0073 setRxFlowControl, // host requests rx flow control be set 0074 rxFlowControl, // use RX_FLOW... bits below 0075 sendXoff, // host requests XOFF transmitted immediately 0076 sendXon, // host requests XON char transmitted 0077 xonChar, // specified in current character format 0078 xoffChar, // specified in current character format 0079 0080 sendChar, // host requests char transmitted immediately 0081 txChar, // character to send 0082 0083 setRts, // host requests RTS output be set 0084 rts, // 1=on, 0=off 0085 setDtr, // host requests DTR output be set 0086 dtr; // 1=on, 0=off 0087 0088 0089 /* 0090 2. configuration data which is simply used as is 0091 and must be specified correctly in every host message. 0092 */ 0093 0094 u8 rxForwardingLength, // forward when this number of chars available 0095 rxForwardingTimeout, // (1-31 in ms) 0096 txAckSetting; // 0=don't ack, 1=normal, 2-255 TBD... 0097 /* 0098 3. Firmware states which cause actions if they change 0099 and must be specified correctly in every host message. 0100 */ 0101 0102 u8 portEnabled, // 0=disabled, 1=enabled 0103 txFlush, // 0=normal, 1=toss outbound data 0104 txBreak, // 0=break off, 1=break on 0105 loopbackMode; // 0=no loopback, 1=loopback enabled 0106 0107 /* 0108 4. commands which are flags only; these are processed in order 0109 (so that, e.g., if rxFlush and rxForward flags are set, the 0110 port will have no data to forward); any non-zero value 0111 is respected 0112 */ 0113 0114 u8 rxFlush, // toss inbound data 0115 rxForward, // forward all inbound data, NOW (as if fwdLen==1) 0116 cancelRxXoff, // cancel any receive XOFF state (_txXoff) 0117 returnStatus; // return current status NOW 0118 }; 0119 0120 // defines for bits in lcr 0121 #define USA_DATABITS_5 0x00 0122 #define USA_DATABITS_6 0x01 0123 #define USA_DATABITS_7 0x02 0124 #define USA_DATABITS_8 0x03 0125 #define STOPBITS_5678_1 0x00 // 1 stop bit for all byte sizes 0126 #define STOPBITS_5_1p5 0x04 // 1.5 stop bits for 5-bit byte 0127 #define STOPBITS_678_2 0x04 // 2 stop bits for 6-8 bit byte 0128 #define USA_PARITY_NONE 0x00 0129 #define USA_PARITY_ODD 0x08 0130 #define USA_PARITY_EVEN 0x18 0131 #define PARITY_MARK_1 0x28 // force parity MARK 0132 #define PARITY_SPACE_0 0x38 // force parity SPACE 0133 0134 #define TXFLOW_CTS 0x04 0135 #define TXFLOW_DSR 0x08 0136 #define TXFLOW_XOFF 0x01 0137 #define TXFLOW_XOFF_ANY 0x02 0138 #define TXFLOW_XOFF_BITS (TXFLOW_XOFF | TXFLOW_XOFF_ANY) 0139 0140 #define RXFLOW_XOFF 0x10 0141 #define RXFLOW_RTS 0x20 0142 #define RXFLOW_DTR 0x40 0143 #define RXFLOW_DSR_SENSITIVITY 0x80 0144 0145 #define RXMODE_BYHAND 0x00 0146 #define RXMODE_DMA 0x02 0147 0148 #define TXMODE_BYHAND 0x00 0149 #define TXMODE_DMA 0x02 0150 0151 0152 // all things called "StatusMessage" are sent on the status endpoint 0153 0154 struct keyspan_usa90_portStatusMessage 0155 { 0156 u8 msr, // reports the actual MSR register 0157 cts, // reports CTS pin 0158 dcd, // reports DCD pin 0159 dsr, // reports DSR pin 0160 ri, // reports RI pin 0161 _txXoff, // port is in XOFF state (we received XOFF) 0162 rxBreak, // reports break state 0163 rxOverrun, // count of overrun errors (since last reported) 0164 rxParity, // count of parity errors (since last reported) 0165 rxFrame, // count of frame errors (since last reported) 0166 portState, // PORTSTATE_xxx bits (useful for debugging) 0167 messageAck, // message acknowledgement 0168 charAck, // character acknowledgement 0169 controlResponse; // (value = returnStatus) a control message has been processed 0170 }; 0171 0172 // bits in RX data message when STAT byte is included 0173 0174 #define RXERROR_OVERRUN 0x02 0175 #define RXERROR_PARITY 0x04 0176 #define RXERROR_FRAMING 0x08 0177 #define RXERROR_BREAK 0x10 0178 0179 #define PORTSTATE_ENABLED 0x80 0180 #define PORTSTATE_TXFLUSH 0x01 0181 #define PORTSTATE_TXBREAK 0x02 0182 #define PORTSTATE_LOOPBACK 0x04 0183 0184 // MSR bits 0185 0186 #define USA_MSR_dCTS 0x01 // CTS has changed since last report 0187 #define USA_MSR_dDSR 0x02 0188 #define USA_MSR_dRI 0x04 0189 #define USA_MSR_dDCD 0x08 0190 0191 #define USA_MSR_CTS 0x10 // current state of CTS 0192 #define USA_MSR_DSR 0x20 0193 #define USA_USA_MSR_RI 0x40 0194 #define MSR_DCD 0x80 0195 0196 // ie: the maximum length of an endpoint buffer 0197 #define MAX_DATA_LEN 64 0198 0199 #endif
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.1.0 LXR engine. The LXR team |
![]() ![]() |