1#ifndef ANALOG_MODULE_V1_0_H
2#define ANALOG_MODULE_V1_0_H
8#include "AnalogInput.h"
9#include "AnalogOutput.h"
16 AnalogModuleV1_0() =
default;
19 static const String HW_TYPE;
20 String
getHWType()
const override {
return HW_TYPE; }
21 static const String HW_VERSION;
23 static const String FW_VERSION;
25 static constexpr uint8_t GPIO_DEMAND = 5;
27 static constexpr uint8_t GPIO_SUPPLY = 0;
31 bool attachModule(uint8_t slot, uint8_t gpioStart)
override;
38 void cycle(uint8_t* response)
override;
39 bool reset()
override;
46 static constexpr size_t INTERFACE_COUNT = 8;
55 Interface::Resolution _resolution = Interface::RES_12BIT;
Base class for CANTram hardware modules.
Logging and debug macro definitions for CANTramCore.
Definitions for GPIO/output descriptors and provider interfaces.
bool provideHardwareResources() override
Provide hardware resources to the core.
Definition AnalogModuleV1_0.cpp:72
bool attachModule(uint8_t slot, uint8_t gpioStart) override
Attach module to a slot and set GPIO start.
Definition AnalogModuleV1_0.cpp:17
bool provideGPIOs() override
Provide GPIO definitions to the core.
Definition AnalogModuleV1_0.cpp:28
Interface ** getInterfaces() override
Get pointer to module's interface array.
Definition AnalogModuleV1_0.h:42
size_t getInterfaceCount() override
Get number of interfaces provided by the module.
Definition AnalogModuleV1_0.h:43
String getHWType() const override
Get the hardware type string.
Definition AnalogModuleV1_0.h:20
String getHWVersion() const override
Get the hardware version string.
Definition AnalogModuleV1_0.h:22
uint8_t getGPIOSupply() const override
Get the GPIO supply capacity of the module.
Definition AnalogModuleV1_0.h:28
String getFWVersion() const override
Get the firmware version string.
Definition AnalogModuleV1_0.h:24
uint8_t getGPIODemand() const override
Get the GPIO demand of the module.
Definition AnalogModuleV1_0.h:26
bool requestHardwareResources() override
Request hardware resources required by the module.
Definition AnalogModuleV1_0.cpp:82
bool requestGPIOs() override
Request and configure GPIOs used by the module.
Definition AnalogModuleV1_0.cpp:38
bool initialize() override
Initialize the analog module and external ADC chip interface.
Definition AnalogModuleV1_0.cpp:153
void cycle(uint8_t *response) override
Periodic cycle handler called by the core.
Definition AnalogModuleV1_0.cpp:179
bool addInterfaces() override
Add interface objects to the module's interface list.
Definition AnalogModuleV1_0.cpp:120
bool reset() override
Reset the module and its interfaces.
Definition AnalogModuleV1_0.cpp:219
Analog output interface implementation.
Definition AnalogOutput.h:11
CANTramModule()=default
Default constructor.
Describes an available output (GPIO or shift register bit).
Definition OutputDefinition.h:24