home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / communic / tcasync / tasync.h < prev    next >
Encoding:
C/C++ Source or Header  |  1987-10-21  |  1.6 KB  |  47 lines

  1. /*
  2.    a set  of Turbo-C functions to support
  3.    interrupt driven serial i/o.
  4.    Written by Joe DeRosa 07/87 and released in the Public Domain
  5.    input and output are buffered line and modem status drivers are also
  6.    interrupt driven. tested upto 9600 baud all code is written in "C".
  7.    thanks to Borland Low level hooks that are available in Turbo-C.
  8.    thanks to Glenn F. Marshall for his Pascal code.
  9.    thanks to Curt Klinsing for his assembler routines.
  10. */
  11.  
  12. /* return count of characters in input buffer */
  13. #define inp_cnt() in_c_ct
  14.  
  15. /* word size */
  16. #define BIT7 2
  17. #define BIT8 3
  18. /* stop bits */
  19. #define STOP1 0
  20. #define STOP2 4
  21. /* parity */
  22. #define NONE 0
  23. #define ODD 8
  24. #define EVEN 24
  25. /* baud rate */
  26. #define B300 384
  27. #define B1200 96
  28. #define B2400 48
  29. #define B4800 24
  30. #define B9600 12
  31. #define B19200 6
  32.  
  33. #ifndef TASYNC
  34. extern int in_c_ct,modstat;        /* for count and carrier macros */
  35. void setport(int prot,int baud);   /* setup the serial port */
  36. /* prot is word | stop | parity    ex: setport(BIT8|STOP1|NONE,B1200) */
  37. int carrier(void);
  38. int getport(void);                 /* returns modem & line status
  39.                                       bits same as in ibm tech manual */
  40. void flush_port(void);             /* flushes input and output buffers */
  41. void uninit(void);                 /* remove interrupt */
  42. void scrstat(void);                /* modem lights (don't call to often)*/
  43. void comout(char c);               /* que character in buffer */
  44. char inp_char(void);               /* get one char from buffer, */
  45. void init_com(void);               /* initialize the comm port, */
  46. #endif
  47.