UniSet  1.4.0
DigitalCard_O5600.h
См. документацию.
00001 /* This file is part of the UniSet project
00002  * Copyright (c) 2002 Free Software Foundation, Inc.
00003  * Copyright (c) 2002 Vitaly Lipatov
00004  *
00005  * This program is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation; either version 2 of the License, or
00008  * (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00018  */
00019 // --------------------------------------------------------------------------
00024 // -------------------------------------------------------------------------- 
00025 #ifndef __DIO5600_H_
00026 #define __DIO5600_H_
00027 // --------------------------------------------------------------------------
00028 #include "DigitalCard.h"
00029 #include "IOs/IOAccessOld.h"
00030 
00031 //  портов для функций ввода/вывода
00032 const int DIO5600_A = 0x10;
00033 const int DIO5600_B = 0x02;
00034 const int DIO5600_C_LO = 0x01;
00035 const int DIO5600_C_HI = 0x08;
00036 const int DIO5600_C = (DIO5600_C_LO | DIO5600_C_HI);
00037 
00038 class DigitalCard_O5600: public DigitalCard, IOAccess
00039 {
00040     public:
00041         //inline    DIO5600() { }
00042         inline  DigitalCard_O5600(int ba, char mode)
00043     {
00044         init(1, 0, ba, mode);
00045     }
00046 
00047         bool    get(int module);
00048     //  bool    getCurrentState(int module);
00049         void    set(int module, bool state);
00050 
00051     protected:
00052     //  void    reinit();
00053         char    getMask(int module);
00054         char    getPrevious(int module);
00055         int     getPort(int module);
00056         void    putByte(int port, char val);
00057         int     getByte(int ba);
00058 
00059         bool    init(bool flagInit, int numOfCard, int base_address,char mode);
00060         int     baseadr;    //
00061         char    iomode;     //
00062         char    portmap[4];
00063 
00064 
00065 };
00066 #endif