home *** CD-ROM | disk | FTP | other *** search
/ Virtual Reality Zone / VRZONE.ISO / mac / PC / REND386 / JIREND / SERIAL.H < prev    next >
C/C++ Source or Header  |  1993-04-11  |  2KB  |  59 lines

  1. // serial.h
  2. // C functions prototypes for routines in serial.c
  3. #ifndef SERIAL_DEFINES
  4. #define SERIAL_DEFINES
  5.   
  6. int com_install(int portnum, int tx_size, int rx_size);
  7. void com_deinstall(int portnum);
  8. void com_set_speed(int portnum, long speed);
  9. void com_set_parity(int portnum, enum par_code parity, int stop_bits);
  10. void com_lower_dtr(int portnum);
  11. void com_raise_dtr(int portnum);
  12. void com_pulse_rts(int portnum);
  13. void com_tx(int portnum, char c);
  14. void com_tx_string(int portnum, char *s);
  15. int  com_tx_ready(int portnum);
  16. int  com_tx_empty(int portnum);
  17. unsigned char com_rx(int portnum);
  18. int  com_rx_empty(int portnum);
  19. int com_rx_count(int portnum);
  20. void com_flush_tx(int portnum);
  21. void com_flush_rx(int portnum);
  22. int  com_carrier(int portnum);
  23. int com_cts(int portnum);
  24. int com_modem_stat(int portnum);
  25.   
  26. // *********************************
  27. enum par_code  { COM_NONE, COM_EVEN, COM_ODD, COM_ZERO, COM_ONE };
  28. // *********************************
  29.   
  30. // Modem status register bits
  31.   
  32. #define DCTS    0x01                    /* Delta clear to send */
  33. #define DDSR    0x02                    /* Delta data set ready */
  34. #define TERI    0x04                    /* Trailing edge ring indicator */
  35. #define DRLSD   0x08                    /* Delta Rx line signal detect */
  36. #define CTS     0x10                    /* Clear to send */
  37. #define DSR     0x20                    /* Data set ready */
  38. #define RI      0x40                    /* Ring indicator */
  39. #define RLSD    0x80                    /* Receive line signal detect */
  40.   
  41. // Line control register bits
  42.   
  43. #define DATA5   0x00        /* 5 Data bits */
  44. #define DATA6   0x01        /* 6 Data bits */
  45. #define DATA7   0x02        /* 7 Data bits */
  46. #define DATA8   0x03        /* 8 Data bits */
  47.   
  48. #define STOP1   0x00        /* 1 Stop bit */
  49. #define STOP2   0x04        /* 2 Stop bits */
  50.   
  51. #define NOPAR   0x00        /* No parity */
  52. #define ODDPAR  0x08        /* Odd parity */
  53. #define EVNPAR  0x18        /* Even parity */
  54. #define STKPAR  0x28        /* Stick parity */
  55. #define ZROPAR  0x38        /* Zero parity */
  56.   
  57. // *********************************
  58. #endif // SERIAL_DEFINES
  59.