35 template<
typename T>
class IOReg;
37 #define REL_FLOATING_POTENTIAL 0.55 78 void setD(
int dig) { dState = dig; aValue = 0.0; }
80 int getD(
void)
const {
return dState; }
82 void setA(
float val) { dState = ST_ANALOG; aValue = val; }
84 float getA(
float vcc);
86 float getRaw(
void)
const {
return aValue; }
132 Pin(
unsigned char *parentPin,
unsigned char mask);
137 operator char()
const;
138 virtual Pin &operator= (
char);
139 virtual operator bool()
const;
140 virtual Pin operator+ (
const Pin& p);
141 virtual Pin operator+= (
const Pin& p);
144 virtual void SetInState(
const Pin &p);
145 virtual void RegisterNet(
Net *n);
146 virtual void UnRegisterNet(
Net *n);
151 Pin& SetAnalogValue(
float value);
186 void ResetOverride(
void);
189 void SetDDOV(
bool val,
int index = 0);
190 void SetDDOE(
bool val,
int index = 0);
191 void SetPVOV(
bool val,
int index = 0);
192 void SetPVOE(
bool val,
int index = 0);
193 void SetPVOE_WithDDR(
bool val,
int index = 0);
194 void SetPUOV(
bool val,
int index = 0);
195 void SetPUOE(
bool val,
int index = 0);
198 int RegisterAlternateUse(
void);
201 bool CalcPinOverride(
bool ddr,
bool port,
bool pud);
214 virtual Pin GetPin();
Net * connectedTo
the connection to other pins (nullptr, if not connected)
unsigned char * pinOfPort
points to HWPort::pin or nullptr
float getA(float vcc)
calculate real voltage potential, needs value of Vcc potential
Pin class, handles input and output to external parts.
digital state, Vcc potential
AnalogValue(void)
standard constructor, status is floating
virtual Pin GetPin(void)
"cast method" to get back a Pin instance
Defines a Port, e.g. a hardware device for GPIO.
float aValue
analog value from setA method or constructor (not checked to valid range!)
AnalogValue(int dig)
digital value constructor, set a digital state
Open drain Pin class, a special pin with open drain behavior.
int dState
digital state and validity of aValue
T_Pinstate
Possible PIN states.
digital state, ground potential
float getRaw(void) const
get raw analog value (no calculation, just content of aValue
unsigned char mask
byte mask for HWPort::pin
void setA(float val)
set analog value, no check to value range between ground and vcc
std::vector< HasPinNotifyFunction * > notifyList
listeners for change of input value
T_Pinstate outState
discrete value of output stage
bool isConnected(void)
True, if it's connected to other pins.
void SetRawAnalog(float value)
IO register to be specialized for a certain class/hardware.
Pin class for HWPort, a special pin with override functionality for output stage. ...
bool hasListener(void)
True, if there change listeners.
unsigned int regCount
register counter
virtual void NotifySignalChanged(void)=0
floating potential, not connected or tristate, assumed as FLOATING_POTENTIAL
IOReg< HWPort > * pinRegOfPort
points to PIN io register of port or nullptr
AnalogValue(float val)
analog value constructor, set real analog value
bool isPortPin(void)
True, if it's a port pin.
Implements "real" analog value as float.
float GetRawAnalog(void) const
get back raw analog value (just variable content!)
float GetAnalogValue(float vcc)
Returns real analog input value of pin.
virtual ~AnalogSignalChange()
bool analogValid(void) const
test, if real analog value is available
AnalogValue analogVal
"real" analog voltage value
Connect Pins to each other and transfers a output change from a pin to input values for all pins...