/usr/include/gpsim/tmr0.h is in gpsim-dev 0.29.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | /*
Copyright (C) 1998,1999,2000 T. Scott Dattalo
This file is part of the libgpsim library of gpsim
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, see
<http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
#ifndef __TMR0_H__
#define __TMR0_H__
#include "ioports.h"
#include "interface.h"
class TMR0_Interface;
class T1GCON;
//---------------------------------------------------------
// TMR0 - Timer
class TMR0 : public sfr_register, public TriggerObject, public SignalSink
{
public:
unsigned int
prescale,
prescale_counter,
old_option, // Save option register contents here.
state; // Either on or off right now.
guint64
synchronized_cycle,
future_cycle;
gint64
last_cycle; // can be negative ...
OPTION_REG *m_pOptionReg;
virtual void callback();
TMR0(Processor *, const char *pName, const char *pDesc=0);
virtual void release();
virtual void put(unsigned int new_value);
virtual void put_value(unsigned int new_value);
virtual unsigned int get();
virtual unsigned int get_value();
virtual void start(int new_value,int sync=0);
virtual void stop();
virtual void increment(); // Used when tmr0 is attached to an external clock
virtual void new_prescale();
virtual unsigned int get_prescale();
virtual unsigned int max_counts() {return 256;};
virtual bool get_t0cs();
virtual bool get_t0se();
virtual void set_t0if();
virtual void set_t0xcs(bool _t0xcs){t0xcs = _t0xcs;}
virtual bool get_t0xcs() {return t0xcs;}
virtual void reset(RESET_TYPE r);
virtual void callback_print();
virtual void clear_trigger();
virtual void set_cpu(Processor *, PortRegister *, unsigned int pin,OPTION_REG *);
virtual void set_cpu(Processor *new_cpu, PinModule *pin,OPTION_REG *);
virtual void setSinkState(char);
virtual void sleep();
virtual void wake();
void set_t1gcon(T1GCON *_t1gcon) { m_t1gcon = _t1gcon; }
enum {
STOPPED = 0,
RUNNING = 1,
SLEEPING = 2
};
protected:
T1GCON *m_t1gcon;
private:
bool m_bLastClockedState;
bool t0xcs; // clock source is the capacitive sensing oscillator
TMR0_Interface *tmr0_interface;
};
#endif
|