|
CANTram Framework 1.0.1
Dieses Framework ermöglicht die Nutzung der CANTram Hardware, einer Mikrocontroller basierten mdoularen Steuerung.
|


Public Member Functions | |
| MainModuleV1_0 () | |
| Construct a new MainModuleV1_0::MainModuleV1_0 object. | |
| String | getHWType () const override |
| Get the hardware type string. | |
| String | getHWVersion () const override |
| Get the hardware version string. | |
| String | getFWVersion () const override |
| Get the firmware version string. | |
| uint8_t | getGPIODemand () const override |
| Get the GPIO demand of the module. | |
| uint8_t | getGPIOSupply () const override |
| Get the GPIO supply capacity of the module. | |
| bool | configureOutput (OutputDefinition *def, OutputDefinition::ConfigurationMode mode) override |
| Configure an output's direction/mode. | |
| bool | configureOutput (OutputDefinition *def) |
| Configures the output for a specific pin or bit. | |
| bool | setOutput (OutputDefinition *def, bool state) override |
| Set the logic level on a pin of the module. | |
| bool | getOutput (OutputDefinition *def) override |
| Get the current state of a digital output. | |
| bool | reset () override |
| Reset the module and its hardware cores. | |
| bool | attachModule (uint8_t slot, uint8_t gpioStart) override |
| Attach this module to a slot and GPIO start index. | |
| bool | provideGPIOs () override |
| Provide GPIO output definitions to CANTramCore. | |
| bool | requestGPIOs () override |
| Request GPIOs from the core. | |
| bool | provideHardwareResources () override |
| Provide hardware resources (UART, PWM, etc.) to CANTramCore. | |
| bool | requestHardwareResources () override |
| Request hardware resources from the core. | |
| bool | addInterfaces () override |
| Register any interfaces provided by this module. | |
| bool | preInitialize () override |
| Pre-initialize the module after attachment. | |
| bool | initialize () override |
| Initialize the module and its hardware subsystems. | |
| void | enableOutputs (bool state) override |
| Enable or disable all outputs managed by this provider. | |
| uint16_t | getTemperatureCelsius () |
| Get the temperature in Celsius in 0.1°C steps. | |
| void | cycle (uint8_t *response) override |
| Periodic cycle callback for the module. | |
| Interface ** | getInterfaces () override |
| Get pointer to module's interface array. | |
| size_t | getInterfaceCount () override |
| Get number of interfaces provided by the module. | |
| bool | setPWM (OutputDefinition *def, uint16_t value) override |
| Set PWM duty for an output definition. | |
| bool | registerPWMChannel (OutputDefinition *def) override |
| Register a PWM channel for an output. | |
| Public Member Functions inherited from CANTramModule | |
| CANTramModule ()=default | |
| Default constructor. | |
| virtual | ~CANTramModule ()=default |
| Destructor. | |
| uint8_t | getSlot () const |
| Get assigned slot index. | |
| uint8_t | getGPIOStart () const |
| Get starting GPIO index assigned to the module. | |
| Public Member Functions inherited from OutputProvider | |
| virtual void | disableOutputs () |
| Disable all outputs managed by this provider. | |
Public Attributes | |
| Adafruit_MCP23X17 | shiftRegister |
| OutputDefinition | EXTEND [GPIO_SUPPLY] |
| esp_adc_cal_characteristics_t | adc1_chars |
| bool | adc_calibrated |
| ESP32_CANCore | canCore |
| CANInterface | canInterface |
Protected Member Functions | |
| virtual UARTCore * | getUartCore () override |
| Obtain a pointer to an available UARTCore. | |
Additional Inherited Members | |
| Protected Attributes inherited from CANTramModule | |
| uint8_t | SLOT = 0 |
| uint8_t | GPIO_START = 0 |
| MainModuleV1_0::MainModuleV1_0 | ( | ) |
Construct a new MainModuleV1_0::MainModuleV1_0 object.
This constructor explicitly calls the ESP32_I2CCore constructor with I2C bus 0 so Wire instead of Wire1 is used.
|
overridevirtual |
Register any interfaces provided by this module.
Add interface instances to the module so the core can enumerate and use them.
Implements CANTramModule.
|
overridevirtual |
Attach this module to a slot and GPIO start index.
Calls the base CANTramModule attach implementation and performs any module-specific attach logic.
| slot | Slot index to attach the module to. |
| gpioStart | Starting GPIO index assigned to this module. |
Reimplemented from CANTramModule.

| bool MainModuleV1_0::configureOutput | ( | OutputDefinition * | def | ) |
Configures the output for a specific pin or bit.
| def | GPIO number or shiftRegister output ID of desired output |
| mode | (Optional) Specify the direction of the pin. Default is OUTPUT |

