home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / psion / opp16f_zip / INCLUDE / P / SERIAL.OPH < prev    next >
Encoding:
Text File  |  1995-12-21  |  3.4 KB  |  122 lines

  1. #define P_SERIAL_OPH
  2.  
  3. #ifndef P_FRAME_OPH
  4. #include <p\frame>
  5. #endif
  6.  
  7. /* Serial port characteristics */
  8.  
  9. STRUCT P_SRCHAR
  10.     tbaud#
  11.     rbaud#
  12.     frame#
  13.     parity#
  14.     hand#
  15.     xon#
  16.     xoff#
  17.     flags#
  18.     tmask&
  19. ENDS
  20.  
  21. /* Baud rates */
  22.  
  23. #define P_BAUD_50  0x01
  24. #define P_BAUD_75  0x02
  25. #define P_BAUD_110  0x03
  26. #define P_BAUD_134  0x04
  27. #define P_BAUD_150  0x05
  28. #define P_BAUD_300  0x06
  29. #define P_BAUD_600  0x07
  30. #define P_BAUD_1200 0x08
  31. #define P_BAUD_1800 0x09
  32. #define P_BAUD_2000 0x0A
  33. #define P_BAUD_2400 0x0B
  34. #define P_BAUD_3600 0x0C
  35. #define P_BAUD_4800 0x0D
  36. #define P_BAUD_7200 0x0E
  37. #define P_BAUD_9600 0x0F
  38. #define P_BAUD_19200 0x10
  39. #define P_BAUD_38400 0x11
  40. #define P_BAUD_56000 0x12
  41. #define P_BAUD_115000 0x13
  42.  
  43. /* allocation of frame bits */
  44.  
  45. #define P_DATA_FRM 0x0f /* number of data bits mask */ 
  46. #define P_DATA_5 0 /* 5 data bits */ 
  47. #define P_DATA_6 1 /* 6 data bits */ 
  48. #define P_DATA_7 2 /* 7 data bits */ 
  49. #define P_DATA_8 3 /* 8 data bits */ 
  50. #define P_TWOSTOP 0x10 /* 2 stop bits if set,1 if clear */ 
  51. #define P_PARITY 0x20 /* 1 parity bit if set,0 if clear */ 
  52.  
  53. /* parity - ignored unless P_PARITY is set */
  54.  
  55. #define P_PAR_EVEN 1 /* even parity */ 
  56. #define P_PAR_ODD 2 /* odd parity */ 
  57. #define P_PAR_MARK 3 /* mark parity */ 
  58. #define P_PAR_SPACE 4 /* space parity */ 
  59.  
  60. /* handshaking control */
  61.  
  62. #define P_OBEY_XOFF 0x01 /* respond to received XOFF (and XON) if set */ 
  63. #define P_SEND_XOFF 0x02 /* send XOFF/XON to control receive buffer if set */ 
  64. #define P_IGN_CTS 0x04 /* ignore the state of CTS if set */ 
  65. #define P_OBEY_DSR 0x08 /* obey the state of DSR if set */ 
  66. #define P_FAIL_DSR 0x10 /* fail if DSR goes OFF if set */ 
  67. #define P_OBEY_DCD 0x20 /* obey the state of DCD if set */ 
  68. #define P_FAIL_DCD 0x40 /* fail if DCD goes OFF if set */ 
  69.  
  70. /* flags control */
  71.  
  72. #define P_IGNORE_PARITY 0x01  /* ignore parity errors */ 
  73.  
  74. /* For P_FCTRL function */
  75.  
  76. #define P_SRCTRL_CTS 0x01
  77. #define P_SRCTRL_DSR 0x02
  78. #define P_SRCTRL_DCD 0x04
  79. #define P_SRCTRL_RTS 0x08
  80. #define P_SRCTRL_DTR 0x10
  81. #define P_SRDTR_ON 1 /* to set DTR to MARK */ 
  82. #define P_SRDTR_OFF 2 /* to set DTR to SPACE */ 
  83.  
  84. /* Bit masks for P_FINQ function */
  85.  
  86. #define P_SRINQ_50  0x0001
  87. #define P_SRINQ_75  0x0002
  88. #define P_SRINQ_110  0x0004
  89. #define P_SRINQ_134  0x0008
  90. #define P_SRINQ_150  0x0010
  91. #define P_SRINQ_300  0x0020
  92. #define P_SRINQ_600  0x0040
  93. #define P_SRINQ_1200 0x0080
  94. #define P_SRINQ_1800 0x0100
  95. #define P_SRINQ_2000 0x0200
  96. #define P_SRINQ_2400 0x0400
  97. #define P_SRINQ_3600 0x0800
  98. #define P_SRINQ_4800 0x1000
  99. #define P_SRINQ_7200 0x2000
  100. #define P_SRINQ_9600 0x4000
  101. #define P_SRINQ_19200 0x8000
  102.  
  103. /* second baud rate word */
  104.  
  105. #define P_SRINQ_38400 0x0001
  106. #define P_SRINQ_56000 0x0002
  107.  
  108. /* 2nd set of info */
  109.  
  110. #define P_SRINQ_DATA5 0x0001 /* supports 5 data bits */ 
  111. #define P_SRINQ_DATA6 0x0002 /* supports 6 data bits */ 
  112. #define P_SRINQ_DATA7 0x0004 /* supports 7 data bits */ 
  113. #define P_SRINQ_DATA8 0x0008 /* supports 8 data bits */ 
  114. #define P_SRINQ_STOP2 0x0010 /* supports 2 stop bits (as well as 1) */ 
  115. #define P_SRINQ_PAREVEN 0x0020 /* supports even parity */ 
  116. #define P_SRINQ_PARODD 0x0040 /* supports odd parity */ 
  117. #define P_SRINQ_PARMARK 0x0080 /* supports mark parity */ 
  118. #define P_SRINQ_PARSPACE 0x0100 /* supports space parity */ 
  119. #define P_SRINQ_SETDTR 0x0200 /* can set DTR */ 
  120. #define P_SRINQ_SPLIT 0x400 /* supports split Baud rates */ 
  121. #define P_SRINQ_XONXOFF 0x800 /* Supports soft xon/xoff characters */ 
  122.