Main Page   Data Structures   File List   Data Fields   Globals   Related Pages  

clib/fossil.h

Go to the documentation of this file.
00001 /****************************************************************************
00002 *
00003 * (C) 2001 by Beck IPC GmbH
00004 *
00005 *  Beck IPC GmbH
00006 *  Garbenheimerstr. 36-38
00007 *  D-35578 Wetzlar
00008 *
00009 *  Phone : (49)-6441-905-240
00010 *  Fax   : (49)-6441-905-245
00011 
00012 $Header: fossil.h, 6, 13.06.2002 16:29:12, Christoph Stoidner$
00013 
00014 *
00015 * ---------------------------------------------------------------------------
00016 * Module        : fossil.h
00017 *
00018 * Function      : prototypes, constants for fossil functions
00019 *                 functions must should be used with program memory model large!
00020 *
00021 * Author        : Detlef Gerhardt
00022 * Date          : 10.01.01
00023 * ---------------------------------------------------------------------------
00024 
00025 
00026 $Log:
00027  6    IPC@CHIP  1.5         13.06.2002 16:29:12  Christoph Stoidner add
00028       fossil_send_break() and fossil_get_bytes_in_uart()
00029  5    IPC@CHIP  1.4         16.01.2002 14:15:53  Christoph Stoidner add an
00030       semicolon
00031  4    IPC@CHIP  1.3         14.01.2002 13:18:05  Christoph Stoidner correct
00032       comments, add new functions
00033  3    IPC@CHIP  1.2         16.11.2001 12:18:11  Ernest Schlösser Added comments
00034  2    IPC@CHIP  1.1         28.03.2001 16:00:30  Christoph Stoidner Bugfix: add
00035       Parameter Values to RS485 Mode Macros
00036  1    IPC@CHIP  1.0         09.03.2001 16:35:57  Christoph Stoidner
00037 $
00038 
00039 
00040 * History       :
00041 *
00042 *  Vx.yy                   Author  Changes
00043 *
00044 *             10.01.01      db    Create
00045               10.01.02      cs    add FossilDriverInfo_t
00046 /****************************************************************************/
00047 #ifndef __FOSSIL_H__
00048 #define __FOSSIL_H__
00049 /****************************************************************************/
00050 
00051 // constants
00052 #define FOSSIL_EXT 0
00053 #define FOSSIL_COM 1
00054 
00055 // parity
00056 #define FOSSIL_PARITY_NO 0
00057 #define FOSSIL_PARITY_ODD 1
00058 #define FOSSIL_PARITY_EVEN 2
00059 #define FOSSIL_PARITY_MARK 3
00060 #define FOSSIL_PARITY_SPACE 4
00061 
00062 // status
00063 #define FOSSIL_OUTPUT_BUFFER_EMPTY 0x40
00064 #define FOSSIL_OUTPUT_NOT_FULL 0x20
00065 #define FOSSIL_LINE_BREAK 0x10
00066 #define FOSSIL_FRAMING_ERROR 0x08
00067 #define FOSSIL_PARITY_ERROR 0x04
00068 #define FOSSIL_OVERRUN_ERROR 0x02
00069 #define FOSSIL_DATA_AVAILABLE 0x01
00070 
00071 // flowcontrol
00072 #define FOSSIL_FLOWCTRL_OFF 0x00
00073 #define FOSSIL_FLOWCTRL_XONXOFF_SEND 0x01
00074 #define FOSSIL_FLOWCTRL_RTSCTS 0x02
00075 #define FOSSIL_FLOWCTRL_XONXOFF_RECV 0x08
00076 
00077 // RS485 mode
00078 #define FOSSIL_RS485_LOWACTIVE       0
00079 #define FOSSIL_RS485_HIGHACTIVE      1
00080 #define FOSSIL_RS485_DISABLE         2
00081 
00082 
00083 // type definitions
00084 typedef struct
00085 {
00086   unsigned       size;          // structure size
00087   unsigned char  version;       // (not used)
00088   unsigned char  level;         // (not used)
00089   char          *id;            // (not used)
00090   unsigned       inputBuffSize; // input buffer size
00091   unsigned       inputAvaiable; // bytes available on Input buffer
00092   unsigned       outputBuffSize;// output buffer size
00093   unsigned       ouputAvaiable; // bytes available on Output buffer
00094   unsigned char  screenWidth;   // (not used)
00095   unsigned char  screenHeight;  // (not used)
00096   unsigned char  baudrateMask;  // (not used)
00097 } FossilDriverInfo_t;
00098 
00099 
00100 
00101 // procedures
00102 int fossil_init(int port);   // ret 0 if o.k.
00103 void fossil_deinit(int port);
00104 int fossil_setbaud(int port, long baudrate, int parity, int wordlen, int stopbits);
00105 int fossil_putbyte_wait(int port, int ch);
00106 int fossil_putbyte(int port, int ch);
00107 int fossil_getbyte_wait(int port);
00108 int fossil_peek_input(int port);    // ret char in buffer, -1 if none available
00109 int fossil_status_request(int port);
00110 void fossil_flush_output(int port);
00111 void fossil_purge_output(int port);
00112 void fossil_purge_input(int port);
00113 void fossil_set_flowcontrol(int port, int flowctrl);
00114 unsigned int fossil_readblock(int port, unsigned char *buffer, unsigned int count);
00115 unsigned int fossil_writeblock(int port, unsigned char *buffer, unsigned int count);
00116 void fossil_set_rs485(int port, int mode);
00117 void fossil_set_rs485_txenable(int port, int pin);
00118 void fossil_set_extctrl(int port, int divider, int parity, int wordlen, int stopbits);
00119 int fossil_get_driver_info(int port, FossilDriverInfo_t *drv_info);
00120 void fossil_send_break(int port, unsigned char longbreak );
00121 int fossil_get_bytes_in_uart(int port);
00122 
00123 /*************************************************************************/
00124 #endif /* __FOSSIL_H__ */
00125 /****************************************************************************/
00126 // end of file
00127 /****************************************************************************/

Generated on Sun Aug 4 21:47:27 2002 for k/os mp3v2 by doxygen1.2.16