|
overridevirtual |
Configure an output's direction/mode.
Configure the physical output referenced by def to the given mode (e.g., INPUT, OUTPUT).
| def | Pointer to the OutputDefinition describing the output to configure. |
| mode | Mode value to set (Arduino-style constants like INPUT/OUTPUT). |
Implements OutputProvider.


|
overridevirtual |
Periodic cycle callback for the module.
Called by the core to perform periodic tasks. Implement module-specific cyclic behavior here.
| response | Pointer to a response buffer where the module may write response bytes. May be nullptr if not used. |
Reimplemented from CANTramModule.

|
overridevirtual |
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.
| state | true to enable outputs, false to disable. |
Reimplemented from OutputProvider.

|
inlineoverridevirtual |
Get the firmware version string.
Returns the firmware version string implemented by the module.
Implements CANTramModule.
|
inlineoverridevirtual |
Get the GPIO demand of the module.
Returns how many GPIOs this module requires from the core.
Implements CANTramModule.
|
inlineoverridevirtual |
Get the GPIO supply capacity of the module.
Returns how many GPIOs this module provides/supplies to the system.
Implements CANTramModule.
|
inlineoverridevirtual |
Get the hardware type string.
Returns a human readable hardware type identifier for the concrete module implementation.
Implements CANTramModule.
|
inlineoverridevirtual |
Get the hardware version string.
Returns the hardware revision/version string for the module.
Implements CANTramModule.
|
inlineoverridevirtual |
Get number of interfaces provided by the module.
Return the number of entries in the interfaces array returned by getInterfaces().
Implements CANTramModule.
|
inlineoverridevirtual |
Get pointer to module's interface array.
Returns a pointer to the internal Interface* array used by the core to enumerate interfaces.
Implements CANTramModule.
|
overridevirtual |
Get the current state of a digital output.
| def | Output definition containing the pin information |
Implements OutputProvider.

| uint16_t MainModuleV1_0::getTemperatureCelsius | ( | ) |
Get the temperature in Celsius in 0.1°C steps.
Reads ADC samples (digital controller on C3, single reads on ESP32) and converts them to temperature using calibration or approximation. Returns temperature in tenths of a degree Celsius (e.g., 253 means 25.3°C).

|
inlineoverrideprotectedvirtual |
Obtain a pointer to an available UARTCore.
Returns a pointer to a UARTCore instance that can be used by clients. May return nullptr if no UARTCore is available.
Implements UARTProvider.
|
overridevirtual |
Initialize the module and its hardware subsystems.
Initializes UART, PWM, I2C, SPI and ADC subsystems as required by the module. This prepares the module for operation after attachment and resource provisioning.
Initialize the shift register for GPIO expansion.
Configuration of shift register must happen before initialization of the core!
Otherwise errors will be generated since the core is not able to set the initial values of these outputs
Implements CANTramModule.
|
overridevirtual |
Pre-initialize the module after attachment.
Initializes I2C core before main intialization, because the shiftregister needs to be started to set the gpios of the extend bus.
Reimplemented from CANTramModule.

|
overridevirtual |
Provide GPIO output definitions to CANTramCore.
Registers the module's output definition table with CANTramCore so the core can manage GPIO provisioning for this module.
Implements CANTramModule.

|
overridevirtual |
Provide hardware resources (UART, PWM, etc.) to CANTramCore.
Attaches hardware resource instances to the core so other modules may request/use them.
Implements CANTramModule.

|
overridevirtual |
Register a PWM channel for an output.
Initializes PWM core and requests a channel allocation for the given output definition.
| def | Pointer to the OutputDefinition to register for PWM. |
Implements PWMOutputProvider.

|
overridevirtual |
Request GPIOs from the core.
Called by the core when module GPIOs should be configured/allocated. Module should request any runtime GPIOs here.
Implements CANTramModule.
|
overridevirtual |
Request hardware resources from the core.
Called when the module should request any hardware resources it needs. Implement module-specific requests here.
Implements CANTramModule.
|
overridevirtual |
Reset the module and its hardware cores.
Calls reset on UART and PWM cores and resets the shift register to return the module to a known default state.
Reimplemented from CANTramModule.
|
overridevirtual |
Set the logic level on a pin of the module.
| def | Output to set the state |
| state | logic level HIGH or LOW |
Implements OutputProvider.

|
overridevirtual |
Set PWM duty for an output definition.
Validates the output definition for PWM capability and delegates to the PWM core to set the duty cycle.
| def | Pointer to the OutputDefinition describing the output. |
| value | Duty value to set (implementation-specific range). |
Implements PWMOutputProvider.

| OutputDefinition MainModuleV1_0::EXTEND[GPIO_SUPPLY] |