1#ifndef RELAISMODULEV1_0_H
2#define RELAISMODULEV1_0_H
7#include "RelaisInterface.h"
13 RelaisModuleV1_0() =
default;
14 static const String HW_TYPE;
15 String
getHWType()
const override {
return HW_TYPE; }
16 static const String HW_VERSION;
18 static const String FW_VERSION;
21 static constexpr uint8_t GPIO_DEMAND = 4;
23 static constexpr uint8_t GPIO_SUPPLY = 0;
26 bool attachModule(uint8_t slot, uint8_t gpioStart)
override;
36 void cycle(uint8_t* response)
override;
43 static constexpr size_t INTERFACE_COUNT = 4;
Base class for CANTram hardware modules.
Definitions for GPIO/output descriptors and provider interfaces.
CANTramModule()=default
Default constructor.
Describes an available output (GPIO or shift register bit).
Definition OutputDefinition.h:24
Definition RelaisInterface.h:6
uint8_t getGPIODemand() const override
Get the GPIO demand of the module.
Definition RelaisModuleV1_0.h:22
bool attachModule(uint8_t slot, uint8_t gpioStart) override
Attach this module to a slot and assign GPIO range.
Definition RelaisModuleV1_0.cpp:9
String getHWVersion() const override
Get the hardware version string.
Definition RelaisModuleV1_0.h:17
String getFWVersion() const override
Get the firmware version string.
Definition RelaisModuleV1_0.h:19
void cycle(uint8_t *response) override
Periodic cycle callback.
Definition RelaisModuleV1_0.cpp:69
bool provideGPIOs() override
Provide GPIO definitions to the core.
Definition RelaisModuleV1_0.cpp:17
Interface ** getInterfaces() override
Get pointer to module's interface array.
Definition RelaisModuleV1_0.cpp:83
bool requestHardwareResources() override
Request hardware resources from the core.
Definition RelaisModuleV1_0.cpp:45
uint8_t getGPIOSupply() const override
Get the GPIO supply capacity of the module.
Definition RelaisModuleV1_0.h:24
bool provideHardwareResources() override
Provide hardware resources (e.g., I2C, SPI, UART) to the core.
Definition RelaisModuleV1_0.cpp:41
bool addInterfaces() override
Setup and validate module interfaces.
Definition RelaisModuleV1_0.cpp:49
String getHWType() const override
Get the hardware type string.
Definition RelaisModuleV1_0.h:15
size_t getInterfaceCount() override
Get number of interfaces provided by the module.
Definition RelaisModuleV1_0.h:39
bool initialize() override
Initialize the module after attachment and provisioning.
Definition RelaisModuleV1_0.cpp:65
bool requestGPIOs() override
Request GPIO definitions from the core.
Definition RelaisModuleV1_0.cpp:21