00001 /* 00002 **************************************************************************** 00003 * 00004 * simulavr - A simulator for the Atmel AVR family of microcontrollers. 00005 * Copyright (C) 2001, 2002, 2003 Klaus Rudolph 00006 * 00007 * This program is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 2 of the License, or 00010 * (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00020 * 00021 **************************************************************************** 00022 * 00023 * $Id$ 00024 */ 00025 00026 #ifndef PINATPORT 00027 #define PINATPORT 00028 00029 class HWPort; 00030 class Pin; 00031 00032 class PinAtPort { 00033 protected: 00034 HWPort *port; 00035 unsigned char pinNo; 00036 00037 00038 00039 public: 00040 PinAtPort(); //dummy only used by admux !!!!! 00041 PinAtPort( HWPort *p, unsigned char pn); 00042 void SetPort(bool val); 00043 void SetDdr(bool val); 00044 00045 void SetAlternateDdr(bool val); 00046 void SetUseAlternateDdr(bool val); 00047 00048 void SetAlternatePort(bool val); 00049 void SetUseAlternatePort(bool val); 00050 00051 void SetUseAlternatePortIfDdrSet(bool val); 00052 00053 bool GetPort(); 00054 bool GetDdr(); 00055 bool GetAlternateDdr(); 00056 bool GetUseAlterateDdr(); 00057 bool GetAlternatePort(); 00058 bool GetUseAlternatePort(); 00059 bool GetUseAlternatePortIfDdrSet(); 00060 Pin& GetPin(); 00061 00062 operator bool(); 00063 int GetAnalog() const; 00064 00065 protected: 00066 void SetVal( unsigned char *adr, bool val); 00067 }; 00068 00069 #endif