Uniot Core
0.8.1
Loading...
Searching...
No Matches
uniot::GpioRegister Class Reference

#include <GpioRegister.h>

Inheritance diagram for uniot::GpioRegister:
[legend]

Public Member Functions

 GpioRegister ()
 Default constructor.
 
 ~GpioRegister ()
 Destructor.
 
 GpioRegister (GpioRegister const &)=delete
 Deleted copy constructor to prevent copying.
 
void operator= (GpioRegister const &)=delete
 Deleted assignment operator to prevent assignment.
 
template<typename... Args>
void setDigitalInput (uint8_t first, Args... args)
 Configure pins as digital inputs.
 
template<typename... Args>
void setDigitalOutput (uint8_t first, Args... args)
 Configure pins as digital outputs.
 
template<typename... Args>
void setAnalogInput (uint8_t first, Args... args)
 Configure pins as analog inputs.
 
template<typename... Args>
void setAnalogOutput (uint8_t first, Args... args)
 Configure pins as analog outputs.
 
- Public Member Functions inherited from uniot::Register< uint8_t >
 Register (Register const &)=delete
 Deleted copy constructor to prevent unintended copying.
 
 Register ()
 Constructs an empty Register.
 
void operator= (Register const &)=delete
 Deleted assignment operator to prevent unintended copying.
 
bool setRegister (const String &name, const uint8_t *values, size_t count)
 Sets or replaces a register with the given name and array of values.
 
bool addToRegister (const String &name, const uint8_t &value)
 Adds a single value to an existing register or creates a new one.
 
bool getRegisterValue (const String &name, size_t idx, uint8_t &outValue) const
 Retrieves a value from the register by name and index.
 
bool setRegisterValue (const String &name, size_t idx, const uint8_t &value)
 Updates a value in the register at the specified index.
 
size_t getRegisterLength (const String &name) const
 Gets the number of values in the specified register.
 
void iterateRegisters (IteratorCallback callback) const
 Iterates through all registers and calls the callback function for each one.
 

Protected Member Functions

virtual void _processRegister (const String &name, const uint8_t &value) override
 Override method to process register values.
 

Additional Inherited Members

- Public Types inherited from uniot::Register< uint8_t >
using IteratorCallback
 Function type used for iterating through registers.
 

Constructor & Destructor Documentation

◆ GpioRegister() [1/2]

uniot::GpioRegister::GpioRegister ( )
inline

Default constructor.

Initializes a new instance of the GpioRegister class.

◆ ~GpioRegister()

uniot::GpioRegister::~GpioRegister ( )
inline

Destructor.

◆ GpioRegister() [2/2]

uniot::GpioRegister::GpioRegister ( GpioRegister const & )
delete

Deleted copy constructor to prevent copying.

Member Function Documentation

◆ _processRegister()

virtual void uniot::GpioRegister::_processRegister ( const String & name,
const uint8_t & value )
inlineoverrideprotectedvirtual

Override method to process register values.

Configures the pin mode based on the register name:

  • dread: configures for digital reading (INPUT)
  • dwrite: configures for digital writing (OUTPUT)
  • aread: configures for analog reading (INPUT)
  • awrite: configures for analog writing (OUTPUT)
Parameters
nameThe register name (dread, dwrite, aread, or awrite).
valueThe pin number to configure.

Reimplemented from uniot::Register< uint8_t >.

◆ operator=()

void uniot::GpioRegister::operator= ( GpioRegister const & )
delete

Deleted assignment operator to prevent assignment.

◆ setAnalogInput()

template<typename... Args>
void uniot::GpioRegister::setAnalogInput ( uint8_t first,
Args... args )
inline

Configure pins as analog inputs.

Sets up one or more pins as analog inputs using Arduino's INPUT mode. These pins typically connect to ADC channels.

Template Parameters
ArgsVariadic template for accepting multiple pin numbers.
Parameters
firstThe first pin number to configure.
argsAdditional pin numbers to configure.

◆ setAnalogOutput()

template<typename... Args>
void uniot::GpioRegister::setAnalogOutput ( uint8_t first,
Args... args )
inline

Configure pins as analog outputs.

Sets up one or more pins as analog outputs using Arduino's OUTPUT mode. These pins typically connect to PWM or DAC channels.

Template Parameters
ArgsVariadic template for accepting multiple pin numbers.
Parameters
firstThe first pin number to configure.
argsAdditional pin numbers to configure.

◆ setDigitalInput()

template<typename... Args>
void uniot::GpioRegister::setDigitalInput ( uint8_t first,
Args... args )
inline

Configure pins as digital inputs.

Sets up one or more pins as digital inputs using Arduino's INPUT mode.

Template Parameters
ArgsVariadic template for accepting multiple pin numbers.
Parameters
firstThe first pin number to configure.
argsAdditional pin numbers to configure.

◆ setDigitalOutput()

template<typename... Args>
void uniot::GpioRegister::setDigitalOutput ( uint8_t first,
Args... args )
inline

Configure pins as digital outputs.

Sets up one or more pins as digital outputs using Arduino's OUTPUT mode.

Template Parameters
ArgsVariadic template for accepting multiple pin numbers.
Parameters
firstThe first pin number to configure.
argsAdditional pin numbers to configure.

The documentation for this class was generated from the following file: