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

Public Member Functions | |
| CANTramModule ()=default | |
| Default constructor. | |
| virtual | ~CANTramModule ()=default |
| Destructor. | |
| virtual String | getHWType () const =0 |
| Get the hardware type string. | |
| virtual String | getHWVersion () const =0 |
| Get the hardware version string. | |
| virtual String | getFWVersion () const =0 |
| Get the firmware version string. | |
| virtual uint8_t | getGPIODemand () const =0 |
| Get the GPIO demand of the module. | |
| virtual uint8_t | getGPIOSupply () const =0 |
| Get the GPIO supply capacity of the module. | |
| virtual bool | reset () |
| Reset the module to a known default state. | |
| uint8_t | getSlot () const |
| Get assigned slot index. | |
| uint8_t | getGPIOStart () const |
| Get starting GPIO index assigned to the module. | |
| virtual void | cycle (uint8_t *response) |
| Periodic cycle callback. | |
| virtual bool | attachModule (uint8_t slot, uint8_t gpioStart) |
| Attach this module to a slot and assign GPIO range. | |
| virtual bool | provideGPIOs ()=0 |
| Provide GPIO definitions to the core. | |
| virtual bool | requestGPIOs ()=0 |
| Request GPIO definitions from the core. | |
| virtual bool | provideHardwareResources ()=0 |
| Provide hardware resources (e.g., I2C, SPI, UART) to the core. | |
| virtual bool | requestHardwareResources ()=0 |
| Request hardware resources from the core. | |
| virtual bool | addInterfaces ()=0 |
| Setup and validate module interfaces. | |
| virtual bool | preInitialize () |
| Pre-initialize the module after attachment and provisioning. | |
| virtual bool | initialize ()=0 |
| Initialize the module after attachment and provisioning. | |
| virtual Interface ** | getInterfaces ()=0 |
| Get pointer to module's interface array. | |
| virtual size_t | getInterfaceCount ()=0 |
| Get number of interfaces provided by the module. | |
Protected Attributes | |
| uint8_t | SLOT = 0 |
| uint8_t | GPIO_START = 0 |
|
default |
Default constructor.
Constructs an empty CANTramModule instance. Derived classes should perform initialization in attachModule()/initialize().
|
virtualdefault |
Destructor.
Virtual destructor to ensure proper cleanup in derived classes.
|
pure virtual |
Setup and validate module interfaces.
Populate the module's Interface* array, name interfaces and validate them as needed.
Implemented in AnalogModuleV1_0, BusModuleV1_0, DigitalModuleV1_0, MainModuleV1_0, and RelaisModuleV1_0.

|
virtual |
Attach this module to a slot and assign GPIO range.
Attach this module to a slot and assign its GPIO range.
Initializes the module's internal SLOT and GPIO_START and triggers GPIO/resource provisioning and interface registration sequences.
| slot | Slot index to attach the module to. |
| gpioStart | Starting GPIO index assigned to this module. |
Sets the module's SLOT and GPIO_START values, logs the attachment and runs the standard initialization sequence: provideGPIOs, provideHardwareResources, requestGPIOs, requestHardwareResources and addInterfaces. Logs success or warnings based on the combined result.
| slot | Slot index to attach the module to. |
| gpioStart | Starting GPIO index assigned to this module. |
Reimplemented in AnalogModuleV1_0, BusModuleV1_0, DigitalModuleV1_0, MainModuleV1_0, and RelaisModuleV1_0.


|
inlinevirtual |
Periodic cycle callback.
Called regularly by the core to allow the module to perform time-based tasks.
| response | Optional pointer to a response buffer where the module may write response bytes. May be nullptr. |
Reimplemented in AnalogModuleV1_0, BusModuleV1_0, DigitalModuleV1_0, MainModuleV1_0, and RelaisModuleV1_0.


