![]() |
Dataflow Runtime API
3.0.3.0
|
Driver for a high level peripheral. More...
#include <Imt.Base.BSP/Driver/HighLevelDriver.h>
Public Member Functions | |
HighLevelDriver (const size_t indexModule, const size_t indexDriver) | |
Constructor. More... | |
virtual | ~HighLevelDriver (void) |
Destructor. More... | |
imt::base::bsp::type::ErrorCode::Id | configure (const uint8_t *const pConfiguration, const size_t configurationSize) |
Configures the driver. More... | |
imt::base::bsp::type::ErrorCode::Id | getConfiguration (uint8_t *const pBuffer, const size_t bufferSize) const |
Gets the last accepted configuration. More... | |
imt::base::bsp::type::ErrorCode::Id | getConfigurationProperty (const size_t indexProperty, uint8_t *const pBuffer, const size_t bufferSize) const |
Gets a configuration property. More... | |
size_t | getConfigurationSize (void) const |
Gets the number of bytes of the configuration object. More... | |
size_t | getConfigurationPropertyCount (void) const |
Gets the number of properties in the configuration object. More... | |
size_t | getConfigurationPropertySize (const size_t indexProperty) const |
Gets the number of bytes of a single property inside the configuration object. More... | |
size_t | getValueCount (void) const |
Gets the number of endpoints in the driver. More... | |
size_t | getValueSize (const size_t indexEndpoint) const |
Gets the size of the value used for a certain endpoint. More... | |
bool | isValue (const size_t indexEndpoint) const |
Checks wether the endpoint exists. More... | |
imt::base::bsp::type::ErrorCode::Id | readValue (const size_t indexEndpoint, uint8_t *const pBuffer, const size_t bufferSize) const |
Reads a value from the given endpoint. More... | |
imt::base::bsp::type::ErrorCode::Id | writeValue (const size_t indexEndpoint, const uint8_t *const pData, const size_t dataSize) const |
Writes a value to the given endpoint. More... | |
imt::base::bsp::type::ErrorCode::Id | registerValueHandler (const size_t indexEndpoint, imt::base::bsp::handler::HighLevelValueHandlerIfc *const pHandler) const |
Registers a handler for the given endpoint that is called when the value changes. More... | |
imt::base::bsp::type::ErrorCode::Id | unregisterValueHandler (const size_t indexEndpoint) const |
Removes the handler for the given endpoint. 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) |
Additional Inherited Members | |
![]() | |
static const imt::base::bsp::type::DriverType::Id | Type |
Constant holding the driver type. More... | |
Driver for a high level peripheral.
This driver used a generic interface so that the BSP creator can define the number and size of the configuration properties and the values the driver provides.
|
explicit |
Constructor.
indexModule | Index of the module (starting at 0). |
indexDriver | Index of the driver (starting at 0). |
|
virtual |
Destructor.
imt::base::bsp::type::ErrorCode::Id imt::base::bsp::driver::HighLevelDriver::configure | ( | const uint8_t *const | pConfiguration, |
const size_t | configurationSize | ||
) |
Configures the driver.
Used to change the driver configuration. The configuration is applied only if it is valid, otherwise the old configuration remains active.
pConfiguration | The byte array containing the configuration. |
configurationSize | Number of bytes provided. |
imt::base::bsp::type::ErrorCode::Id imt::base::bsp::driver::HighLevelDriver::getConfiguration | ( | uint8_t *const | pBuffer, |
const size_t | bufferSize | ||
) | const |
Gets the last accepted configuration.
pBuffer | The configuration is written to the buffer. |
bufferSize | Number of bytes the buffer can hold. |
imt::base::bsp::type::ErrorCode::Id imt::base::bsp::driver::HighLevelDriver::getConfigurationProperty | ( | const size_t | indexProperty, |
uint8_t *const | pBuffer, | ||
const size_t | bufferSize | ||
) | const |
Gets a configuration property.
indexProperty | The index of the property to read. |
pBuffer | The property is written to the buffer. |
bufferSize | Number of bytes the buffer can hold. |
size_t imt::base::bsp::driver::HighLevelDriver::getConfigurationPropertyCount | ( | void | ) | const |
Gets the number of properties in the configuration object.
size_t imt::base::bsp::driver::HighLevelDriver::getConfigurationPropertySize | ( | const size_t | indexProperty | ) | const |
Gets the number of bytes of a single property inside the configuration object.
indexProperty | The index of the property. |
size_t imt::base::bsp::driver::HighLevelDriver::getConfigurationSize | ( | void | ) | const |
Gets the number of bytes of the configuration object.
size_t imt::base::bsp::driver::HighLevelDriver::getValueCount | ( | void | ) | const |
Gets the number of endpoints in the driver.
size_t imt::base::bsp::driver::HighLevelDriver::getValueSize | ( | const size_t | indexEndpoint | ) | const |
Gets the size of the value used for a certain endpoint.
indexEndpoint | The index of the endpoint. |
bool imt::base::bsp::driver::HighLevelDriver::isValue | ( | const size_t | indexEndpoint | ) | const |
Checks wether the endpoint exists.
indexEndpoint | The index of the endpoint. |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
imt::base::bsp::type::ErrorCode::Id imt::base::bsp::driver::HighLevelDriver::readValue | ( | const size_t | indexEndpoint, |
uint8_t *const | pBuffer, | ||
const size_t | bufferSize | ||
) | const |
Reads a value from the given endpoint.
indexEndpoint | The index of the endpoint that is read. |
pBuffer | The value of the endpoint is written to the buffer. |
bufferSize | Number of bytes the buffer can hold. |
imt::base::bsp::type::ErrorCode::Id imt::base::bsp::driver::HighLevelDriver::registerValueHandler | ( | const size_t | indexEndpoint, |
imt::base::bsp::handler::HighLevelValueHandlerIfc *const | pHandler | ||
) | const |
Registers a handler for the given endpoint that is called when the value changes.
indexEndpoint | The index of the endpoint the handler has to be registered for. |
pHandler | The handler. |
imt::base::bsp::type::ErrorCode::Id imt::base::bsp::driver::HighLevelDriver::unregisterValueHandler | ( | const size_t | indexEndpoint | ) | const |
Removes the handler for the given endpoint.
indexEndpoint | The index of the endpoint the handler has to be removed. |
imt::base::bsp::type::ErrorCode::Id imt::base::bsp::driver::HighLevelDriver::writeValue | ( | const size_t | indexEndpoint, |
const uint8_t *const | pData, | ||
const size_t | dataSize | ||
) | const |
Writes a value to the given endpoint.
indexEndpoint | The index of the endpoint that is written. |
pData | The value to write. |
dataSize | Number of bytes provided. |