fp@0: /************************************************************************************************** fp@0: * fp@0: * aip_com.h fp@0: * fp@0: * Macros für Kommunikation über serielle Schnittstelle fp@0: * Basiert auf rt_com.h von rtai !! (siehe unten) fp@0: * fp@0: * fp@0: * Autor: Wilhelm Hagemeister fp@0: * fp@0: * (C) Copyright IgH 2002 fp@0: * Ingenieurgemeinschaft IgH fp@0: * Heinz-Bäcker Str. 34 fp@0: * D-45356 Essen fp@0: * Tel.: +49 201/61 99 31 fp@0: * Fax.: +49 201/61 98 36 fp@0: * E-mail: hm@igh-essen.com fp@0: * fp@0: * fp@0: * $RCSfile: aip_com.h,v $ fp@0: * $Revision: 1.1 $ fp@0: * $Author: hm $ fp@0: * $Date: 2004/09/30 15:50:32 $ fp@0: * $State: Exp $ fp@0: * fp@0: * fp@0: * fp@0: * fp@0: * fp@0: * fp@0: * fp@0: * fp@0: * fp@0: **************************************************************************************************/ fp@0: fp@0: /** rt_com fp@0: * ====== fp@0: * fp@0: * RT-Linux kernel module for communication across serial lines. fp@0: * fp@0: * Copyright (C) 1997 Jens Michaelsen fp@0: * Copyright (C) 1997-2000 Jochen Kupper fp@0: * Copyright (C) 2002 Giuseppe Renoldi fp@0: * fp@0: * This program is free software; you can redistribute it and/or fp@0: * modify it under the terms of the GNU General Public License as fp@0: * published by the Free Software Foundation; either version 2 of the fp@0: * License, or (at your option) any later version. fp@0: * fp@0: * This program is distributed in the hope that it will be useful, but fp@0: * WITHOUT ANY WARRANTY; without even the implied warranty of fp@0: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU fp@0: * General Public License for more details. fp@0: * fp@0: * You should have received a copy of the GNU General Public License fp@0: * along with this program; see the file License. if not, write to the fp@0: * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, fp@0: * MA 02111-1307, USA. fp@0: * fp@0: * $Id: aip_com.h,v 1.1 2004/09/30 15:50:32 hm Exp $ */ fp@0: fp@0: fp@0: fp@0: #ifndef AIP_COM_H fp@0: #define AIP_COM_H fp@0: fp@0: /** This is the interface definition of the plain rt_com API. fp@0: * fp@0: * This should be all you need to use rt_com within your real-time fp@0: * kernel module. fp@0: * fp@0: * (When POSIX is done, we will reference the appropriate header fp@0: * here - probably depending on a flag.) */ fp@0: fp@0: int init_aip_com(void); //Hm, IgH fp@0: void cleanup_aip_com(void); //Hm, IgH fp@0: fp@0: fp@0: /** specify hardware parameters, set-up communication parameters */ fp@0: extern int rt_com_hwsetup( unsigned int ttyS, int base, int irq ); fp@0: extern int rt_com_setup( unsigned int ttyS, int baud, int mode, fp@0: unsigned int parity, unsigned int stopbits, fp@0: unsigned int wordlength, int fifotrig ); fp@0: fp@0: /** read/write from/to input/output buffer */ fp@0: extern int rt_com_read( unsigned int, char *, int ); fp@0: extern int rt_com_write( unsigned int ttyS, char *buffer, int count ); fp@0: fp@0: /** clear input or output buffer */ fp@0: extern int rt_com_clear_input( unsigned int ttyS ); fp@0: extern int rt_com_clear_output( unsigned int ttyS ); fp@0: fp@0: /** read input signal from modem (CTS,DSR,RI,DCD), set output signal fp@0: * for modem control (DTR,RTS) */ fp@0: extern int rt_com_read_modem( unsigned int ttyS, int signal ); fp@0: extern int rt_com_write_modem( unsigned int ttyS, int signal, int value ); fp@0: fp@0: /** functioning mode and fifo trigger setting */ fp@0: extern int rt_com_set_mode( unsigned int ttyS, int mode); fp@0: extern int rt_com_set_fifotrig( unsigned int ttyS, int fifotrig); fp@0: fp@0: /** return last error detected */ fp@0: extern int rt_com_error( unsigned int ttyS ); fp@0: fp@0: fp@0: /** size of internal queues, this is constant during module lifetime */ fp@0: extern unsigned int rt_com_buffersize; fp@0: fp@0: #define rt_com_set_param rt_com_hwsetup fp@0: #define rt_com_setup_old(a,b,c,d,e) rt_com_setup((a),(b),0,(c),(d),(e),-1) fp@0: fp@0: fp@0: /** functioning modes */ fp@0: #define RT_COM_NO_HAND_SHAKE 0x00 fp@0: #define RT_COM_DSR_ON_TX 0x01 fp@0: #define RT_COM_HW_FLOW 0x02 fp@0: fp@0: /** parity flags */ fp@0: #define RT_COM_PARITY_EVEN 0x18 fp@0: #define RT_COM_PARITY_NONE 0x00 fp@0: #define RT_COM_PARITY_ODD 0x08 fp@0: #define RT_COM_PARITY_HIGH 0x28 fp@0: #define RT_COM_PARITY_LOW 0x38 fp@0: fp@0: /* FIFO Control */ fp@0: #define RT_COM_FIFO_DISABLE 0x00 fp@0: #define RT_COM_FIFO_SIZE_1 0x00 fp@0: #define RT_COM_FIFO_SIZE_4 0x40 fp@0: #define RT_COM_FIFO_SIZE_8 0x80 fp@0: #define RT_COM_FIFO_SIZE_14 0xC0 fp@0: fp@0: /** rt_com_write_modem masks */ fp@0: #define RT_COM_DTR 0x01 fp@0: #define RT_COM_RTS 0x02 fp@0: fp@0: /** rt_com_read_modem masks */ fp@0: #define RT_COM_CTS 0x10 fp@0: #define RT_COM_DSR 0x20 fp@0: #define RT_COM_RI 0x40 fp@0: #define RT_COM_DCD 0x80 fp@0: fp@0: /** rt_com_error masks */ fp@0: #define RT_COM_BUFFER_FULL 0x01 fp@0: #define RT_COM_OVERRUN_ERR 0x02 fp@0: #define RT_COM_PARITY_ERR 0x04 fp@0: #define RT_COM_FRAMING_ERR 0x08 fp@0: #define RT_COM_BREAK 0x10 fp@0: fp@0: fp@0: #endif /* RT_COM_H */ fp@0: fp@0: fp@0: fp@0: /** fp@0: * Local Variables: fp@0: * mode: C fp@0: * c-file-style: "Stroustrup" fp@0: * End: fp@0: */