simulavr  1.1.0
AdcPin Class Reference

Provides input of aanalog signal into simulator. More...

#include <adcpin.h>

Inheritance diagram for AdcPin:

Public Member Functions

 AdcPin (const char *fileName, Net &pinNet) throw ()
 
- Public Member Functions inherited from SimulationMember
virtual ~SimulationMember ()
 

Private Member Functions

int Step (bool &trueHwStep, SystemClockOffset *timeToNextStepIn_ns=0)
 Return nonzero if a breakpoint was hit. More...
 

Private Attributes

AdcAnalogPin _analogPin
 Output to AVR. More...
 
std::ifstream _anaFile
 The analog input file. More...
 

Detailed Description

Provides input of aanalog signal into simulator.

The purpose of this class is to stimulate a pin with an analog pattern specified by a file. The file will contain an "analog sample value" on each line, along with a duration in nano-seconds that must elapse before the value is changed.

Definition at line 54 of file adcpin.h.

Constructor & Destructor Documentation

◆ AdcPin()

AdcPin::AdcPin ( const char *  fileName,
Net pinNet 
)
throw (
)

Definition at line 28 of file adcpin.cpp.

References Pin::ANALOG, and avr_error.

Member Function Documentation

◆ Step()

int AdcPin::Step ( bool &  trueHwStep,
SystemClockOffset timeToNextStepIn_ns = 0 
)
privatevirtual

Return nonzero if a breakpoint was hit.

Implements SimulationMember.

Definition at line 53 of file adcpin.cpp.

References _anaFile, _analogPin, readNextLine(), and AdcAnalogPin::setAnalogValue().

Member Data Documentation

◆ _anaFile

std::ifstream AdcPin::_anaFile
private

The analog input file.

Definition at line 60 of file adcpin.h.

Referenced by Step().

◆ _analogPin

AdcAnalogPin AdcPin::_analogPin
private

Output to AVR.

Definition at line 57 of file adcpin.h.

Referenced by Step().


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