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

Interface for all modules in the BSP. More...

#include <Imt.Base.BSP/Module/ModuleAbs.h>

Public Member Functions

 ModuleAbs (const size_t indexModule, const size_t numberOfModules, const size_t numberOfDrivers)
 Constructor. More...
 
virtual ~ModuleAbs (void)
 Destructor. More...
 
void initialize (void)
 Initialize the module and all drivers. More...
 
void enable (void)
 Enable the module (but not its drivers). More...
 
imt::base::bsp::type::ErrorCode::Id start (void)
 Starts the module. More...
 
imt::base::bsp::type::ErrorCode::Id stop (void)
 Stops the module. More...
 
Driver * getDriver (const size_t indexDriver)
 Gets the given driver. More...
 
size_t getIndexModule (void) const
 Gets the index of the module. More...
 
size_t getNumberOfDrivers (void) const
 Gets the number of drivers provided by this module. More...
 
imt::base::bsp::type::DriverType::Id getType (void) const
 Gets the type of the module. More...
 
bool isInitialized (void) const
 Gets if the module has been initialzied. More...
 
bool isEnabled (void) const
 Gets if the module has been enabled. More...
 
bool isStarted (void) const
 Gets if the module 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 module is initialized. More...
 
virtual void onEnable ()=0
 Called when the module is enabled. More...
 
virtual imt::base::bsp::type::ErrorCode::Id onStart ()=0
 Called whenever the module is started. More...
 
virtual imt::base::bsp::type::ErrorCode::Id onStop ()=0
 Called whenever the driver is stopped. More...
 

Detailed Description

template<typename Driver, imt::base::bsp::type::DriverType::Id TypeId>
class imt::base::bsp::module::ModuleAbs< Driver, TypeId >

Interface for all modules in the BSP.

How to use: Initialize System clock before initialize module. 1) initialize()

Constructor & Destructor Documentation

◆ ModuleAbs()

template<typename Driver , imt::base::bsp::type::DriverType::Id TypeId>
imt::base::bsp::module::ModuleAbs< Driver, TypeId >::ModuleAbs ( const size_t  indexModule,
const size_t  numberOfModules,
const size_t  numberOfDrivers 
)
inlineexplicit

Constructor.

Parameters
indexModuleIndex of the module (starting at 0).
numberOfModulesTotal number of modules of this type.
numberOfDriversTotal number of drivers in this module.

◆ ~ModuleAbs()

template<typename Driver , imt::base::bsp::type::DriverType::Id TypeId>
virtual imt::base::bsp::module::ModuleAbs< Driver, TypeId >::~ModuleAbs ( void  )
inlinevirtual

Destructor.

Member Function Documentation

◆ enable()

template<typename Driver , imt::base::bsp::type::DriverType::Id TypeId>
void imt::base::bsp::module::ModuleAbs< Driver, TypeId >::enable ( void  )
inline

Enable the module (but not its drivers).

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

◆ getDriver()

template<typename Driver , imt::base::bsp::type::DriverType::Id TypeId>
Driver* imt::base::bsp::module::ModuleAbs< Driver, TypeId >::getDriver ( const size_t  indexDriver)
inline

Gets the given driver.

Parameters
indexDriverThe index of the driver.
Returns
The driver instance.

◆ getIndexModule()

template<typename Driver , imt::base::bsp::type::DriverType::Id TypeId>
size_t imt::base::bsp::module::ModuleAbs< Driver, TypeId >::getIndexModule ( void  ) const
inline

Gets the index of the module.

Returns
The index (starting at 0).

◆ getNumberOfDrivers()

template<typename Driver , imt::base::bsp::type::DriverType::Id TypeId>
size_t imt::base::bsp::module::ModuleAbs< Driver, TypeId >::getNumberOfDrivers ( void  ) const
inline

Gets the number of drivers provided by this module.

Returns
Number of drivers.

◆ getType()

template<typename Driver , imt::base::bsp::type::DriverType::Id TypeId>
imt::base::bsp::type::DriverType::Id imt::base::bsp::module::ModuleAbs< Driver, TypeId >::getType ( void  ) const
inline

Gets the type of the module.

Returns
The drive type.

◆ initialize()

template<typename Driver , imt::base::bsp::type::DriverType::Id TypeId>
void imt::base::bsp::module::ModuleAbs< Driver, TypeId >::initialize ( void  )
inline

Initialize the module and all drivers.

This includes configuration of all pins this module uses as well as any interrupts and other configurations. This method is called once when the BSP is intitalized.

◆ isEnabled()

template<typename Driver , imt::base::bsp::type::DriverType::Id TypeId>
bool imt::base::bsp::module::ModuleAbs< Driver, TypeId >::isEnabled ( void  ) const
inline

Gets if the module has been enabled.

Returns
True if the module has been enabled.

◆ isInitialized()

template<typename Driver , imt::base::bsp::type::DriverType::Id TypeId>
bool imt::base::bsp::module::ModuleAbs< Driver, TypeId >::isInitialized ( void  ) const
inline

Gets if the module has been initialzied.

Returns
True if the module has been initialized.

◆ isStarted()

template<typename Driver , imt::base::bsp::type::DriverType::Id TypeId>
bool imt::base::bsp::module::ModuleAbs< Driver, TypeId >::isStarted ( void  ) const
inline

Gets if the module has been started.

Returns
True if the module has been started.

◆ onEnable()

template<typename Driver , imt::base::bsp::type::DriverType::Id TypeId>
virtual void imt::base::bsp::module::ModuleAbs< Driver, TypeId >::onEnable ( )
protectedpure virtual

◆ onInitialize()

template<typename Driver , imt::base::bsp::type::DriverType::Id TypeId>
virtual void imt::base::bsp::module::ModuleAbs< Driver, TypeId >::onInitialize ( )
protectedpure virtual

◆ onStart()

template<typename Driver , imt::base::bsp::type::DriverType::Id TypeId>
virtual imt::base::bsp::type::ErrorCode::Id imt::base::bsp::module::ModuleAbs< Driver, TypeId >::onStart ( )
protectedpure virtual

◆ onStop()

template<typename Driver , imt::base::bsp::type::DriverType::Id TypeId>
virtual imt::base::bsp::type::ErrorCode::Id imt::base::bsp::module::ModuleAbs< Driver, TypeId >::onStop ( )
protectedpure virtual

◆ start()

template<typename Driver , imt::base::bsp::type::DriverType::Id TypeId>
imt::base::bsp::type::ErrorCode::Id imt::base::bsp::module::ModuleAbs< Driver, TypeId >::start ( void  )
inline

Starts the module.

This method may be called during runtime. This will NOT call start on each driver !

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

◆ stop()

template<typename Driver , imt::base::bsp::type::DriverType::Id TypeId>
imt::base::bsp::type::ErrorCode::Id imt::base::bsp::module::ModuleAbs< Driver, TypeId >::stop ( void  )
inline

Stops the module.

This method may be called during runtime. This will NOT call stop on each driver !

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

Member Data Documentation

◆ Type

template<typename Driver , imt::base::bsp::type::DriverType::Id TypeId>
const imt::base::bsp::type::DriverType::Id imt::base::bsp::module::ModuleAbs< Driver, TypeId >::Type = TypeId
static

Constant holding the driver type.


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