Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: mbed_DS28EC20_GPIO
Uart Class Reference
Universal asynchronous receiver-transmitter interface. More...
#include <Uart.hpp>
Inherited by Uart, and SerialPort.
Public Types | |
| enum | ErrorValue { TimeoutError = 1, OverrunError } |
Public Member Functions | |
| virtual error_code | setBaudRate (int_least32_t baudRate)=0 |
| Set the baud rate of the port in Hz. | |
| virtual error_code | sendBreak ()=0 |
| Generate a break condition on the port for a small amount of time. | |
| virtual error_code | clearReadBuffer ()=0 |
| Clear all received data that was buffered. | |
| virtual error_code | writeByte (uint_least8_t data)=0 |
| Writes a byte of data to the port. | |
| virtual MaximInterface_EXPORT error_code | writeBlock (span< const uint_least8_t > data) |
| Writes a block of data to the port. | |
| virtual error_code | readByte (uint_least8_t &data)=0 |
| Reads a byte of data from the port. | |
| virtual MaximInterface_EXPORT error_code | readBlock (span< uint_least8_t > data) |
| Read a block of data from the port. | |
Detailed Description
Universal asynchronous receiver-transmitter interface.
Definition at line 44 of file Links/Uart.hpp.
Member Enumeration Documentation
| enum ErrorValue |
- Enumerator:
TimeoutError Read operation aborted due to timeout.
OverrunError Received data lost due to read buffer overrun.
Reimplemented in Uart.
Definition at line 46 of file Links/Uart.hpp.
Member Function Documentation
| virtual error_code clearReadBuffer | ( | ) | [pure virtual] |
Clear all received data that was buffered.
Implemented in Uart.
| error_code readBlock | ( | span< uint_least8_t > | data ) | [virtual] |
Read a block of data from the port.
Block until data is received or a timeout is reached.
- Parameters:
-
[out] data Data read from the port if successful.
Definition at line 47 of file Links/Uart.cpp.
| virtual error_code readByte | ( | uint_least8_t & | data ) | [pure virtual] |
Reads a byte of data from the port.
Block until data is received or a timeout is reached.
- Parameters:
-
[out] data Data read from the port if successful.
Implemented in Uart.
| virtual error_code sendBreak | ( | ) | [pure virtual] |
Generate a break condition on the port for a small amount of time.
Implemented in Uart.
| virtual error_code setBaudRate | ( | int_least32_t | baudRate ) | [pure virtual] |
Set the baud rate of the port in Hz.
Implemented in Uart.
| error_code writeBlock | ( | span< const uint_least8_t > | data ) | [virtual] |
Writes a block of data to the port.
Definition at line 38 of file Links/Uart.cpp.
| virtual error_code writeByte | ( | uint_least8_t | data ) | [pure virtual] |
Writes a byte of data to the port.
Implemented in Uart.
Generated on Tue Jul 12 2022 23:29:46 by
1.7.2