MotionLib  1.0.0
SamBuCa motion library
Public Types | Public Member Functions | List of all members
smc::Gpio Class Referenceabstract
Inheritance diagram for smc::Gpio:
Inheritance graph
[legend]
Collaboration diagram for smc::Gpio:
Collaboration graph
[legend]

Public Types

typedef std::shared_ptr< GpioShared
 
- Public Types inherited from smc::DeviceBase
typedef smc::DeviceType DeviceType
 
typedef std::shared_ptr< DeviceBaseShared
 

Public Member Functions

 Gpio (const std::string &address)
 Construct a new GPIO Device at given location on given platform. More...
 
DeviceType type () const override
 Get device type. More...
 
virtual std::future< void > setIoState (const units::io_port_t &state) const =0
 Set state of this IO. More...
 
virtual std::future< units::io_port_tgetIoState () const =0
 Get current state of this GPIO. More...
 
- Public Member Functions inherited from smc::DeviceBase
DeviceId uid () const
 Get the address of device. More...
 
virtual std::future< std::set< std::string > > listConfig () const
 list device configuration options
 
virtual std::future< std::string > getConfig (const std::string &name) const
 get device configuration value More...
 
virtual std::future< void > setConfig (const std::string &name, const std::string &value) const
 set device configuration value More...
 
virtual bool canConvert (const units::Value &value, units::unit_t unit) const
 Check if unit conversion is possible in a manner specific to this device. More...
 
virtual bool convert (units::Value &value, units::unit_t unit) const
 Convert value in a manner specific to this device. More...
 
std::string toString () const
 debug and logging operation
 

Additional Inherited Members

- Public Attributes inherited from smc::DeviceBase
ccut::Signal< const DeviceBase::Shared & > updateSignal
 device update signal More...
 
- Protected Member Functions inherited from smc::DeviceBase
 DeviceBase (const std::string &uid)
 Construct a new ABaseDevice, linking pointer to platform object. More...
 
- Protected Attributes inherited from smc::DeviceBase
const std::string m_uid
 

Detailed Description

Definition at line 41 of file Gpio.hpp.

Constructor & Destructor Documentation

◆ Gpio()

smc::Gpio::Gpio ( const std::string &  address)

Construct a new GPIO Device at given location on given platform.

Parameters
platformPlatform on which GPIO is located
addressUnique address of the GPIO

Definition at line 31 of file Gpio.cpp.

Member Function Documentation

◆ getIoState()

virtual std::future<units::io_port_t> smc::Gpio::getIoState ( ) const
pure virtual

Get current state of this GPIO.

Returns
future<steps> Future completed with value when command executed.

Implemented in smc::internal::MockGpio, smc::internal::MGrblGpio, smc::internal::MFEEdgeGpio, and smc::internal::GrblGpio.

◆ setIoState()

virtual std::future<void> smc::Gpio::setIoState ( const units::io_port_t state) const
pure virtual

Set state of this IO.

Returns
future<mm> Future completed when action completed

Implemented in smc::internal::MockGpio, smc::internal::MGrblGpio, smc::internal::MFEEdgeGpio, and smc::internal::GrblGpio.

◆ type()

DeviceBase::DeviceType smc::Gpio::type ( ) const
overridevirtual

Get device type.

Returns
DeviceType GPIO device type

Implements smc::DeviceBase.

Definition at line 33 of file Gpio.cpp.


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