00001 00002 // Title : DIO.h 00003 // Project : OSCAR Version 2.0 00004 // Created : 04/08/04 00005 // Author : Chetan Kapoor 00006 // Platforms : All 00007 // Copyright : The University of Texas at Austin, 2002. All rights reserved. 00008 // 00009 // This software and documentation constitute an unpublished work 00010 // and contain valuable trade secrets and proprietary information 00011 // belonging to University. None of the foregoing material may be 00012 // copied or duplicated or disclosed without the express, written 00013 // permission of University. UNIVERSITY EXPRESSLY DISCLAIMS ANY 00014 // AND ALL WARRANTIES CONCERNING THIS SOFTWARE AND DOCUMENTATION, 00015 // INCLUDING ANY WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 00016 // PARTICULAR PURPOSE, AND WARRANTIES OF PERFORMANCE, AND ANY WARRANTY 00017 // THAT MIGHT OTHERWISE ARISE FROM COURSE OF DEALING OR USAGE OF TRADE. 00018 // NO WARRANTY IS EITHER EXPRESS OR IMPLIED WITH RESPECT TO THE USE OF 00019 // THE SOFTWARE OR DOCUMENTATION. Under no circumstances shall 00020 // University be liable for incidental, special, indirect, direct or 00021 // consequential damages or loss of profits, interruption of business, 00022 // or related expenses which may arise from use of software or documentation, 00023 // including but not limited to those resulting from defects in software 00024 // and/or documentation, or loss or inaccuracy of data of any kind. 00025 // 00026 // Purpose : Abstract class for digital IO 00027 //----------------------------------------------------------------------------- 00028 // 00029 // 00031 00032 #ifndef DIO_h 00033 #define DIO_h 00034 00035 #include "Base/Base.h" 00036 00038 namespace OSCAR { 00039 00046 class DIO : public Base 00047 { 00048 public: 00049 enum PortDirection {Input, Output}; 00050 00061 DIO(const String& name = String(), OSCARError& err = DUMMY_ERROR(noError)); 00062 00066 virtual ~DIO(){} 00067 00068 bool SetPortDirection(DIO::PortDirection direction); 00069 00070 DIO::PortDirection GetPortDirection() const; 00079 virtual bool ReadDI(unsigned int channel, bool& state) = 0; 00080 00089 virtual bool WriteDI(unsigned int channel, bool state) = 0; 00090 00091 protected: 00092 PortDirection direction; 00093 }; 00094 00095 #include "IODevices/DIO.ipp" 00096 00097 } 00098 #endif // DIO_h
| RRG Homepage | OSCAR Overview | OSCAR Tutorials | Simulations |