CANTram Framework 1.0.1
Dieses Framework ermöglicht die Nutzung der CANTram Hardware, einer Mikrocontroller basierten mdoularen Steuerung.
Loading...
Searching...
No Matches
OutputProvider Class Referenceabstract

Abstract interface for providers that control outputs. More...

#include <OutputDefinition.h>

Inheritance diagram for OutputProvider:

Public Member Functions

virtual bool configureOutput (OutputDefinition *def, OutputDefinition::ConfigurationMode mode)=0
 Configure an output's direction/mode.
virtual bool setOutput (OutputDefinition *def, bool state)=0
 Set the logical state of an output.
virtual bool getOutput (OutputDefinition *def)=0
 Read the current logical state of an output.
virtual void enableOutputs (bool state=true)
 Enable or disable all outputs managed by this provider.
virtual void disableOutputs ()
 Disable all outputs managed by this provider.

Detailed Description

Abstract interface for providers that control outputs.

Implementors provide mechanisms to configure outputs (mode), set output state and read state. Concrete providers adapt MCU GPIO, expanders, or shift registers to the OutputDefinition API.

Member Function Documentation

◆ configureOutput()

virtual bool OutputProvider::configureOutput ( OutputDefinition * def,
OutputDefinition::ConfigurationMode mode )
pure virtual

Configure an output's direction/mode.

Configure the physical output referenced by def to the given mode (e.g., INPUT, OUTPUT).

Parameters
defPointer to the OutputDefinition describing the output to configure.
modeMode value to set (Arduino-style constants like INPUT/OUTPUT).
Returns
true if configuration succeeded, false on error.

Implemented in MainModuleV1_0.

◆ disableOutputs()

virtual void OutputProvider::disableOutputs ( )
inlinevirtual

Disable all outputs managed by this provider.

Convenience method to disable outputs. Calls enableOutputs(false).

Here is the call graph for this function:

◆ enableOutputs()

virtual void OutputProvider::enableOutputs ( bool state = true)
inlinevirtual

Enable or disable all outputs managed by this provider.

Globally enable or disable outputs. Implementation-specific behavior (e.g., power gating). This method is called by the CANTramCore during initialization.

Parameters
statetrue to enable outputs, false to disable.

Reimplemented in MainModuleV1_0.

Here is the caller graph for this function:

◆ getOutput()

virtual bool OutputProvider::getOutput ( OutputDefinition * def)
pure virtual

Read the current logical state of an output.

Query the provider for the current state of the specified output. For inputs this reads the actual level; for outputs the implementation may return the last set state.

Parameters
defPointer to the OutputDefinition to read.
Returns
bool Current logical state (true = HIGH, false = LOW).

Implemented in MainModuleV1_0.

◆ setOutput()

virtual bool OutputProvider::setOutput ( OutputDefinition * def,
bool state )
pure virtual

Set the logical state of an output.

Drive the physical output described by def to the requested boolean state.

Parameters
defPointer to the OutputDefinition describing the output to change.
stateDesired logical state (true = HIGH, false = LOW).
Returns
true if the state was successfully applied, false otherwise.

Implemented in MainModuleV1_0.

Here is the caller graph for this function:

The documentation for this class was generated from the following file:
  • C:/Users/leowa/Documents/PlatformIO/Projects/CANTramFrameworkUsage/lib/CANTramFramework/include/OutputDefinition.h