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.h
1#ifndef RELAISMODULEV1_0_H
2#define RELAISMODULEV1_0_H
3
4#include "CANTramModule.h"
5#include <Arduino.h>
6#include "Interface.h"
7#include "RelaisInterface.h"
8#include "Outputdefinition.h"
9
10class RelaisModuleV1_0 : public CANTramModule{
11 public:
12
13 RelaisModuleV1_0() = default;
14 static const String HW_TYPE;
15 String getHWType() const override { return HW_TYPE; }
16 static const String HW_VERSION;
17 String getHWVersion() const override { return HW_VERSION; }
18 static const String FW_VERSION;
19 String getFWVersion() const override { return FW_VERSION; }
20
21 static constexpr uint8_t GPIO_DEMAND = 4;
22 uint8_t getGPIODemand() const override { return GPIO_DEMAND; }
23 static constexpr uint8_t GPIO_SUPPLY = 0;
24 uint8_t getGPIOSupply() const override { return GPIO_SUPPLY; }
25
26 bool attachModule(uint8_t slot, uint8_t gpioStart) override;
27
28 bool provideGPIOs() override;
29 bool requestGPIOs() override ;
30 bool provideHardwareResources() override;
31 bool requestHardwareResources() override;
32 bool addInterfaces() override;
33
34 bool initialize() override;
35
36 void cycle(uint8_t* response) override;
37
38 Interface** getInterfaces() override;
39 size_t getInterfaceCount() override { return INTERFACE_COUNT; }
40
41 private:
42
43 static constexpr size_t INTERFACE_COUNT = 4;
44 RelaisInterface _relaisInterfaces[INTERFACE_COUNT];
45 Interface* _interfaces[INTERFACE_COUNT];
46 OutputDefinition* _relaisGPIOs[INTERFACE_COUNT];
47
48};
49
50#endif
Base class for CANTram hardware modules.
Definitions for GPIO/output descriptors and provider interfaces.
CANTramModule()=default
Default constructor.
Definition Interface.h:7
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