|
CANTram Framework 1.0.1
Dieses Framework ermöglicht die Nutzung der CANTram Hardware, einer Mikrocontroller basierten mdoularen Steuerung.
|
Analog output interface implementation. More...
#include <AnalogOutput.h>


Public Member Functions | |
| AnalogOutput (Interface::Resolution res=Interface::RES_12BIT) | |
| Construct a new AnalogOutput object. | |
| Interface::Type | getType () const override |
| Get the interface type. | |
| void | setQ (uint16_t q) override |
| Set the output value (Q). | |
| Public Member Functions inherited from Interface | |
| virtual uint16_t | getQ () const |
| void | rename (const String &newName) |
| template<typename T> | |
| T | as () |
| void | validate () |
| void | validate (bool state) |
| void | invalidate () |
| bool | isValid () |
| bool | isInvalid () |
| String | getName () const |
Public Attributes | |
| uint8_t | channel |
Additional Inherited Members | |
| Public Types inherited from Interface | |
| enum | Resolution { RES_8BIT = 8 , RES_10BIT = 10 , RES_12BIT = 12 , RES_16BIT = 16 } |
| enum | Type { DIGITAL_INPUT , DIGITAL_OUTPUT , ANALOG_INPUT , ANALOG_OUTPUT , RELAIS , BUS } |
| Protected Attributes inherited from Interface | |
| String | name |
| uint16_t | Q = 0 |
| bool | _valid = false |
| bool | _invalid = false |
Analog output interface implementation.
Provides an Interface-derived analog output implementation that stores a resolution and a value (Q).
|
inline |
Construct a new AnalogOutput object.
Initializes the analog output with the given resolution and sets the internal value Q to zero.
| res | Resolution to use for this analog output. Defaults to Interface::RES_12BIT. |
|
inlineoverridevirtual |
Get the interface type.
Returns the type identifier for this interface implementation so callers can distinguish analog outputs from other interface types.
Implements Interface.
|
inlineoverridevirtual |
Set the output value (Q).
Sets the internal value Q. If the provided value exceeds the maximum representable value for the configured resolution, the value is clamped to the maximum and a warning is logged.
| q | The value to set for this analog output. Range is 0 .. (2^resolution - 1). |
Reimplemented from Interface.