19 AnalogOutput(Interface::Resolution res = Interface::RES_12BIT) : resolution(res) {
28 Interface::Type
getType()
const override {
39 void setQ(uint16_t q)
override {
40 if(q > ((1 << resolution) - 1)) {
41 WARNING_PRINTLN(
"[AnalogOutput] WARNING: Attempted to set value " + String(q) +
" which exceeds the maximum for resolution " + String(resolution) +
" bits. Clamping to max value.");
42 Q = (1 << resolution) - 1;
50 Interface::Resolution resolution=Interface::RES_12BIT;
Logging and debug macro definitions for CANTramCore.
#define WARNING_PRINTLN(x)
Print a warning-level message with newline.
Definition Debug.h:185
AnalogOutput(Interface::Resolution res=Interface::RES_12BIT)
Construct a new AnalogOutput object.
Definition AnalogOutput.h:19
Interface::Type getType() const override
Get the interface type.
Definition AnalogOutput.h:28
void setQ(uint16_t q) override
Set the output value (Q).
Definition AnalogOutput.h:39