Dataflow Runtime API  3.0.3.0
Public Member Functions | Protected Member Functions | List of all members
imt::base::bsp::driver::GpioDriver Class Reference

Driver to access a single general purpose input / output (GPIO) pin. More...

#include <Imt.Base.BSP/Driver/GpioDriver.h>

Inheritance diagram for imt::base::bsp::driver::GpioDriver:
imt::base::bsp::driver::ConfigurableDriverAbs< imt::base::bsp::type::DriverType::GPIO, GpioDriverConfiguration > imt::base::bsp::module::DriverAbs< TypeId >

Public Member Functions

 GpioDriver (const size_t indexModule, const size_t indexDriver)
 Constructor. More...
 
virtual ~GpioDriver (void)
 Destructor. More...
 
bool isInput (void) const
 Gets if the pin is configured as an input. More...
 
bool isOutput (void) const
 Gets if the pin is configured as an output. More...
 
imt::base::bsp::type::ErrorCode::Id read (bool *const pState) const
 Reads the current state of the pin. More...
 
imt::base::bsp::type::ErrorCode::Id write (const bool state)
 Writes the current state of the pin. More...
 
- Public Member Functions inherited from imt::base::bsp::driver::ConfigurableDriverAbs< imt::base::bsp::type::DriverType::GPIO, GpioDriverConfiguration >
 ConfigurableDriverAbs (const size_t indexModule, const size_t indexPin)
 Constructor. More...
 
virtual ~ConfigurableDriverAbs (void)
 Destructor. More...
 
imt::base::bsp::type::ErrorCode::Id configure (const GpioDriverConfiguration &configuration)
 Configures the driver. More...
 
const GpioDriverConfigurationgetConfiguration (void) const
 Gets the last accepted configuration. More...
 
- Public Member Functions inherited from imt::base::bsp::module::DriverAbs< TypeId >
 DriverAbs (const size_t indexModule, const size_t indexDriver)
 Constructor. More...
 
virtual ~DriverAbs (void)
 Destructor. More...
 
void initialize (void)
 Initialize the driver. More...
 
void enable (void)
 Enable the driver. More...
 
imt::base::bsp::type::ErrorCode::Id start (void)
 Starts the driver. More...
 
imt::base::bsp::type::ErrorCode::Id stop (void)
 Stops the driver. More...
 
size_t getIndexDriver (void) const
 Gets the index of the driver inisde the module. More...
 
size_t getIndexModule (void) const
 Gets the index of the module the driver is part of. More...
 
imt::base::bsp::type::DriverType::Id getType (void) const
 Gets the type of the driver. More...
 
bool isInitialized (void) const
 Gets if the driver has been initialzied. More...
 
bool isEnabled (void) const
 Gets if the driver has been enabled. More...
 
bool isStarted (void) const
 Gets if the driver has been started. More...
 

Protected Member Functions

virtual void onInitialize (void)
 
virtual void onEnable (void)
 
virtual imt::base::bsp::type::ErrorCode::Id onStart (void)
 
virtual imt::base::bsp::type::ErrorCode::Id onStop (void)
 
virtual imt::base::bsp::type::ErrorCode::Id onReconfigure (const Configuration &configuration)
 

Additional Inherited Members

- Public Types inherited from imt::base::bsp::driver::ConfigurableDriverAbs< imt::base::bsp::type::DriverType::GPIO, GpioDriverConfiguration >
typedef GpioDriverConfiguration Configuration
 The type of the driver configuration. More...
 
- Static Public Attributes inherited from imt::base::bsp::module::DriverAbs< TypeId >
static const imt::base::bsp::type::DriverType::Id Type = TypeId
 Constant holding the driver type. More...
 

Detailed Description

Driver to access a single general purpose input / output (GPIO) pin.

Constructor & Destructor Documentation

◆ GpioDriver()

imt::base::bsp::driver::GpioDriver::GpioDriver ( const size_t  indexModule,
const size_t  indexDriver 
)
explicit

Constructor.

Parameters
indexModuleIndex of the module (starting at 0).
indexDriverIndex of the driver (starting at 0).

◆ ~GpioDriver()

virtual imt::base::bsp::driver::GpioDriver::~GpioDriver ( void  )
virtual

Destructor.

Member Function Documentation

◆ isInput()

bool imt::base::bsp::driver::GpioDriver::isInput ( void  ) const

Gets if the pin is configured as an input.

Returns
true Pin is an input false Pin is an output or not configured.

◆ isOutput()

bool imt::base::bsp::driver::GpioDriver::isOutput ( void  ) const

Gets if the pin is configured as an output.

Returns
true Pin is an output false Pin is an input or not configured.

◆ onEnable()

virtual void imt::base::bsp::driver::GpioDriver::onEnable ( void  )
protectedvirtual

◆ onInitialize()

virtual void imt::base::bsp::driver::GpioDriver::onInitialize ( void  )
protectedvirtual

◆ onReconfigure()

virtual imt::base::bsp::type::ErrorCode::Id imt::base::bsp::driver::GpioDriver::onReconfigure ( const Configuration configuration)
protectedvirtual

◆ onStart()

virtual imt::base::bsp::type::ErrorCode::Id imt::base::bsp::driver::GpioDriver::onStart ( void  )
protectedvirtual

◆ onStop()

virtual imt::base::bsp::type::ErrorCode::Id imt::base::bsp::driver::GpioDriver::onStop ( void  )
protectedvirtual

◆ read()

imt::base::bsp::type::ErrorCode::Id imt::base::bsp::driver::GpioDriver::read ( bool *const  pState) const

Reads the current state of the pin.

Parameters
pStateSet to the current state of the pin: false=low, true=high.
Returns
OK State could be read. INVALID_ARGUMENT Null pointer passed. UNINITIALIZED Pin is not configured as input.

◆ write()

imt::base::bsp::type::ErrorCode::Id imt::base::bsp::driver::GpioDriver::write ( const bool  state)

Writes the current state of the pin.

Parameters
stateWhen true the pin is set to high, otherwise to low.
Returns
OK State could be read. UNINITIALIZED Pin is not configured as digital output.

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