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

Driver for a pulse width modulated (PWM) output in the system. More...

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

Inheritance diagram for imt::base::bsp::driver::PwmDriver:
imt::base::bsp::driver::ConfigurableDriverAbs< imt::base::bsp::type::DriverType::PWM, PwmDriverConfiguration > imt::base::bsp::module::DriverAbs< TypeId >

Public Member Functions

 PwmDriver (const size_t indexModule, const size_t indexPin)
 Constructor. More...
 
virtual ~PwmDriver (void)
 Destructor. More...
 
float32_t getDutyCycle (void) const
 Gets the last set duty cycle. More...
 
imt::base::bsp::type::ErrorCode::Id setDutyCycle (const float32_t dutyCycle)
 Sets the duty cycle of the output. More...
 
- Public Member Functions inherited from imt::base::bsp::driver::ConfigurableDriverAbs< imt::base::bsp::type::DriverType::PWM, PwmDriverConfiguration >
 ConfigurableDriverAbs (const size_t indexModule, const size_t indexPin)
 Constructor. More...
 
virtual ~ConfigurableDriverAbs (void)
 Destructor. More...
 
imt::base::bsp::type::ErrorCode::Id configure (const PwmDriverConfiguration &configuration)
 Configures the driver. More...
 
const PwmDriverConfigurationgetConfiguration (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::PWM, PwmDriverConfiguration >
typedef PwmDriverConfiguration 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 for a pulse width modulated (PWM) output in the system.

Constructor & Destructor Documentation

◆ PwmDriver()

imt::base::bsp::driver::PwmDriver::PwmDriver ( const size_t  indexModule,
const size_t  indexPin 
)
explicit

Constructor.

Parameters
indexModuleIndex of the module (starting at 0).
indexPinIndex of the pin (starting at 0).

◆ ~PwmDriver()

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

Destructor.

Member Function Documentation

◆ getDutyCycle()

float32_t imt::base::bsp::driver::PwmDriver::getDutyCycle ( void  ) const

Gets the last set duty cycle.

Returns
Last set duty cycle or hardware default.

◆ onEnable()

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

◆ onInitialize()

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

◆ onReconfigure()

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

◆ onStart()

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

◆ onStop()

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

◆ setDutyCycle()

imt::base::bsp::type::ErrorCode::Id imt::base::bsp::driver::PwmDriver::setDutyCycle ( const float32_t  dutyCycle)

Sets the duty cycle of the output.

Parameters
dutyCycleThe new duty cycle for the output from 0 to 1.
Returns
OK State could be read. UNINITIALIZED Pin is not configured as PWM output.

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