61 template <
typename... Args>
63 mGpioRegistry.setDigitalInput(first, args...);
73 template <
typename... Args>
75 mGpioRegistry.setDigitalOutput(first, args...);
85 template <
typename... Args>
87 mGpioRegistry.setAnalogInput(first, args...);
97 template <
typename... Args>
99 mGpioRegistry.setAnalogOutput(first, args...);
112 return mObjectRegistry.link(name,
link,
id);
124 bool getGpio(
const String &name,
size_t index, uint8_t &outValue)
const {
125 return mGpioRegistry.getRegisterValue(name, index, outValue);
136 template <
typename T>
138 return mObjectRegistry.get<T>(name, index);
150 auto length = mGpioRegistry.getRegisterLength(name);
152 length = mObjectRegistry.getRegisterLength(name);
170 auto arr = obj.
putArray(name.c_str());
171 for (
size_t i = 0; i < values->size(); i++) {
172 auto &pair = (*values)[i];
173 arr.append(pair.first);
Array & append(int value)
Append an integer to the array.
Definition CBORObject.h:593
Definition CBORObject.h:40
Array putArray(int key)
Create or get an array at a specific integer key.
Definition CBORObject.h:121
Definition GpioRegister.h:38
Definition ObjectRegister.h:46
RegisterManager(RegisterManager const &)=delete
Copy constructor is deleted to prevent unexpected behavior.
void setDigitalOutput(uint8_t first, Args... args)
Sets one or more pins as digital outputs.
Definition RegisterManager.h:74
size_t getRegisterLength(const String &name) const
Gets the number of elements in the specified named register.
Definition RegisterManager.h:149
T * getObject(const String &name, size_t index)
Gets an object of the specified type from a named register.
Definition RegisterManager.h:137
void setAnalogInput(uint8_t first, Args... args)
Sets one or more pins as analog inputs.
Definition RegisterManager.h:86
void serializeRegisters(CBORObject &obj)
Serializes all registers (GPIO and Object) to a CBOR object.
Definition RegisterManager.h:165
RegisterManager()
Default constructor.
Definition RegisterManager.h:42
void setDigitalInput(uint8_t first, Args... args)
Sets one or more pins as digital inputs.
Definition RegisterManager.h:62
void operator=(RegisterManager const &)=delete
Assignment operator is deleted to prevent unexpected behavior.
void setAnalogOutput(uint8_t first, Args... args)
Sets one or more pins as analog outputs.
Definition RegisterManager.h:98
bool getGpio(const String &name, size_t index, uint8_t &outValue) const
Gets a GPIO value from a named register.
Definition RegisterManager.h:124
bool link(const String &name, RecordPtr link, uint32_t id=FOURCC(____))
Links an object to a named register.
Definition RegisterManager.h:111
std::shared_ptr< T > SharedPointer
Type alias for std::shared_ptr with cleaner syntax.
Definition Common.h:160
std::pair< T_First, T_Second > Pair
Type alias for std::pair with cleaner syntax.
Definition Common.h:169
#define FOURCC(name)
Creates a FourCC constant from a string literal.
Definition Common.h:107
ObjectRegisterRecord * RecordPtr
Type alias for ObjectRegisterRecord pointers for better readability.
Definition ObjectRegister.h:33
Contains all classes and functions related to the Uniot Core.