![]() |
Dataflow Runtime API
3.0.3.0
|
Driver for a single serial peripheral in the system. More...
#include <Imt.Base.BSP/Driver/UsartDriver.h>
Public Member Functions | |
| UsartDriver (const size_t indexModule, const size_t indexPort) | |
| Constructor. More... | |
| virtual | ~UsartDriver (void) |
| Destructor. More... | |
| imt::base::bsp::type::ErrorCode::Id | read (uint8_t *pData, const size_t size, uint8_t *const pBytesRead) |
| Reads up to the given number of bytes from the serial interface. More... | |
| imt::base::bsp::type::ErrorCode::Id | write (const uint8_t pData[], const uint32_t size, uint8_t *const pBytesWritten) |
| Writes the given number of bytes to the UART. More... | |
Public Member Functions inherited from imt::base::bsp::driver::ConfigurableDriverAbs< imt::base::bsp::type::DriverType::USART, UsartDriverConfiguration > | |
| ConfigurableDriverAbs (const size_t indexModule, const size_t indexPin) | |
| Constructor. More... | |
| virtual | ~ConfigurableDriverAbs (void) |
| Destructor. More... | |
| imt::base::bsp::type::ErrorCode::Id | configure (const UsartDriverConfiguration &configuration) |
| Configures the driver. More... | |
| const UsartDriverConfiguration & | getConfiguration (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::USART, UsartDriverConfiguration > | |
| typedef UsartDriverConfiguration | 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... | |
Driver for a single serial peripheral in the system.
|
explicit |
Constructor.
| indexModule | Index of the module (starting at 0). |
| indexPort | Index of the port (starting at 0). |
|
virtual |
Destructor.
|
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::UsartDriver::read | ( | uint8_t * | pData, |
| const size_t | size, | ||
| uint8_t *const | pBytesRead | ||
| ) |
Reads up to the given number of bytes from the serial interface.
| pData | The array the bytes will be written to. |
| size | The maximal number of bytes to read (array size). |
| pBytesRead | The actual number of bytes read. |
| imt::base::bsp::type::ErrorCode::Id imt::base::bsp::driver::UsartDriver::write | ( | const uint8_t | pData[], |
| const uint32_t | size, | ||
| uint8_t *const | pBytesWritten | ||
| ) |
Writes the given number of bytes to the UART.
| pData | The array of bytes to write. |
| size | The number of bytes to write. |
| pBytesWritten | The actual number of bytes written. |