simulavr  1.1.0
CLKPRRegister Class Reference

Implement CLKPR register. More...

#include <rwmem.h>

Inheritance diagram for CLKPRRegister:

Public Member Functions

 CLKPRRegister (AvrDevice *core, TraceValueRegister *registry)
 
void Reset (void)
 
unsigned int CpuCycle (void)
 
- Public Member Functions inherited from RWMemoryMember
 RWMemoryMember (TraceValueRegister *registry, const std::string &tracename="", const int index=-1)
 
 RWMemoryMember (void)
 
 operator unsigned char () const
 Read access on memory. More...
 
unsigned char operator= (unsigned char val)
 Write access on memory. More...
 
unsigned char operator= (const RWMemoryMember &mm)
 Write access on memory. More...
 
virtual ~RWMemoryMember ()
 
virtual void set_bit (unsigned int bitaddr)
 
virtual void clear_bit (unsigned int bitaddr)
 
const std::string & GetTraceName (void)
 
bool IsInvalid (void) const
 
- Public Member Functions inherited from Hardware
 Hardware (AvrDevice *core)
 
virtual ~Hardware ()
 
virtual void ClearIrqFlag (unsigned int vector)
 
virtual bool IsLevelInterrupt (unsigned int vector)
 
virtual bool LevelInterruptPending (unsigned int vector)
 

Protected Member Functions

unsigned char get () const
 
void set (unsigned char v)
 

Private Attributes

AvrDevice_core
 
unsigned char value
 
unsigned char activate
 

Additional Inherited Members

- Protected Attributes inherited from RWMemoryMember
TraceValuetv
 
TraceValueRegisterregistry
 
const std::string tracename
 
const bool isInvalid
 

Detailed Description

Implement CLKPR register.

Definition at line 135 of file rwmem.h.

Constructor & Destructor Documentation

◆ CLKPRRegister()

CLKPRRegister::CLKPRRegister ( AvrDevice core,
TraceValueRegister registry 
)

Member Function Documentation

◆ CpuCycle()

unsigned int CLKPRRegister::CpuCycle ( void  )
virtual

Called for each AVR cycle when this hardware has registered itself as a receiver for AVR clocks. Returns nonzero if instructions should not be executed (e.g. a Flash write is in progress).

Reimplemented from Hardware.

Definition at line 112 of file rwmem.cpp.

References activate, and value.

◆ get()

unsigned char CLKPRRegister::get ( ) const
inlineprotectedvirtual

This function as the oppposite to get() is expected to read the real byte.

Implements RWMemoryMember.

Definition at line 146 of file rwmem.h.

◆ Reset()

void CLKPRRegister::Reset ( void  )
virtual

Implement the hardware's reset functionality here. The default is no action on reset.

Reimplemented from Hardware.

Definition at line 104 of file rwmem.cpp.

References _core, activate, AvrFuses::FB_CKDIV8, AvrDevice::fuses, AvrFuses::GetFuseBit(), and value.

◆ set()

void CLKPRRegister::set ( unsigned char  nv)
protectedvirtual

This function is the function which will be called by the above access operators and is expected to do the real work when writing a byte.

Implements RWMemoryMember.

Definition at line 121 of file rwmem.cpp.

References activate, avr_warning, int2str(), and value.

Member Data Documentation

◆ _core

AvrDevice* CLKPRRegister::_core
private

Definition at line 150 of file rwmem.h.

Referenced by CLKPRRegister(), and Reset().

◆ activate

unsigned char CLKPRRegister::activate
private

Definition at line 152 of file rwmem.h.

Referenced by CLKPRRegister(), CpuCycle(), Reset(), and set().

◆ value

unsigned char CLKPRRegister::value
private

Definition at line 151 of file rwmem.h.

Referenced by CLKPRRegister(), CpuCycle(), Reset(), and set().


The documentation for this class was generated from the following files: