Device interface library for multiple platforms including Mbed.

Dependents:   DeepCover Embedded Security in IoT MaximInterface MAXREFDES155#

Embed: (wiki syntax)

« Back to documentation index

Uart Class Reference

Uart Class Reference

Wrapper for mbed::Serial. More...

#include <Uart.hpp>

Inherits MaximInterfaceCore::Uart.

Public Types

enum  ErrorValue { HardwareError = 1 }

Public Member Functions

virtual
MaximInterfaceCore::Result
< void > 
setBaudRate (int_least32_t baudRate)
 Set the baud rate of the port in Hz.
virtual
MaximInterfaceCore::Result
< void > 
sendBreak ()
 Generate a break condition on the port for a small amount of time.
virtual
MaximInterfaceCore::Result
< void > 
clearReadBuffer ()
 Clear all received data that was buffered.
virtual
MaximInterfaceCore::Result
< void > 
writeByte (uint_least8_t data)
 Writes a byte of data to the port.
virtual
MaximInterfaceCore::Result
< uint_least8_t > 
readByte ()
 Reads a byte of data from the port.
virtual
MaximInterfaceCore_EXPORT
Result< void > 
writeBlock (span< const uint_least8_t > data)
 Writes a block of data to the port.
virtual
MaximInterfaceCore_EXPORT
Result< void > 
readBlock (span< uint_least8_t > data)
 Read a block of data from the port.

Detailed Description

Wrapper for mbed::Serial.

Definition at line 42 of file MaximInterfaceMbed/Uart.hpp.


Member Enumeration Documentation

enum ErrorValue
Enumerator:
HardwareError 

Write operation aborted due to timeout.

Reimplemented from Uart.

Definition at line 44 of file MaximInterfaceMbed/Uart.hpp.


Member Function Documentation

virtual MaximInterfaceCore::Result<void> clearReadBuffer (  ) [virtual]

Clear all received data that was buffered.

Implements Uart.

Result< void > readBlock ( span< uint_least8_t >  data ) [virtual, inherited]

Read a block of data from the port.

Block until data is received or a timeout is reached.

Parameters:
[out]dataData read from the port if successful.

Definition at line 45 of file MaximInterfaceCore/Uart.cpp.

virtual MaximInterfaceCore::Result<uint_least8_t> readByte (  ) [virtual]

Reads a byte of data from the port.

Block until data is received or a timeout is reached.

Returns:
Data read from the port if successful.

Implements Uart.

virtual MaximInterfaceCore::Result<void> sendBreak (  ) [virtual]

Generate a break condition on the port for a small amount of time.

Implements Uart.

virtual MaximInterfaceCore::Result<void> setBaudRate ( int_least32_t  baudRate ) [virtual]

Set the baud rate of the port in Hz.

Implements Uart.

Result< void > writeBlock ( span< const uint_least8_t >  data ) [virtual, inherited]

Writes a block of data to the port.

Definition at line 38 of file MaximInterfaceCore/Uart.cpp.

virtual MaximInterfaceCore::Result<void> writeByte ( uint_least8_t  data ) [virtual]

Writes a byte of data to the port.

Implements Uart.