VMX-pi C++ HAL Library for Raspberry Pi
VMX-pi Robotics Controller & Vision/Motion Processor
Public Types | Public Member Functions | Public Attributes | List of all members
DIOConfig Struct Reference

Contains the configuration data for a VMXResource whose VMXResourceType is DigitalIO. More...

#include <VMXResourceConfig.h>

Inheritance diagram for DIOConfig:
VMXResourceConfig

Public Types

enum  OutputMode { PUSHPULL, OPENDRAIN }
 Specifies the electrical behavior of a DigitalIO in output mode.
 
enum  InputMode { PULLUP, PULLDOWN, NONE }
 Specifies the default signal state of a floating DigitalIO in input mode.
 

Public Member Functions

 DIOConfig ()
 DIOConfig default constructor; sets all values to defaults, which are INPUT mode, PULLUP.
 
 DIOConfig (OutputMode outputmode)
 DIOConfig constructor; initializes values with the provided parameters *. More...
 
bool GetInput ()
 returns true if the DigitalIO should be configured in inputmode; returns false if the DigitalIO should be configured as an output
 
OutputMode GetOutputMode ()
 Returns output mode; only valid if this DIOConfig represents a DigitalIO in output mode.
 
InputMode GetInputMode ()
 Returns input mode; only valid if this DIOConfig represents a DigitalIO in input mode.
 
void SetInput (bool input)
 Specifies whether this DIOConfig represents an input or output mode configuration. More...
 
void SetInputMode (InputMode inputmode)
 Specifies the input mode.
 
void SetOutputMode (OutputMode outputmode)
 Specifies the output mode.
 
virtual size_t GetSize () const
 
virtual VMXResourceConfigGetCopy () const
 Instantiates a copy of the configuration data. More...
 
virtual bool Copy (const VMXResourceConfig *p_config)
 Copies the contents of the source VMXResourceConfig object into this object. More...
 
- Public Member Functions inherited from VMXResourceConfig
 VMXResourceConfig (VMXResourceType res_type)
 
VMXResourceType GetResourceType () const
 VMXResourceType which this configuration applies to.
 

Public Attributes

bool input
 
OutputMode outputmode
 
InputMode inputmode
 
- Public Attributes inherited from VMXResourceConfig
VMXResourceType res_type
 

Detailed Description

Contains the configuration data for a VMXResource whose VMXResourceType is DigitalIO.

Constructor & Destructor Documentation

◆ DIOConfig()

DIOConfig::DIOConfig ( OutputMode  outputmode)
inline

DIOConfig constructor; initializes values with the provided parameters *.

Parameters
outputmodeSpecifies the default electrical behavior of a DigitalIO in output mode

Member Function Documentation

◆ Copy()

virtual bool DIOConfig::Copy ( const VMXResourceConfig p_config)
inlinevirtual

Copies the contents of the source VMXResourceConfig object into this object.

NOTE: The source object's VMXResourceType must match this object's VMXResourceType.

Parameters
[in]p_configThe source VMXResourceConfig object from which to copy configuration data into this object.

Implements VMXResourceConfig.

◆ GetCopy()

virtual VMXResourceConfig* DIOConfig::GetCopy ( ) const
inlinevirtual

Instantiates a copy of the configuration data.

NOTE: The caller is responsible to delete the object returned from this method.

Implements VMXResourceConfig.

◆ SetInput()

void DIOConfig::SetInput ( bool  input)
inline

Specifies whether this DIOConfig represents an input or output mode configuration.

Parameters
inputtrue if this DIOConfig represents a DigitalIO in input mode; false if this DIOConfig represents a DigitalIO in ouput mode

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