simulavr  1.1.0
ExtAnalogPin Class Reference

#include <extpin.h>

Inheritance diagram for ExtAnalogPin:

Public Member Functions

 ExtAnalogPin (unsigned int startval, UserInterface *_ui, const char *_extName, const char *baseWindow)
 
void SetNewValueFromUi (const std::string &)
 
void SetInState (const Pin &p)
 
- Public Member Functions inherited from Pin
 Pin (void)
 common constructor, initial output state is tristate More...
 
 Pin (const Pin &p)
 copy constructor, copy values but no refs to Net or HWPort More...
 
 Pin (T_Pinstate ps)
 copy constructor from pin state More...
 
 Pin (unsigned char *parentPin, unsigned char mask)
 constructor for a port pin, only used in UI part! More...
 
 Pin (float analog)
 constructor for analog pin More...
 
virtual ~Pin ()
 pin destructor, breaks save connection to other pins, if necessary More...
 
 operator char () const
 return char representation for output stage More...
 
virtual Pinoperator= (char)
 set output stage to (digital) state, set value for ANALOG state separately More...
 
virtual operator bool () const
 return boolean state of output stage More...
 
virtual Pin operator+ (const Pin &p)
 calculate common state from 2 connected pins More...
 
virtual Pin operator+= (const Pin &p)
 calculate common state from connected other pin to this pin More...
 
virtual void RegisterNet (Net *n)
 registers Net instance on pin More...
 
virtual void UnRegisterNet (Net *n)
 deletes Net instance registration for pin More...
 
virtual Pin GetPin (void)
 "cast method" to get back a Pin instance More...
 
int GetAnalog (void)
 Get analog value as integer from 0 to INT_MAX (for backward compatibility, will be deprecated later) More...
 
float GetRawAnalog (void) const
 get back raw analog value (just variable content!) More...
 
float GetAnalogValue (float vcc)
 Returns real analog input value of pin. More...
 
PinSetAnalogValue (float value)
 Sets the pin to an real analog value. More...
 
void SetRawAnalog (float value)
 
void RegisterCallback (HasPinNotifyFunction *)
 
bool CalcPin (void)
 Update input values from output values. More...
 
bool isPortPin (void)
 True, if it's a port pin. More...
 
bool isConnected (void)
 True, if it's connected to other pins. More...
 
bool hasListener (void)
 True, if there change listeners. More...
 
- Public Member Functions inherited from ExternalType
virtual ~ExternalType ()
 

Protected Attributes

UserInterfaceui
 ptr to UI More...
 
std::string extName
 identifier for UI access More...
 
- Protected Attributes inherited from Pin
unsigned char * pinOfPort
 points to HWPort::pin or nullptr More...
 
IOReg< HWPort > * pinRegOfPort
 points to PIN io register of port or nullptr More...
 
unsigned char mask
 byte mask for HWPort::pin More...
 
AnalogValue analogVal
 "real" analog voltage value More...
 
NetconnectedTo
 the connection to other pins (nullptr, if not connected) More...
 

Additional Inherited Members

- Public Types inherited from Pin
enum  T_Pinstate {
  LOW, HIGH, SHORTED, PULLUP,
  TRISTATE, PULLDOWN, ANALOG, ANALOG_SHORTED
}
 Possible PIN states. More...
 
- Public Attributes inherited from Pin
T_Pinstate outState
 discrete value of output stage More...
 
std::vector< HasPinNotifyFunction * > notifyList
 listeners for change of input value More...
 

Detailed Description

"external" analog pin, used for connecting UI to pins

Definition at line 63 of file extpin.h.

Constructor & Destructor Documentation

◆ ExtAnalogPin()

ExtAnalogPin::ExtAnalogPin ( unsigned int  startval,
UserInterface _ui,
const char *  _extName,
const char *  baseWindow 
)

creates an ExtAnalogPin instance

Parameters
startvalinitial analog value
_uipointer to UI instance
_extNameidentifier used for UI access
baseWindowwindow identifier from UI window

Member Function Documentation

◆ SetInState()

void ExtAnalogPin::SetInState ( const Pin p)
virtual

Send new pin status to UI

Parameters
ppin, for which status change is to send

Reimplemented from Pin.

◆ SetNewValueFromUi()

void ExtAnalogPin::SetNewValueFromUi ( const std::string &  )
virtual

Receives a external value from UI

Parameters
svalue string

Implements ExternalType.

Member Data Documentation

◆ extName

std::string ExtAnalogPin::extName
protected

identifier for UI access

Definition at line 67 of file extpin.h.

◆ ui

UserInterface* ExtAnalogPin::ui
protected

ptr to UI

Definition at line 66 of file extpin.h.


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