simulavr  1.1.0
OpenDrain Class Reference

Open drain Pin class, a special pin with open drain behavior. More...

#include <pin.h>

Inheritance diagram for OpenDrain:

Public Member Functions

 OpenDrain (Pin *p)
 
virtual Pin GetPin ()
 "cast method" to get back a Pin instance More...
 
- 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 SetInState (const Pin &p)
 handles the input value from net More...
 
virtual void RegisterNet (Net *n)
 registers Net instance on pin More...
 
virtual void UnRegisterNet (Net *n)
 deletes Net instance registration for pin 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...
 

Protected Attributes

Pinpin
 
- 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

Open drain Pin class, a special pin with open drain behavior.

Definition at line 208 of file pin.h.

Constructor & Destructor Documentation

◆ OpenDrain()

OpenDrain::OpenDrain ( Pin p)

Definition at line 351 of file pin.cpp.

Member Function Documentation

◆ GetPin()

Pin OpenDrain::GetPin ( void  )
virtual

"cast method" to get back a Pin instance

Reimplemented from Pin.

Definition at line 342 of file pin.cpp.

Member Data Documentation

◆ pin

Pin* OpenDrain::pin
protected

Definition at line 210 of file pin.h.


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