![](https://csdnimg.cn/release/download_crawler_static/86575868/bg1.jpg)
Cport
Serial Communications Library for C/C++
Version 2.0
Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.
![](https://csdnimg.cn/release/download_crawler_static/86575868/bg2.jpg)
Copyright (c) 1993 Bri Productions - all rights reserved
Cport is a registered trademark of Bri Productions. All other product
and
brand names are trademarks or registered trademarks of their
respective
holders.
Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.
![](https://csdnimg.cn/release/download_crawler_static/86575868/bg3.jpg)
i
Contents
========
Introduction
------------
General Description ............................. 1-1
Disclaimer ...................................... 1-2
Evaluation Copy ................................. 1-2
Purchase Version ................................ 1-2
Contacting Bri Productions ..................... 1-2
Terminology ..................................... 1-3
Using Cport
-----------
Basics .......................................... 2-1
Buffered Input .................................. 2-3
Buffered Output ................................. 2-5
Handshaking ..................................... 2-7
Direct Transmit Mode ............................ 2-10
Theory of Operation
-------------------
The UART ........................................ 3-1
The Transmitter and Receiver .................... 3-1
The Transmit and Receive Queues ................. 3-2
Input and Output Functions ...................... 3-2
Control and Status Functions .................... 3-2
Direct Transmit mode ............................ 3-2
C Reference
-----------
Typedefs and Structures ......................... 4-1
COM .......................................... 4-2
CPARAM ....................................... 4-2
byte ......................................... 4-3
Global Variables ................................ 4-4
comopen_errno ................................ 4-4
Control Functions ............................... 4-5
ComOpen ...................................... 4-6
Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.
![](https://csdnimg.cn/release/download_crawler_static/86575868/bg4.jpg)
ComOpenS ..................................... 4-8
ComClose ..................................... 4-8
ComCloseAll .................................. 4-9
ComHandshake ................................. 4-9
ComParam ..................................... 4-10
ComBaud ...................................... 4-11
ComMode ...................................... 4-12
ComRxQ ....................................... 4-13
ComTxQ ....................................... 4-14
ComTx ........................................ 4-15
ComNS550 ..................................... 4-15
ComTurbo ..................................... 4-16
Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.
![](https://csdnimg.cn/release/download_crawler_static/86575868/bg5.jpg)
ii
Input Functions ................................. 4-18
ComGetc ...................................... 4-19
ComGets ...................................... 4-19
ComIn ........................................ 4-20
ComFlushRx ................................... 4-21
ComLenRx ..................................... 4-22
ComPeek ...................................... 4-22
ComRxScan .................................... 4-23
Output Functions ................................ 4-25
ComPutc ...................................... 4-26
ComPuts ...................................... 4-26
ComOut ....................................... 4-27
ComFlushTx ................................... 4-28
ComLenTx ..................................... 4-29
ComTxWait .................................... 4-29
Status Functions ................................ 4-31
ComError ..................................... 4-32
ComStatus .................................... 4-33
ComRts ....................................... 4-33
ComDtr ....................................... 4-34
ComOut1 ...................................... 4-35
ComUart ...................................... 4-35
Data Integrity .................................. 4-37
ComChecksum .................................. 4-38
ComCrc16 ..................................... 4-38
ComCrc32 ..................................... 4-39
Misc Functions .................................. 4-41
ComSetBreak .................................. 4-42
ComClrBreak .................................. 4-42
ComPutScrtch ................................. 4-43
ComGetScrtch ................................. 4-43
C++ Reference
-------------
Control Functions ............................... 5-1
Cport::Cport ................................. 5-2
Cport::operator int .......................... 5-4
Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.