26 #ifndef TIMERPRESCALER 27 #define TIMERPRESCALER 29 #include "../hardware.h" 30 #include "../avrdevice.h" 32 #include "../pinatport.h" 57 const std::string &tracename,
62 const std::string &tracename,
70 if(preScaleValue > 1023) preScaleValue = 0;
77 void Reset(){ preScaleValue = 0; }
88 const std::string &tracename,
96 const std::string &tracename,
118 #endif // TIMERPRESCALER Basic AVR device, contains the core functionality.
bool pinstate
saved pin status of osc. pin
PinAtPort tosc_pin
input pin for external timer oscillator
Extends HWPrescaler with a external clock oszillator pin.
IOSpecialReg * resetRegister
instance of IO register with reset bits
int _resetBit
holds bit position for reset bit on IO register
Interface class to connect hardware units to control registers.
unsigned char set_from_reg(const IOSpecialReg *reg, unsigned char nv)
IO register interface set method, see IOSpecialRegClient.
IOSpecialReg * asyncRegister
instance of IO register with assr bits
int clockSelectBit
holds bit position of counter clock select
bool clockselect
holds the clock select state, true is external clock
void Reset()
Reset method, sets prescaler counter to 0.
int _resetSyncBit
holds sync bit position for prescaler reset synchronisation
Prescaler unit for support timers with clock.
unsigned short preScaleValue
prescaler counter value
unsigned short GetValue()
Get method for current prescaler counter value.
HWPrescaler(AvrDevice *core, const std::string &tracename)
Creates HWPrescaler instance without reset feature.
virtual unsigned int CpuCycle()
Count functionality for prescaler.
unsigned char get_from_client(const IOSpecialReg *reg, unsigned char v)
IO register interface get method, see IOSpecialRegClient.