|
simulavr
1.1.0
|
Pin class for HWPort, a special pin with override functionality for output stage. More...
#include <pin.h>
Public Member Functions | |
| PortPin (void) | |
| common constructor, initial output state is tristate More... | |
| virtual | ~PortPin () |
| pin destructor, breaks save connection to other pins, if necessary More... | |
| void | ResetOverride (void) |
| reset override states More... | |
| void | SetDDOV (bool val, int index=0) |
| set data direction override value More... | |
| void | SetDDOE (bool val, int index=0) |
| set data direction override enable More... | |
| void | SetPVOV (bool val, int index=0) |
| set port override value More... | |
| void | SetPVOE (bool val, int index=0) |
| set port override enable More... | |
| void | SetPVOE_WithDDR (bool val, int index=0) |
| set port override enable, if DDR is set More... | |
| void | SetPUOV (bool val, int index=0) |
| set pullup override value More... | |
| void | SetPUOE (bool val, int index=0) |
| set pullup override enable More... | |
| int | RegisterAlternateUse (void) |
| register an alternate function to pin More... | |
| bool | CalcPinOverride (bool ddr, bool port, bool pud) |
| calculate pin outState with override functionality 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 Pin & | operator= (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... | |
| 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... | |
| Pin & | SetAnalogValue (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 | |
| unsigned char | DDOE |
| unsigned char | DDOV |
| unsigned char | PVOE |
| unsigned char | PVOV |
| unsigned char | PVOEwDDR |
| unsigned char | PUOE |
| unsigned char | PUOV |
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... | |
| Net * | connectedTo |
| the connection to other pins (nullptr, if not connected) More... | |
Private Attributes | |
| unsigned int | regCount |
| register counter More... | |
Friends | |
| class | HWPort |
| class | Net |
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... | |
| PortPin::PortPin | ( | void | ) |
|
virtual |
| bool PortPin::CalcPinOverride | ( | bool | ddr, |
| bool | port, | ||
| bool | pud | ||
| ) |
calculate pin outState with override functionality
Definition at line 427 of file pin.cpp.
References Pin::HIGH, Pin::LOW, Pin::PULLUP, and Pin::TRISTATE.
| int PortPin::RegisterAlternateUse | ( | void | ) |
register an alternate function to pin
Definition at line 373 of file pin.cpp.
Referenced by PinAtPort::PinAtPort().
| void PortPin::SetDDOE | ( | bool | val, |
| int | index = 0 |
||
| ) |
set data direction override enable
Definition at line 385 of file pin.cpp.
Referenced by PinAtPort::SetUseAlternateDdr().
| void PortPin::SetDDOV | ( | bool | val, |
| int | index = 0 |
||
| ) |
set data direction override value
Definition at line 378 of file pin.cpp.
Referenced by PinAtPort::SetAlternateDdr().
| void PortPin::SetPUOE | ( | bool | val, |
| int | index = 0 |
||
| ) |
set pullup override enable
Definition at line 420 of file pin.cpp.
Referenced by PinAtPort::SetUseAlternatePullup().
| void PortPin::SetPUOV | ( | bool | val, |
| int | index = 0 |
||
| ) |
set pullup override value
Definition at line 413 of file pin.cpp.
Referenced by PinAtPort::SetAlternatePullup().
| void PortPin::SetPVOE | ( | bool | val, |
| int | index = 0 |
||
| ) |
set port override enable
Definition at line 399 of file pin.cpp.
Referenced by PinAtPort::SetUseAlternatePort().
| void PortPin::SetPVOE_WithDDR | ( | bool | val, |
| int | index = 0 |
||
| ) |
set port override enable, if DDR is set
Definition at line 406 of file pin.cpp.
Referenced by PinAtPort::SetUseAlternatePortIfDdrSet().
| void PortPin::SetPVOV | ( | bool | val, |
| int | index = 0 |
||
| ) |
set port override value
Definition at line 392 of file pin.cpp.
Referenced by PinAtPort::SetAlternatePort().