CANTram Framework 1.0.1
Dieses Framework ermöglicht die Nutzung der CANTram Hardware, einer Mikrocontroller basierten mdoularen Steuerung.
Loading...
Searching...
No Matches
RelaisModuleV1_0 Class Reference
Inheritance diagram for RelaisModuleV1_0:
Collaboration diagram for RelaisModuleV1_0:

Public Member Functions

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 attachModule (uint8_t slot, uint8_t gpioStart) override
 Attach this module to a slot and assign GPIO range.
bool provideGPIOs () override
 Provide GPIO definitions to the core.
bool requestGPIOs () override
 Request GPIO definitions from the core.
bool provideHardwareResources () override
 Provide hardware resources (e.g., I2C, SPI, UART) to the core.
bool requestHardwareResources () override
 Request hardware resources from the core.
bool addInterfaces () override
 Setup and validate module interfaces.
bool initialize () override
 Initialize the module after attachment and provisioning.
void cycle (uint8_t *response) override
 Periodic cycle callback.
Interface ** getInterfaces () override
 Get pointer to module's interface array.
size_t getInterfaceCount () override
 Get number of interfaces provided by the module.
Public Member Functions inherited from CANTramModule
 CANTramModule ()=default
 Default constructor.
virtual ~CANTramModule ()=default
 Destructor.
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 bool preInitialize ()
 Pre-initialize the module after attachment and provisioning.

Static Public Attributes

static const String HW_TYPE = "RelaisModule"
static const String HW_VERSION = "1.0"
static const String FW_VERSION = "1.0.0"
static constexpr uint8_t GPIO_DEMAND = 4
static constexpr uint8_t GPIO_SUPPLY = 0

Additional Inherited Members

Protected Attributes inherited from CANTramModule
uint8_t SLOT = 0
uint8_t GPIO_START = 0

Member Function Documentation

◆ addInterfaces()

bool RelaisModuleV1_0::addInterfaces ( )
overridevirtual

Setup and validate module interfaces.

Populate the module's Interface* array, name interfaces and validate them as needed.

Returns
true if interfaces were successfully added and validated, false otherwise.

Implements CANTramModule.

◆ attachModule()

bool RelaisModuleV1_0::attachModule ( uint8_t slot,
uint8_t gpioStart )
overridevirtual

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.

Parameters
slotSlot index to attach the module to.
gpioStartStarting GPIO index assigned to this module.
Returns
true if attachment and provisioning succeeded, false otherwise.

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.

Parameters
slotSlot index to attach the module to.
gpioStartStarting GPIO index assigned to this module.
Returns
true if all initialization steps succeeded, false if any step failed.

Reimplemented from CANTramModule.

Here is the call graph for this function:

◆ cycle()

void RelaisModuleV1_0::cycle ( uint8_t * response)
overridevirtual

Periodic cycle callback.

Called regularly by the core to allow the module to perform time-based tasks.

Parameters
responseOptional pointer to a response buffer where the module may write response bytes. May be nullptr.

Reimplemented from CANTramModule.

Here is the call graph for this function:

◆ getFWVersion()

String RelaisModuleV1_0::getFWVersion ( ) const
inlineoverridevirtual

Get the firmware version string.

Returns the firmware version string implemented by the module.

Returns
String Firmware version (e.g. "1.0").

Implements CANTramModule.

◆ getGPIODemand()

uint8_t RelaisModuleV1_0::getGPIODemand ( ) const
inlineoverridevirtual

Get the GPIO demand of the module.

Returns how many GPIOs this module requires from the core.

Returns
uint8_t Number of GPIOs demanded by the module.

Implements CANTramModule.

◆ getGPIOSupply()

uint8_t RelaisModuleV1_0::getGPIOSupply ( ) const
inlineoverridevirtual

Get the GPIO supply capacity of the module.

Returns how many GPIOs this module provides/supplies to the system.

Returns
uint8_t Number of GPIOs supplied by the module.

Implements CANTramModule.

◆ getHWType()

String RelaisModuleV1_0::getHWType ( ) const
inlineoverridevirtual

Get the hardware type string.

Returns a human readable hardware type identifier for the concrete module implementation.

Returns
String Hardware type identifier (e.g. "MainModuleV1.0").

Implements CANTramModule.

◆ getHWVersion()

String RelaisModuleV1_0::getHWVersion ( ) const
inlineoverridevirtual

Get the hardware version string.

Returns the hardware revision/version string for the module.

Returns
String Hardware version (e.g. "1.0").

Implements CANTramModule.

◆ getInterfaceCount()

size_t RelaisModuleV1_0::getInterfaceCount ( )
inlineoverridevirtual

Get number of interfaces provided by the module.

Return the number of entries in the interfaces array returned by getInterfaces().

Returns
size_t Number of interface pointers.

Implements CANTramModule.

◆ getInterfaces()

Interface ** RelaisModuleV1_0::getInterfaces ( )
overridevirtual

Get pointer to module's interface array.

Returns a pointer to the internal Interface* array used by the core to enumerate interfaces.

Returns
Interface** Pointer to the first element of the module's interfaces array.

Implements CANTramModule.

◆ initialize()

bool RelaisModuleV1_0::initialize ( )
overridevirtual

Initialize the module after attachment and provisioning.

Perform runtime initialization (start drivers, begin peripherals) once all modules have been attached.

Returns
true if initialization succeeded, false otherwise.

Implements CANTramModule.

◆ provideGPIOs()

bool RelaisModuleV1_0::provideGPIOs ( )
overridevirtual

Provide GPIO definitions to the core.

Called during module attachment to allow the module to declare any GPIOs it owns or provides.

Returns
true if GPIO definitions were provided successfully, false otherwise.

Implements CANTramModule.

◆ provideHardwareResources()

bool RelaisModuleV1_0::provideHardwareResources ( )
overridevirtual

Provide hardware resources (e.g., I2C, SPI, UART) to the core.

Called during attachment to attach HardwareResource instances that other modules can request.

Returns
true if resources were successfully provided, false otherwise.

Implements CANTramModule.

◆ requestGPIOs()

bool RelaisModuleV1_0::requestGPIOs ( )
overridevirtual

Request GPIO definitions from the core.

Called after provideGPIOs to obtain runtime GPIO assignments from CANTramCore.

Returns
true if required GPIOs were acquired and validated, false otherwise.

Implements CANTramModule.

Here is the call graph for this function:

◆ requestHardwareResources()

bool RelaisModuleV1_0::requestHardwareResources ( )
overridevirtual

Request hardware resources from the core.

Called when the module should acquire hardware resources supplied by the system (e.g., UART core).

Returns
true if all required hardware resources were granted, false otherwise.

Implements CANTramModule.


The documentation for this class was generated from the following files:
  • C:/Users/leowa/Documents/PlatformIO/Projects/CANTramFrameworkUsage/lib/CANTramFramework/include/RelaisModuleV1_0.h
  • C:/Users/leowa/Documents/PlatformIO/Projects/CANTramFrameworkUsage/lib/CANTramFramework/src/modules/RelaisModuleV1_0.cpp