111 if(acic != old_acic) {
157 if((irqmode == 0) || (irqmode == (
ACIS1|
ACIS0))) {
168 if((irqmode == 0) || (irqmode ==
ACIS1)) {
Basic AVR device, contains the core functionality.
HWIrqSystem * irqSystem
connection to IRQ controller
bool useBG
has ADBG register bit and can switch In0 to bandgap ref
void RegisterNotifyClient(AnalogSignalChange *client)
Register analog comparator for notification of multiplexer signal change.
Pin * v_cc
get access to voltage supply level
BasicTimerUnit * timerB
connection to timerB for input capture event. NULL, if not available
void UnregisterNotifyClient(void)
Unregister client for signal change notification.
float GetIn0(void)
Get analog value for comparator input 0.
Pin class, handles input and output to external parts.
bool enabled
analog comparator is enabled
float GetIn1(void)
Get analog value for comparator input 1.
void SetAcsr(unsigned char val)
Set method for ACSR register.
unsigned char acsr
ACSR register value.
void connectSRegClient(IOSpecialRegClient *c)
Registers a client to this IO register to inform this client on read or write access.
void PinStateHasChanged(Pin *)
Get informed about input pin change.
void ClearIrqFlag(unsigned int vec)
Reflect irq processing, reset interrupt source.
BasicTimerUnit * timerA
connection to timerA for input capture event. NULL, if not available
void Reset()
Reset the unit.
Build a register for TraceValue's.
PinAtPort pinAin1
port pin AIN1
void SetACIC(bool acic)
reflect ACIC flag to input capture source
void SetIrqFlag(Hardware *, unsigned int vector_index)
bool acme_sfior
ACME flag in SFIOR register is set.
unsigned int irqVec
stores the IRQ vector number
void RegisterCallback(HasPinNotifyFunction *)
HWAd * ad
connection to ADC for analog input mux. NULL, if not available
unsigned char set_from_reg(const IOSpecialReg *reg, unsigned char nv)
void RegisterACompForICapture(HWAcomp *acomp)
register analog comparator unit for input capture source
Pin * v_bg
get access to bandgap reference
bool isSetACME(void)
Check, if ACME flag is set (from ADC or SFIOR register)
Pin v_supply
represents supply voltage level, needed for analog peripherals
bool IsADEnabled(void)
Check, if ADC is enabled.
float GetADMuxValue(float vcc)
Get analog value from ADC multiplexer.
Pin v_bandgap
represents bandgap (ref) voltage level, needed for analog peripherals
void DebugVerifyInterruptVector(unsigned int vector_index, const Hardware *source)
In datasheets RESET vector is index 1 but we use 0! And not a byte address.
IOSpecialReg * sfior
connection to SFIOR register, if necessary. NULL, if not used
HWAcomp(AvrDevice *core, HWIrqSystem *irqsys, PinAtPort ain0, PinAtPort ain1, unsigned int irqVec, HWAd *_ad, BasicTimerUnit *_timerA, IOSpecialReg *_sfior=NULL, BasicTimerUnit *_timerB=NULL, bool _useBG=true)
constructor to instantiate a analog comparator peripheral
void NotifySignalChanged(void)
bool IsSetACME(void)
Check, if ACME bit is set, return false, if not available.
void ClearIrqFlag(unsigned int vector_index)
PinAtPort pinAin0
port pin AIN0
float GetRawAnalog(void) const
get back raw analog value (just variable content!)
float GetAnalogValue(float vcc)
Get pin analog voltage level.
Analog comparator peripheral.