|
simulavr
1.1.0
|
#include <hwad.h>
Public Types | |
| enum | { AD_4433, AD_M8, AD_M16, AD_M64, AD_M128, AD_M48, AD_M164, AD_T25, AD_M2560 } |
Public Member Functions | |
| HWAd (AvrDevice *c, int _typ, HWIrqSystem *i, unsigned int iv, HWAdmux *a, HWARef *r) | |
| virtual | ~HWAd () |
| unsigned int | CpuCycle () |
| unsigned char | GetAdch (void) |
| unsigned char | GetAdcl (void) |
| unsigned char | GetAdcsrA (void) |
| unsigned char | GetAdcsrB (void) |
| unsigned char | GetAdmux (void) |
| void | SetAdcsrA (unsigned char) |
| void | SetAdcsrB (unsigned char) |
| void | SetAdmux (unsigned char val) |
| void | Reset (void) |
| void | ClearIrqFlag (unsigned int vec) |
| void | NotifySignalChanged (void) |
| bool | IsADEnabled (void) |
| Check, if ADC is enabled. More... | |
| bool | IsSetACME (void) |
| Check, if ACME bit is set, return false, if not available. More... | |
| float | GetADMuxValue (float vcc) |
| Get analog value from ADC multiplexer. More... | |
| void | RegisterNotifyClient (AnalogSignalChange *client) |
| Register analog comparator for notification of multiplexer signal change. More... | |
| void | UnregisterNotifyClient (void) |
| Unregister client for signal change notification. More... | |
Public Member Functions inherited from Hardware | |
| Hardware (AvrDevice *core) | |
| virtual | ~Hardware () |
| virtual bool | IsLevelInterrupt (unsigned int vector) |
| virtual bool | LevelInterruptPending (unsigned int vector) |
Public Member Functions inherited from TraceValueRegister | |
| TraceValueRegister (TraceValueRegister *parent, const std::string &name) | |
| Create a TraceValueRegister, with a scope prefix built on parent scope + name. More... | |
| TraceValueRegister () | |
| Create a TraceValueRegister, with a empty scope name, single device application. More... | |
| virtual | ~TraceValueRegister () |
| const std::string | GetTraceValuePrefix (void) |
| Returns the scope prefix. More... | |
| const std::string | GetScopeName (void) |
| Returns the scope name. More... | |
| void | RegisterTraceValue (TraceValue *t) |
| Registers a TraceValue for this register. More... | |
| void | UnregisterTraceValue (TraceValue *t) |
| Unregisters a TraceValue, remove it from register. More... | |
| TraceValueRegister * | GetScopeGroupByName (const std::string &name) |
| Get a here registered TraceValueRegister by it's name. More... | |
| virtual TraceValue * | GetTraceValueByName (const std::string &name) |
| Get a here registered TraceValue by it's name. More... | |
| TraceValueRegister * | FindScopeGroupByName (const std::string &name) |
| Seek for a TraceValueRegister by it's name. More... | |
| TraceValue * | FindTraceValueByName (const std::string &name) |
| Seek for a TraceValue by it's name. More... | |
| TraceSet * | GetAllTraceValues (void) |
| Get all here registered TraceValue's only (not with descending values) More... | |
| TraceSet * | GetAllTraceValuesRecursive (void) |
| Get all here registered TraceValue's with descending values. More... | |
Public Member Functions inherited from AnalogSignalChange | |
| virtual | ~AnalogSignalChange () |
Public Attributes | |
| IOReg< HWAd > | adch_reg |
| IOReg< HWAd > | adcl_reg |
| IOReg< HWAd > | adcsra_reg |
| IOReg< HWAd > | adcsrb_reg |
| IOReg< HWAd > | admux_reg |
Protected Types | |
| enum | T_State { IDLE, INIT, RUNNING } |
| enum | { ADEN = 0x80, BIN = 0x80, ADSC = 0x40, ACME = 0x40, ADFR = 0x20, ADATE = 0x20, ADLAR = 0x20, IPR = 0x20, ADIF = 0x10, ADIE = 0x08, MUX5 = 0x08, ADPS = 0x07, ADTS = 0x07 } |
Protected Member Functions | |
| bool | IsPrescalerClock (void) |
| bool | IsFreeRunning (void) |
| virtual int | GetTriggerSource (void) |
| int | ConversionBipolar (float value, float ref) |
| int | ConversionUnipolar (float value, float ref) |
Protected Member Functions inherited from TraceValueRegister | |
| virtual size_t | _tvr_getValuesCount (void) |
| Get the count of all TraceValues, that are registered here and descending. More... | |
| virtual void | _tvr_insertTraceValuesToSet (TraceSet &t) |
| Insert all TraceValues into TraceSet, that registered here and descending. More... | |
Protected Attributes | |
| int | adType |
| unsigned char | adch |
| unsigned char | adcl |
| unsigned char | adcsra |
| unsigned char | adcsrb |
| unsigned char | admux |
| AvrDevice * | core |
| HWAdmux * | mux |
| HWARef * | aref |
| HWIrqSystem * | irqSystem |
| unsigned int | irqVec |
| bool | adchLocked |
| int | adSample |
| int | adMuxConfig |
| int | prescaler |
| int | prescalerSelect |
| int | conversionState |
| bool | firstConversion |
| AnalogSignalChange * | notifyClient |
| enum HWAd::T_State | state |
|
protected |
| anonymous enum |
|
protected |
| HWAd::HWAd | ( | AvrDevice * | c, |
| int | _typ, | ||
| HWIrqSystem * | i, | ||
| unsigned int | iv, | ||
| HWAdmux * | a, | ||
| HWARef * | r | ||
| ) |
Definition at line 404 of file hwad.cpp.
References AvrDevice::AddToCycleList(), core, HWIrqSystem::DebugVerifyInterruptVector(), irqSystem, irqVec, mux, HWAdmux::RegisterNotifyClient(), and Reset().
|
inlinevirtual |
Definition at line 276 of file hwad.h.
References HWAdmux::UnregisterNotifyClient().
|
virtual |
|
protected |
Definition at line 577 of file hwad.cpp.
Referenced by CpuCycle().
|
protected |
Definition at line 596 of file hwad.cpp.
Referenced by CpuCycle().
|
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 612 of file hwad.cpp.
References AD_T25, adch, adchLocked, adcl, adcsra, adcsrb, ADIE, ADIF, ADLAR, admux, adMuxConfig, adSample, ADSC, adType, aref, BIN, ConversionBipolar(), conversionState, ConversionUnipolar(), core, firstConversion, Pin::GetRawAnalog(), HWARef::GetRefValue(), HWAdmux::GetValue(), IDLE, INIT, IPR, irqSystem, irqVec, HWAdmux::IsDifferenceChannel(), IsFreeRunning(), IsPrescalerClock(), mux, MUX5, RUNNING, HWIrqSystem::SetIrqFlag(), state, AvrDevice::trace_on, traceOut, and AvrDevice::v_supply.
| unsigned char HWAd::GetAdch | ( | void | ) |
Definition at line 444 of file hwad.cpp.
References adch, and adchLocked.
| unsigned char HWAd::GetAdcl | ( | void | ) |
Definition at line 449 of file hwad.cpp.
References adchLocked, and adcl.
|
inline |
Get analog value from ADC multiplexer.
Definition at line 300 of file hwad.h.
References HWAdmux::GetValueAComp().
Referenced by HWAcomp::GetIn1().
|
protectedvirtual |
Reimplemented in HWAd_SFIOR.
Definition at line 560 of file hwad.cpp.
Referenced by IsFreeRunning().
|
inline |
Check, if ADC is enabled.
Definition at line 296 of file hwad.h.
Referenced by HWAcomp::isSetACME(), and NotifySignalChanged().
|
protected |
|
protected |
Definition at line 520 of file hwad.cpp.
References adcsra, ADEN, prescaler, and prescalerSelect.
Referenced by CpuCycle().
|
inline |
Check, if ACME bit is set, return false, if not available.
Definition at line 298 of file hwad.h.
Referenced by HWAcomp::isSetACME().
|
virtual |
Implements AnalogSignalChange.
Definition at line 439 of file hwad.cpp.
References IsADEnabled(), notifyClient, and AnalogSignalChange::NotifySignalChanged().
Referenced by SetAdcsrA(), and SetAdcsrB().
|
inline |
Register analog comparator for notification of multiplexer signal change.
Definition at line 302 of file hwad.h.
Referenced by HWAcomp::HWAcomp().
|
virtual |
Implement the hardware's reset functionality here. The default is no action on reset.
Reimplemented from Hardware.
Reimplemented in HWAd_SFIOR.
Definition at line 426 of file hwad.cpp.
References adch, adchLocked, adcl, adcsra, adcsrb, admux, adMuxConfig, conversionState, firstConversion, IDLE, prescaler, prescalerSelect, and state.
Referenced by HWAd(), and HWAd_SFIOR::Reset().
| void HWAd::SetAdcsrA | ( | unsigned char | val | ) |
Definition at line 454 of file hwad.cpp.
References adcsra, ADEN, ADIE, ADIF, ADPS, ADSC, HWIrqSystem::ClearIrqFlag(), firstConversion, irqSystem, irqVec, NotifySignalChanged(), prescalerSelect, and HWIrqSystem::SetIrqFlag().
| void HWAd::SetAdcsrB | ( | unsigned char | val | ) |
| void HWAd::SetAdmux | ( | unsigned char | val | ) |
|
inline |
Unregister client for signal change notification.
Definition at line 304 of file hwad.h.
Referenced by HWAcomp::~HWAcomp().
|
protected |
Definition at line 208 of file hwad.h.
Referenced by CpuCycle(), GetAdch(), and Reset().
Definition at line 269 of file hwad.h.
Referenced by AvrDevice_at90canbase::AvrDevice_at90canbase(), AvrDevice_atmega1284Abase::AvrDevice_atmega1284Abase(), AvrDevice_atmega128base::AvrDevice_atmega128base(), AvrDevice_atmega16_32::AvrDevice_atmega16_32(), AvrDevice_atmega2560base::AvrDevice_atmega2560base(), and AvrDevice_atmega668base::AvrDevice_atmega668base().
|
protected |
|
protected |
Definition at line 209 of file hwad.h.
Referenced by CpuCycle(), GetAdcl(), and Reset().
Definition at line 269 of file hwad.h.
Referenced by AvrDevice_at90canbase::AvrDevice_at90canbase(), AvrDevice_atmega1284Abase::AvrDevice_atmega1284Abase(), AvrDevice_atmega128base::AvrDevice_atmega128base(), AvrDevice_atmega16_32::AvrDevice_atmega16_32(), AvrDevice_atmega2560base::AvrDevice_atmega2560base(), and AvrDevice_atmega668base::AvrDevice_atmega668base().
|
protected |
Definition at line 210 of file hwad.h.
Referenced by ClearIrqFlag(), CpuCycle(), IsFreeRunning(), IsPrescalerClock(), Reset(), and SetAdcsrA().
Definition at line 269 of file hwad.h.
Referenced by AvrDevice_at90canbase::AvrDevice_at90canbase(), AvrDevice_atmega1284Abase::AvrDevice_atmega1284Abase(), AvrDevice_atmega128base::AvrDevice_atmega128base(), AvrDevice_atmega16_32::AvrDevice_atmega16_32(), AvrDevice_atmega2560base::AvrDevice_atmega2560base(), and AvrDevice_atmega668base::AvrDevice_atmega668base().
|
protected |
Definition at line 211 of file hwad.h.
Referenced by CpuCycle(), GetTriggerSource(), Reset(), SetAdcsrB(), and SetAdmux().
Definition at line 269 of file hwad.h.
Referenced by AvrDevice_at90canbase::AvrDevice_at90canbase(), AvrDevice_atmega1284Abase::AvrDevice_atmega1284Abase(), AvrDevice_atmega128base::AvrDevice_atmega128base(), AvrDevice_atmega2560base::AvrDevice_atmega2560base(), and AvrDevice_atmega668base::AvrDevice_atmega668base().
|
protected |
Definition at line 212 of file hwad.h.
Referenced by CpuCycle(), Reset(), and SetAdmux().
Definition at line 269 of file hwad.h.
Referenced by AvrDevice_at90canbase::AvrDevice_at90canbase(), AvrDevice_atmega1284Abase::AvrDevice_atmega1284Abase(), AvrDevice_atmega128base::AvrDevice_atmega128base(), AvrDevice_atmega16_32::AvrDevice_atmega16_32(), AvrDevice_atmega2560base::AvrDevice_atmega2560base(), and AvrDevice_atmega668base::AvrDevice_atmega668base().
|
protected |
Definition at line 221 of file hwad.h.
Referenced by CpuCycle(), and Reset().
|
protected |
Definition at line 220 of file hwad.h.
Referenced by CpuCycle().
|
protected |
Definition at line 207 of file hwad.h.
Referenced by CpuCycle(), IsFreeRunning(), SetAdcsrB(), and SetAdmux().
|
protected |
Definition at line 215 of file hwad.h.
Referenced by CpuCycle().
|
protected |
Definition at line 224 of file hwad.h.
Referenced by CpuCycle(), and Reset().
|
protected |
Definition at line 213 of file hwad.h.
Referenced by CpuCycle(), and HWAd().
|
protected |
Definition at line 225 of file hwad.h.
Referenced by CpuCycle(), Reset(), and SetAdcsrA().
|
protected |
Definition at line 216 of file hwad.h.
Referenced by ClearIrqFlag(), CpuCycle(), HWAd(), and SetAdcsrA().
|
protected |
Definition at line 217 of file hwad.h.
Referenced by ClearIrqFlag(), CpuCycle(), HWAd(), and SetAdcsrA().
|
protected |
Definition at line 214 of file hwad.h.
Referenced by CpuCycle(), HWAd(), and SetAdmux().
|
protected |
Definition at line 226 of file hwad.h.
Referenced by NotifySignalChanged().
|
protected |
Definition at line 222 of file hwad.h.
Referenced by IsPrescalerClock(), and Reset().
|
protected |
Definition at line 223 of file hwad.h.
Referenced by IsPrescalerClock(), Reset(), and SetAdcsrA().
|
protected |
Referenced by CpuCycle(), and Reset().