Dataflow Runtime API  3.0.3.0
Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
imt::base::bsp::module::DriverAbs< TypeId > Class Template Referenceabstract

Base class for all drivers in the BSP. More...

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

Inheritance diagram for imt::base::bsp::module::DriverAbs< TypeId >:
imt::base::bsp::driver::ConfigurableDriverAbs< imt::base::bsp::type::DriverType::SPI, SpiDriverConfiguration > imt::base::bsp::driver::ConfigurableDriverAbs< imt::base::bsp::type::DriverType::CAN, CanDriverConfiguration > imt::base::bsp::driver::ConfigurableDriverAbs< imt::base::bsp::type::DriverType::GPIO, GpioDriverConfiguration > imt::base::bsp::driver::ConfigurableDriverAbs< imt::base::bsp::type::DriverType::PWM, PwmDriverConfiguration > imt::base::bsp::driver::ConfigurableDriverAbs< imt::base::bsp::type::DriverType::USART, UsartDriverConfiguration > imt::base::bsp::driver::ConfigurableDriverAbs< imt::base::bsp::type::DriverType::I2C, I2CDriverConfiguration > imt::base::bsp::driver::ConfigurableDriverAbs< TypeId, ConfigurationType > imt::base::bsp::driver::SpiDriver imt::base::bsp::driver::CanDriver imt::base::bsp::driver::GpioDriver imt::base::bsp::driver::PwmDriver imt::base::bsp::driver::UsartDriver imt::base::bsp::driver::I2CDriver

Public Member Functions

 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...
 

Static Public Attributes

static const imt::base::bsp::type::DriverType::Id Type = TypeId
 Constant holding the driver type. More...
 

Protected Member Functions

virtual void onInitialize ()=0
 Called when the driver is initialized. More...
 
virtual void onEnable ()=0
 Called when the driver is enabled. More...
 
virtual imt::base::bsp::type::ErrorCode::Id onStart ()=0
 Called whenever the driver is started. More...
 
virtual imt::base::bsp::type::ErrorCode::Id onStop ()=0
 Called whenever the driver is stopped. More...
 

Detailed Description

template<imt::base::bsp::type::DriverType::Id TypeId>
class imt::base::bsp::module::DriverAbs< TypeId >

Base class for all drivers in the BSP.

Constructor & Destructor Documentation

◆ DriverAbs()

template<imt::base::bsp::type::DriverType::Id TypeId>
imt::base::bsp::module::DriverAbs< TypeId >::DriverAbs ( const size_t  indexModule,
const size_t  indexDriver 
)
inlineexplicit

Constructor.

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

◆ ~DriverAbs()

template<imt::base::bsp::type::DriverType::Id TypeId>
virtual imt::base::bsp::module::DriverAbs< TypeId >::~DriverAbs ( void  )
inlinevirtual

Destructor.

Member Function Documentation

◆ enable()

template<imt::base::bsp::type::DriverType::Id TypeId>
void imt::base::bsp::module::DriverAbs< TypeId >::enable ( void  )
inline

Enable the driver.

This includes enabling of required interrupts and clocks. This method is called once before the runtime is started.

◆ getIndexDriver()

template<imt::base::bsp::type::DriverType::Id TypeId>
size_t imt::base::bsp::module::DriverAbs< TypeId >::getIndexDriver ( void  ) const
inline

Gets the index of the driver inisde the module.

Returns
The index (starting at 0).

◆ getIndexModule()

template<imt::base::bsp::type::DriverType::Id TypeId>
size_t imt::base::bsp::module::DriverAbs< TypeId >::getIndexModule ( void  ) const
inline

Gets the index of the module the driver is part of.

Returns
The index (starting at 0).

◆ getType()

template<imt::base::bsp::type::DriverType::Id TypeId>
imt::base::bsp::type::DriverType::Id imt::base::bsp::module::DriverAbs< TypeId >::getType ( void  ) const
inline

Gets the type of the driver.

Returns
The drive type.

◆ initialize()

template<imt::base::bsp::type::DriverType::Id TypeId>
void imt::base::bsp::module::DriverAbs< TypeId >::initialize ( void  )
inline

Initialize the driver.

This includes configuration of all registers for the driver. This method is called once when the BSP is intitalized.

◆ isEnabled()

template<imt::base::bsp::type::DriverType::Id TypeId>
bool imt::base::bsp::module::DriverAbs< TypeId >::isEnabled ( void  ) const
inline

Gets if the driver has been enabled.

Returns
True if the driver has been enabled.

◆ isInitialized()

template<imt::base::bsp::type::DriverType::Id TypeId>
bool imt::base::bsp::module::DriverAbs< TypeId >::isInitialized ( void  ) const
inline

Gets if the driver has been initialzied.

Returns
True if driver is initialized.

◆ isStarted()

template<imt::base::bsp::type::DriverType::Id TypeId>
bool imt::base::bsp::module::DriverAbs< TypeId >::isStarted ( void  ) const
inline

Gets if the driver has been started.

Returns
True if the driver has been started.

◆ onEnable()

template<imt::base::bsp::type::DriverType::Id TypeId>
virtual void imt::base::bsp::module::DriverAbs< TypeId >::onEnable ( )
protectedpure virtual

◆ onInitialize()

template<imt::base::bsp::type::DriverType::Id TypeId>
virtual void imt::base::bsp::module::DriverAbs< TypeId >::onInitialize ( )
protectedpure virtual

◆ onStart()

template<imt::base::bsp::type::DriverType::Id TypeId>
virtual imt::base::bsp::type::ErrorCode::Id imt::base::bsp::module::DriverAbs< TypeId >::onStart ( )
protectedpure virtual

◆ onStop()

template<imt::base::bsp::type::DriverType::Id TypeId>
virtual imt::base::bsp::type::ErrorCode::Id imt::base::bsp::module::DriverAbs< TypeId >::onStop ( )
protectedpure virtual

◆ start()

template<imt::base::bsp::type::DriverType::Id TypeId>
imt::base::bsp::type::ErrorCode::Id imt::base::bsp::module::DriverAbs< TypeId >::start ( void  )
inline

Starts the driver.

This method may be called during runtime.

Returns
OK Driver is started. UNINITIALIZED Driver is not a initialized. UNSUPORTED Driver does not require start/stop and is always running. INVALID_STATE Driver is not started (already running).

◆ stop()

template<imt::base::bsp::type::DriverType::Id TypeId>
imt::base::bsp::type::ErrorCode::Id imt::base::bsp::module::DriverAbs< TypeId >::stop ( void  )
inline

Stops the driver.

This method may be called during runtime.

Returns
OK Driver is stopped. UNINITIALIZED Driver is not a initialized. UNSUPORTED Driver does not require start/stop and is always running. INVALID_STATE Driver is not stopped (not running).

Member Data Documentation

◆ Type

template<imt::base::bsp::type::DriverType::Id TypeId>
const imt::base::bsp::type::DriverType::Id imt::base::bsp::module::DriverAbs< TypeId >::Type = TypeId
static

Constant holding the driver type.


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