|
pure virtual |
Get the firmware version string.
Returns the firmware version string implemented by the module.
Implemented in AnalogModuleV1_0, BusModuleV1_0, DigitalModuleV1_0, MainModuleV1_0, and RelaisModuleV1_0.
|
pure virtual |
Get the GPIO demand of the module.
Returns how many GPIOs this module requires from the core.
Implemented in AnalogModuleV1_0, BusModuleV1_0, DigitalModuleV1_0, MainModuleV1_0, and RelaisModuleV1_0.
|
inline |
Get starting GPIO index assigned to the module.
Returns the first GPIO index allocated to this module.

|
pure virtual |
Get the GPIO supply capacity of the module.
Returns how many GPIOs this module provides/supplies to the system.
Implemented in AnalogModuleV1_0, BusModuleV1_0, DigitalModuleV1_0, MainModuleV1_0, and RelaisModuleV1_0.
|
pure virtual |
Get the hardware type string.
Returns a human readable hardware type identifier for the concrete module implementation.
Implemented in AnalogModuleV1_0, BusModuleV1_0, DigitalModuleV1_0, MainModuleV1_0, and RelaisModuleV1_0.

|
pure virtual |
Get the hardware version string.
Returns the hardware revision/version string for the module.
Implemented in AnalogModuleV1_0, BusModuleV1_0, DigitalModuleV1_0, MainModuleV1_0, and RelaisModuleV1_0.
|
pure virtual |
Get number of interfaces provided by the module.
Return the number of entries in the interfaces array returned by getInterfaces().
Implemented in AnalogModuleV1_0, BusModuleV1_0, DigitalModuleV1_0, MainModuleV1_0, and RelaisModuleV1_0.
|
pure virtual |
Get pointer to module's interface array.
Returns a pointer to the internal Interface* array used by the core to enumerate interfaces.
Implemented in AnalogModuleV1_0, BusModuleV1_0, DigitalModuleV1_0, MainModuleV1_0, and RelaisModuleV1_0.
|
inline |
Get assigned slot index.
Returns the slot index the module was attached to via attachModule().

|
pure virtual |
Initialize the module after attachment and provisioning.
Perform runtime initialization (start drivers, begin peripherals) once all modules have been attached.
Implemented in AnalogModuleV1_0, BusModuleV1_0, DigitalModuleV1_0, MainModuleV1_0, and RelaisModuleV1_0.
|
inlinevirtual |
Pre-initialize the module after attachment and provisioning.
Perform any pre-initialization steps before the main initialize() call. May be used to establish e.g. i2c communication needed for initialization.
Reimplemented in BusModuleV1_0, and MainModuleV1_0.
|
pure virtual |
Provide GPIO definitions to the core.
Called during module attachment to allow the module to declare any GPIOs it owns or provides.
Implemented in AnalogModuleV1_0, BusModuleV1_0, DigitalModuleV1_0, MainModuleV1_0, and RelaisModuleV1_0.

|
pure virtual |
Provide hardware resources (e.g., I2C, SPI, UART) to the core.
Called during attachment to attach HardwareResource instances that other modules can request.
Implemented in AnalogModuleV1_0, BusModuleV1_0, DigitalModuleV1_0, MainModuleV1_0, and RelaisModuleV1_0.

|
pure virtual |
Request GPIO definitions from the core.
Called after provideGPIOs to obtain runtime GPIO assignments from CANTramCore.
Implemented in AnalogModuleV1_0, BusModuleV1_0, DigitalModuleV1_0, MainModuleV1_0, and RelaisModuleV1_0.

|
pure virtual |
Request hardware resources from the core.
Called when the module should acquire hardware resources supplied by the system (e.g., UART core).
Implemented in AnalogModuleV1_0, BusModuleV1_0, DigitalModuleV1_0, MainModuleV1_0, and RelaisModuleV1_0.

|
virtual |
Reset the module to a known default state.
Optional override for module-specific reset logic. Base implementation should be safe to call.
Default implementation performs module reset actions. It logs the reset operation and returns true. Derived classes may override to perform additional hardware or state reset behavior.
Reimplemented in AnalogModuleV1_0, BusModuleV1_0, and MainModuleV1_0.
