#include <hwad.h>
Public Member Functions | |
HWAd (AvrDevice *core, HWAdmux *m, HWIrqSystem *, Pin &aref, unsigned int irqVec) | |
unsigned int | CpuCycle () |
unsigned char | GetAdch () |
unsigned char | GetAdcl () |
unsigned char | GetAdcsr () |
void | Reset () |
void | SetAdcsr (unsigned char) |
void | ClearIrqFlag (unsigned int vec) |
Public Attributes | |
IOReg< HWAd > | adch_reg |
IOReg< HWAd > | adcl_reg |
IOReg< HWAd > | adcsr_reg |
Protected Types | |
enum | T_State { IDLE, INIT, RUNNING } |
Protected Attributes | |
unsigned char | adch |
bool | adchLocked |
unsigned char | adcl |
int | adSample |
unsigned char | adcsr |
AvrDevice * | core |
HWAdmux * | admux |
HWIrqSystem * | irqSystem |
Pin & | aref |
unsigned int | irqVec |
bool | usedBefore |
unsigned char | prescaler |
unsigned char | clk |
enum HWAd::T_State | state |
Analog-digital converter (ADC)
Definition at line 64 of file hwad.h.
enum HWAd::T_State [protected] |
HWAd::HWAd | ( | AvrDevice * | core, | |
HWAdmux * | m, | |||
HWIrqSystem * | i, | |||
Pin & | aref, | |||
unsigned int | irqVec | |||
) |
Definition at line 101 of file hwad.cpp.
References AvrDevice::AddToCycleList(), core, HWIrqSystem::DebugVerifyInterruptVector(), irqSystem, irqVec, and Reset().
void HWAd::ClearIrqFlag | ( | unsigned int | vector | ) | [virtual] |
unsigned int HWAd::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 156 of file hwad.cpp.
References adch, adchLocked, adcl, adcsr, ADEN, ADFR, ADIE, ADIF, ADLAR, admux, ADPS0, ADPS1, ADPS2, adSample, ADSC, aref, clk, core, HWAdmux::GetAdmux(), Pin::GetAnalog(), HWAdmux::GetMuxOutput(), IDLE, INIT, irqSystem, irqVec, prescaler, RUNNING, HWIrqSystem::SetIrqFlag(), state, AvrDevice::trace_on, traceOut, and usedBefore.
unsigned char HWAd::GetAdch | ( | ) |
Definition at line 129 of file hwad.cpp.
References adch, and adchLocked.
unsigned char HWAd::GetAdcl | ( | ) |
Definition at line 130 of file hwad.cpp.
References adchLocked, and adcl.
void HWAd::Reset | ( | void | ) | [virtual] |
void HWAd::SetAdcsr | ( | unsigned char | val | ) |
Definition at line 135 of file hwad.cpp.
References adcsr, ADIE, ADIF, ADSC, HWIrqSystem::ClearIrqFlag(), irqSystem, irqVec, and HWIrqSystem::SetIrqFlag().
unsigned char HWAd::adch [protected] |
Definition at line 66 of file hwad.h.
Referenced by CpuCycle(), and GetAdch().
Definition at line 103 of file hwad.h.
Referenced by AvrDevice_at90canbase::AvrDevice_at90canbase(), AvrDevice_atmega1284Abase::AvrDevice_atmega1284Abase(), and AvrDevice_atmega668base::AvrDevice_atmega668base().
bool HWAd::adchLocked [protected] |
unsigned char HWAd::adcl [protected] |
Definition at line 68 of file hwad.h.
Referenced by CpuCycle(), and GetAdcl().
Definition at line 103 of file hwad.h.
Referenced by AvrDevice_at90canbase::AvrDevice_at90canbase(), AvrDevice_atmega1284Abase::AvrDevice_atmega1284Abase(), and AvrDevice_atmega668base::AvrDevice_atmega668base().
unsigned char HWAd::adcsr [protected] |
Definition at line 70 of file hwad.h.
Referenced by ClearIrqFlag(), CpuCycle(), GetAdcsr(), Reset(), and SetAdcsr().
Definition at line 103 of file hwad.h.
Referenced by AvrDevice_at90canbase::AvrDevice_at90canbase(), AvrDevice_atmega1284Abase::AvrDevice_atmega1284Abase(), and AvrDevice_atmega668base::AvrDevice_atmega668base().
HWAdmux* HWAd::admux [protected] |
Definition at line 72 of file hwad.h.
Referenced by CpuCycle().
int HWAd::adSample [protected] |
Definition at line 69 of file hwad.h.
Referenced by CpuCycle().
Pin& HWAd::aref [protected] |
Definition at line 74 of file hwad.h.
Referenced by CpuCycle().
unsigned char HWAd::clk [protected] |
Definition at line 79 of file hwad.h.
Referenced by CpuCycle(), and Reset().
AvrDevice* HWAd::core [protected] |
Definition at line 71 of file hwad.h.
Referenced by CpuCycle(), and HWAd().
HWIrqSystem* HWAd::irqSystem [protected] |
Definition at line 73 of file hwad.h.
Referenced by ClearIrqFlag(), CpuCycle(), HWAd(), and SetAdcsr().
unsigned int HWAd::irqVec [protected] |
Definition at line 75 of file hwad.h.
Referenced by ClearIrqFlag(), CpuCycle(), HWAd(), and SetAdcsr().
unsigned char HWAd::prescaler [protected] |
Definition at line 78 of file hwad.h.
Referenced by CpuCycle(), and Reset().
enum HWAd::T_State HWAd::state [protected] |
Referenced by CpuCycle(), and Reset().
bool HWAd::usedBefore [protected] |
Definition at line 77 of file hwad.h.
Referenced by CpuCycle(), and Reset().