![]() |
Dataflow Runtime API
3.0.3.0
|
Driver to access a single general purpose input / output (GPIO) pin. More...
#include <Imt.Base.BSP/Driver/GpioDriver.h>
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... | |
![]() | |
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 GpioDriverConfiguration & | getConfiguration (void) const |
Gets the last accepted configuration. More... | |
![]() | |
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 | |
![]() | |
typedef GpioDriverConfiguration | Configuration |
The type of the driver configuration. More... | |
![]() | |
static const imt::base::bsp::type::DriverType::Id | Type = TypeId |
Constant holding the driver type. More... | |
Driver to access a single general purpose input / output (GPIO) pin.
|
explicit |
Constructor.
indexModule | Index of the module (starting at 0). |
indexDriver | Index of the driver (starting at 0). |
|
virtual |
Destructor.
bool imt::base::bsp::driver::GpioDriver::isInput | ( | void | ) | const |
Gets if the pin is configured as an input.
bool imt::base::bsp::driver::GpioDriver::isOutput | ( | void | ) | const |
Gets if the pin is configured as an output.
|
protectedvirtual |
Implements imt::base::bsp::module::DriverAbs< TypeId >.
|
protectedvirtual |
Implements imt::base::bsp::module::DriverAbs< TypeId >.
|
protectedvirtual |
|
protectedvirtual |
Implements imt::base::bsp::module::DriverAbs< TypeId >.
|
protectedvirtual |
Implements imt::base::bsp::module::DriverAbs< TypeId >.
imt::base::bsp::type::ErrorCode::Id imt::base::bsp::driver::GpioDriver::read | ( | bool *const | pState | ) | const |
Reads the current state of the pin.
pState | Set to the current state of the pin: false=low, true=high. |
imt::base::bsp::type::ErrorCode::Id imt::base::bsp::driver::GpioDriver::write | ( | const bool | state | ) |
Writes the current state of the pin.
state | When true the pin is set to high, otherwise to low. |