/usr/include/gpsim/16bit-tmrs.h is in gpsim-dev 0.29.0-2+b2.
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 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | /*
Copyright (C) 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 __16_BIT_TMRS_H__
#define __16_BIT_TMRS_H__
#include "14bit-tmrs.h"
//---------------------------------------------------------
// T5CON - Timer 1,3,5 control register
class T5CON : public T1CON
{
public:
enum
{
TMRxON = 1<<0,
TxRD16 = 1<<1,
TxSYNC = 1<<2,
TxSOSCEN = 1<<3,
TxCKPS0 = 1<<4,
TxCKPS1 = 1<<5,
TMRxCS0 = 1<<6,
TMRxCS1 = 1<<7,
};
// TMRL *tmrl;
//RRRTMR1_Freq_Attribute *freq_attribute;
T5CON(Processor *pCpu, const char *pName, const char *pDesc=0);
~T5CON();
//RRR unsigned int get();
// For (at least) the 18f family, there's a 4X PLL that effects the
// the relative timing between gpsim's cycle counter (which is equivalent
// to the cumulative instruction count) and the external oscillator. In
// all parts, the clock source for the timer is fosc, the external oscillator.
// However, for the 18f parts, the instructions execute 4 times faster when
// the PLL is selected.
virtual unsigned int get_prescale()
{
return(((value.get() &(TxCKPS0 | TxCKPS1)) >> 4) );
}
virtual unsigned int get_tmr1cs()
{
return((value.get() & (TMRxCS0 | TMRxCS1)) >> 6);
}
virtual bool get_tmr1on()
{
return(value.get() & TMRxON);
}
virtual bool get_t1oscen()
{
return(value.get() & TxSOSCEN);
}
virtual bool get_tmr1GE()
{
return t1gcon->get_tmr1GE();
}
virtual bool get_t1sync()
{
return(value.get() & TxSYNC);
}
virtual void put(unsigned int new_value);
virtual bool get_t1GINV() {return true;}
T1GCON *t1gcon;
};
class CCPTMRS;
class CCPTMRS0 : public sfr_register
{
public:
CCPTMRS0(CCPTMRS *_ccptmrs, Processor *pCpu, const char *pName, const char *pDesc=0);
~CCPTMRS0();
virtual void put(unsigned int new_value);
unsigned int bit_mask;
CCPTMRS *ccptmrs;
};
class CCPTMRS1 : public sfr_register
{
public:
CCPTMRS1(CCPTMRS * _ccptmrs, Processor *pCpu, const char *pName, const char *pDesc=0);
~CCPTMRS1();
virtual void put(unsigned int new_value);
unsigned int bit_mask;
CCPTMRS *ccptmrs;
};
class CCPTMRS
{
public:
enum
{
C1TSEL0 = 1<<0,
C1TSEL1 = 1<<1,
C2TSEL0 = 1<<3,
C2TSEL1 = 1<<4,
C3TSEL0 = 1<<6,
C3TSEL1 = 1<<7,
C4TSEL0 = 1<<0,
C4TSEL1 = 1<<1,
C5TSEL0 = 1<<2,
C5TSEL1 = 1<<3,
};
CCPTMRS(Processor *pCpu);
~CCPTMRS();
void update0(unsigned int reg_value);
void update1(unsigned int reg_value);
//void set_tmr135(TMR5 *t1, TMR5 *t3, TMR5 *t5);
void set_tmr246(TMR2 *t2, TMR2 *t4, TMR2 *t6);
void set_ccp(CCPCON *_c1, CCPCON *_c2, CCPCON *_c3, CCPCON *_c4, CCPCON *_c5);
void change(CCPCON *c, unsigned int old, unsigned int val);
CCPTMRS0 ccptmrs0;
CCPTMRS1 ccptmrs1;
//TMR5 *t1, *t3, *t5;
TMR2 *t2, *t4, *t6;
CCPCON *ccp1, *ccp2, *ccp3, *ccp4, *ccp5;
unsigned int last_value0;
unsigned int last_value1;
};
#endif // __16_BIT_TMRS_H__
|