Skip to content

Commit 06d69f7

Browse files
committed
Serial design draft
1 parent d0b5ba6 commit 06d69f7

File tree

9 files changed

+329
-0
lines changed

9 files changed

+329
-0
lines changed
Loading
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<mxfile host="www.draw.io" modified="2019-10-03T12:49:49.888Z" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.1 Safari/605.1.15" etag="qa96CZ4Cujasx1f-117k" version="12.0.2" type="onedrive" pages="1"><diagram id="IPPSj4dfQhI11Ljdv34q" name="Page-1">7ZjbctowEIafhst0jIUduCwkkGF6HFoSeqdYC9ZUWFSIYPL0lWsJbImUw3DwdHrjkVbySv7+XetQQ51p2hN4Fn/kBFjN90haQ3c13w+CW/XMDCttQF5umAhKclN9YxjQV9BG021BCcxLHSXnTNJZ2RjxJIFIlmxYCL4sdxtzVh51hifgGAYRZq71kRIZa2s9bG0aHoBOYj100w/zhik2nfWXzGNM+LJgQvc11BGcy7w0TTvAMnaGS/5e943W9cQEJHKfF5KvYvjN+/Xj84ebUfMRRz3c/3mjvbxgttAfPABBMWvjOehpy5VhIfgiIZC582qovYyphMEMR1nrUomvbLGcMlWrq6I7PTMWCAlpwaSn2wM+BSlWqotpDTU6HTu+iZ1lQQmDNy6IYPphLf5k7XrDRxU0ogNwIQdXlzJ4wAlh18eF/Krhaji4PvGkw2cr/JzxUsOGeJqBYGom7fZiPAYBJI/AddtErvFcEW6jWTW4gQPXBlixeETensga50IWHhSPxdSuVCzaYOu3147FpgPWgQQJeZ+tx6oWMTyf06jMReEQq6eM4bvAVEfFtrtUA85rK117k6fEYgJy99oHpLQDcKkXqAZboBqbAIYlfSnvG7aR1iN84VTNeC2qb/+9m5ZYc74QEei3iuu87ahupZ3tKAfjOPoj/Pqzj4+FVgVjoSIaI3sRaR2pseMovKzGJsT+i+xqEzROlMiOo0uL7B4ODhc5pbKgsaqNjKiqvFE4q+wUOAe3e3tekUCwk7R+smz3LhwI/kGBkPAE9tzzVESpk629O3P/3Eq5B9R/Syk7FZCdCkfn1PmU+p6+9nuoPfSeuvHQIyElz/0tFy9/O4oUL2VOfRRxzh1b9N/7iuaiR5GtYA/7V5140bKyZC+SV/rF2QLsfbywHZ1sMVLVzW1o3n1zpYzufwM=</diagram></mxfile>
Loading
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<mxfile host="www.draw.io" modified="2019-10-04T08:52:28.454Z" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.1 Safari/605.1.15" etag="Am0JPjUp-a9ka-FfggNn" version="12.0.2" type="onedrive" pages="1"><diagram id="VeAL7sxWgT67HavtY4N0" name="Page-1">zVbbjpswEP0aHluBgXTzuLl187DaVKnU3b45eAKuHEyNE0i/vnZs7tmrVkqkiIyPZ8bjMxdw/Omu/C5wltxzAsxBLikdf+YgNPaRemrgaIAQuQaIBSUG8hpgTf+BBSu1PSWQdxQl50zSrAtGPE0hkh0MC8GLrtqWs+6pGY5hAKwjzIboL0pkYtAb9K3B74DGSXWyNxqbnR2ulO1N8gQTXrQgf+74U8G5NNKunALT3FW8GLvFM7t1YAJS+RaD4OffafGHbuLlYfLjsA1/j8T8i/VywGxvL+ygEVP+JhslxFqY6tgloVz9M7oRWBwrHXVYrVbbiQrZ8gxSR0e10MwLwKRZRYznYImRx4ptwfcpAR2wpxwUCZWwznCkdwtVXgpL5I7ZbRs6CAnls5x4NdOqQoHvQOrwXWuAbmxybHV6VbKKJtfeyGJJK8+hxbAtr7h23WRACTYJ70gIGiTkfgOat4e1Pm6TS4FVmSNXuZ+cfu4gYwvK4A6nRLF6NlHu7Wp5ddT77qWpD870Qo8k1cOZFrcMyls9XRQXkBIrziKG85xGXa6gpPJRye7X0K6eWjszTYdbLY7VIlUXahnp5VN7rzE7rSo7EzCQwUzrZUVdiu9FBK9PBolFDPIFvfB8lltZDF9IogCGJT10wz2XWXvCitNUtopo3C0iFPSKw1zTWrWHY8+RH/QGwbjnyPAwcHQqtPraH6+98PU5vHpYLx9N479vDnfGcGcKF0J1+dVNgvrdf7FJMLqeSfCJHR2+saPRJTs68HuvhY92dNB/v6DP6mi1bL7ajHrz6evP/wM=</diagram></mxfile>
Loading
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<mxfile host="www.draw.io" modified="2019-10-04T11:48:22.101Z" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.1 Safari/605.1.15" etag="89rnh_Xjw2BzIMUwFD7w" version="12.0.2" type="onedrive" pages="1"><diagram id="IPPSj4dfQhI11Ljdv34q" name="Page-1">5VnbctowEP0aHtPxBVzyWAiQpsm0HZpbXzqKtWBNhUVlEUy+vnItY1tyCiZAnPaF8a7WK+mc1ZFkWm5/Fo84mgdXDANtORaOW+5Zy3G6XVv+Jo5V6ug4VuqYcoJTl507xuQJlDMLWxAMUSlQMEYFmZedPgtD8EXJhzhny3LYhNFyr3M0BcMx9hE1vbcEi0B5be80bzgHMg1U113HSxtmKAtWM4kChNmy4HIHLbfPGRPp0yzuA02wy3BJ3xs+07oeGIdQbPNC+JXffLN+ff98eXLfvUX+CF38PFFZHhFdqAmPgRNEeygCNWyxyrDgbBFiSNJZLbe3DIiA8Rz5SetSki99gZhRadny0Rxe1hdwAXHBpYY7AjYDwVcyRLU6loJO1Y7jKntZYCKDNyiQkMUhRf50nTrHRz4oiGrA5RpwDQmFcxRi+vpwuV7T4OoYcPUWkwlwwGmVNQ4y19kSsvahIOsakBkgQYg/JMomLZ+iKCL+lrgALmmdiUph1p2KSWc+DhQJ8lhWyCokVA9fGJEjyZe1XqddDcyILbgP6q2iom1K5GmJBOJTEEaiP8Ssp707V6cv50pSxFd3Sb2/62TmfbHtLFaLIbVWymo6x21nTxwbiY7Mse3UIjlkIfynq3Ej5Ydmytyc/y2m3La2WVk7MqUnOiBT1/HTxcjt3Vh3w+DGwh7BDxcn9ZZUtW7GRBRkU1r3mU7K51w0E2OjZqa4bT4lN6QO9BVr64eRXfdP+/RgdXDVX9x+6vgfn+xJ78cl+IOBM6y4fFyHD806IOpXkKMeECtBM1XuioRkhmhDEbO9LRHbxy2kErH2c4j1WRixBlzcdDk+5r2tEjHz3lZvJz2YOv9NRpqizlr9t3WWdlVnY7s/sDp7TSqChpCrn3HX28FLD8vHJvf9C8ltOlEbF89bIare96C3R5Stf+O19ySXRqJniJLQoVUhbJ4ERNtXVtZP3XHldZKOYK9VU+/L1Gtv4O1GVaS+4o1b0bYVubG0d5YOaeb/G6Xh+Z9v7uA3</diagram></mxfile>
Loading
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<mxfile host="www.draw.io" modified="2019-10-03T12:48:29.038Z" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.1 Safari/605.1.15" etag="6hyYaZYwuBLnZXb-3igu" version="12.0.2" type="onedrive" pages="1"><diagram id="IPPSj4dfQhI11Ljdv34q" name="Page-1">7ZjbcpswEIafhkt3DBhiXzZO4kymrdtx29S+U2BtlArkyHIMffqKImGQnPowPjCd3jDSSqzE9++ig+X243TA0Dz6SEMgltMOU8u9sRzH867EMzdk0uC2C8OM4bAw2WvDCP8CaVTdljiERa0jp5RwPK8bA5okEPCaDTFGV/VuU0rqo87RDAzDKEDEtD7ikEfSavu9dcM94Fkkh+46ftEQI9VZfskiQiFdVUzureX2GaW8KMVpH0jOTnEp3rt7o7WcGIOE7/JC8oV9/9p+mQw/tMbdRxQM0MPPlvTyishSfvAIGEbkGi1ATptnigWjyySE3F3bcq9XEeYwmqMgb10J8YUt4jERNVsUzempsYBxSCsmOd0B0Bg4y0QX1epLdDJ2HBU7q4oSCm9UEUH1Q1L8Wel6zUcUJKI9cLkGrjtM4B4lIbk8LtdpGq6OgesTTfp0nqGnnJcY1kdxDoKImVx/S56W0ykwCIsYLFtnvAR0QbydbtPwegZeE2HDYtJt7witcypo/l4xWU3vRkWjDta+unQ0dg2wBiRIwvf5mixqAUGLBQ7qXAQOlv3IGb7zVHVcbbtJJeCilsnamzw5YjPg29c/CGu7AJN6haq3AaqyMSCI49f63mETaTnCZ4rFjEtRHf0P3tXEWtAlC0C+VV3rdUe2lna6owKM4eiP8OVnHx4LvQbGQkM0dvVlpHegxoYj/7waqxD7L7Kpjdc5UiIbjs4tsnlA2F/kFPOKxqI2VqKK8lrhvLJV4ALc9i16QwJBT1L7aNnePnMgOHsFQkIT2HHP0xCljrb2bs39UytlHlL/LaX0VHD1VDg4p06nFOr35g/PrckgHT/3RpOXrD8cbrh8+dtRpHoxc+yjiHHu2KD/ztc0Zz2KbAS737/qyIuWliU7kbzQL04XYOfjhe7oaIuRqK5vRIvu62tl9/Y3</diagram></mxfile>
Lines changed: 321 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,321 @@
1+
# Serial design document
2+
3+
# Table of contents
4+
5+
1. [Serial design document](#serial-design-document).
6+
1. [Table of contents](#table-of-contents).
7+
1. [Revision history](#revision-history).
8+
1. [Introduction](#introduction).
9+
1. [Overview and background](#overview-and-background).
10+
1. [Requirements and assumptions](#requirements-and-assumptions).
11+
1. [System architecture and high-level design](#system-architecture-and-high-level-design).
12+
1. [System architecture and component interaction](#system-architecture-and-component-interaction).
13+
1. [Detailed design](#detailed-design).
14+
1. [Usage scenarios and examples](#usage-scenarios-and-examples).
15+
1. [Other Work](#other-work).
16+
1. [Related work-Simplification of retarget code](#related-work-simplification-of-retarget-code).
17+
1. [Future Work-Deprecation of Stream](#future-work-deprecation-of-stream).
18+
1. [Roll-out Plan](#roll-out-plan).
19+
1. [Tools and configuration changes](#tools-and-configuration-changes).
20+
1. [Other information](#other-information).
21+
1. [Deprecations](#deprecations).
22+
1. [References](#references).
23+
24+
25+
### Revision history
26+
27+
1.0 - Initial version - Evelyne Donnaes - 04/10/2019
28+
29+
# Introduction
30+
31+
### Overview and background
32+
33+
Mbed OS contains multiple serial classes and multiple ways of printing information to the console. Serial classes have evolved over the years to add new functinality to existing classes and compensate for limitations. The result is that there are now multiple variants, not always well documented; therefore it is not clear which class shoud be used for what purpose. Futhermore, some of the classes pull substantial dependencies whose benefits are not very clear, for example standard library like objects and abstractions, and parts of the retarget layer.
34+
35+
This document collects proposals made by various contributors (see [references](#references)) and presents a simplified serial class hierarchy. The aim is to offer two public classes, one for unbuffered I/O and the other for buffered I/O, with a clear definition of which one should be used when. All other serial classes are deprecated and should be removed at a later stage. In addition, the serial classes dependencies will be optimised to only include components that provide valuable functionality.
36+
37+
#### Serial classes in Mbed OS 5.14
38+
39+
**Serial**
40+
41+
`Serial` provides unbuffered I/O and is using blocking HAL calls. It only works for simple printing.
42+
43+
Its main limitations are:
44+
- It uses a mutex lock so it cannot be used from interrupts.
45+
- It wastes a lot of CPU time spinning waiting for serial output and it cannot be used reliably for input because it needs interrupt-speed response on read calls but its high-level API cannot be used from interrupts.
46+
- It lacks buffering so it cannot be used reliably for input and output without flow control.
47+
- It pulls in the C library stdio system because it uses `Stream`.
48+
49+
**UARTSerial**
50+
51+
`UARTSerial` provides buffered I/O. It can be used reliably for input from non-interrupt context and to avoid excess spinning waiting for transmission buffer space. It also does better blocking and correct POSIX-like `FileHandle` semantics.
52+
53+
It does not use `Stream` so it has the advantage of not pulling in the C stdio library. The drawback is that it loses the ability to call printf directly.
54+
55+
**RawSerial**
56+
57+
`RawSerial` provides unbuffered I/O. It has no locks so it is safe to use in interrupts provided that it is the only instance that is using that serial port.
58+
59+
### Requirements and assumptions
60+
61+
None
62+
63+
# System architecture and high-level design
64+
65+
Applications will have a choice between two public serial classes:
66+
- `BufferedSerial` for a normal application
67+
- `UnbufferedSerial` for an interrupt driven application or one that needs to have more control
68+
69+
### System architecture and component interaction
70+
71+
The below diagram shows the inheritance hierarchy for the serial classes.
72+
73+
![Serial classes](./diagrams/serial-classes.png)
74+
75+
`MinimalSerial` is an abstract class that extracts basics I/O functionality from `SerialBase` so it can be re-used for a minimal serial console in the retarget code.
76+
77+
# Detailed design
78+
79+
### Detailed design : BufferedSerial
80+
81+
`BufferedSerial` is `UARTSerial` renamed to convey the original purpose of the class. In addition, the new class will allow configurability of the transmit and receive buffer size so that each instance of the class can configure its buffer size according to its intended usage, for example a modem may need a large input buffer and a console may not need any input buffer.
82+
83+
The below diagram shows the detailed inheritance hierarchy for `BufferedSerial`.
84+
85+
![BufferedSerial class](./diagrams/buffered-serial.png)
86+
87+
**API description**
88+
89+
This is the new constructor for `BufferedSerial` to pass in the serial buffers size.
90+
91+
```C
92+
/** Create a BufferedSerial port, connected to the specified transmit and receive pins, with a particular baud rate.
93+
* @param tx Transmit pin
94+
* @param rx Receive pin
95+
* @param baud The baud rate of the serial port (optional, defaults to MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE)
96+
* @param rx_buffer_size the size of the receive buffer (optional, defaults to MBED_CONF_DRIVERS_UART_SERIAL_RXBUF_SIZE)
97+
* @param tx_buffer_size the size of the transmit buffer (optional, defaults to MBED_CONF_DRIVERS_UART_SERIAL_TXBUF_SIZE)
98+
*/
99+
BufferedSerial(PinName tx,
100+
PinName rx,
101+
int baud = MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE,
102+
uint32_t rx_buffer_size = MBED_CONF_DRIVERS_UART_SERIAL_RXBUF_SIZE,
103+
uint32_t tx_buffer_size = MBED_CONF_DRIVERS_UART_SERIAL_TXBUF_SIZE);
104+
```
105+
106+
The rest of the class API is that of `UARTSerial` and is described [here](https://os.mbed.com/docs/mbed-os/v5.14/mbed-os-api-doxy/classmbed_1_1_u_a_r_t_serial.html).
107+
108+
109+
### Detailed design : UnbufferedSerial
110+
111+
`UnbufferedSerial` is a new class that adds a `FileHandle` interface to `RawSerial`. `RawSerial` is the preferred implementation for unbuffered I/O but it lacks a `FileHandle` interface and so it cannot be used by the retarget code. Instead the retarget code uses a non-public `DirectSerial` class which adds to the complexity of classes and should be removed. `UnbufferedSerial` will not provide any of the printf methods that `RawSerial` has; applications should use _fdopen_ to get a _FILE*_ to use the printf function, see [Usage scenarios and examples](#usage-scenarios-and-examples).
112+
113+
The below diagram shows the detailed inheritance hierarchy for `UnbufferedSerial`.
114+
115+
![UnbufferedSerial class](./diagrams/unbuffered-serial.png)
116+
117+
**API description**
118+
119+
This is the proposed API for the `UnbufferedSerial` class.
120+
121+
```C
122+
class UnbufferedSerial: public SerialBase, public FileHandle, private NonCopyable<UnbufferedSerial> {
123+
124+
public:
125+
/** Create a UnbufferedSerial port, connected to the specified transmit and receive pins, with the specified baud.
126+
*
127+
* @param tx Transmit pin
128+
* @param rx Receive pin
129+
* @param baud The baud rate of the serial port (optional, defaults to MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE)
130+
*
131+
* @note
132+
* Either tx or rx may be specified as NC if unused
133+
*/
134+
UnbufferedSerial(PinName tx, PinName rx, int baud = MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE);
135+
136+
/** Write a char to the serial port
137+
*
138+
* @param c The char to write
139+
*
140+
* @returns The written char or -1 if an error occurred
141+
*/
142+
int putc(int c);
143+
144+
/** Read a char from the serial port
145+
*
146+
* @returns The char read from the serial port
147+
*/
148+
int getc();
149+
150+
/** Write a string to the serial port
151+
*
152+
* @param str The string to write
153+
*
154+
* @returns 0 if the write succeeds, EOF for error
155+
*/
156+
int puts(const char *str);
157+
158+
virtual ssize_t write(const void *buffer, size_t size);
159+
virtual ssize_t read(void *buffer, size_t size);
160+
virtual off_t seek(off_t offset, int whence = SEEK_SET);
161+
virtual off_t size();
162+
virtual int isatty();
163+
virtual int close();
164+
virtual short poll(short events) const;
165+
166+
#if !(DOXYGEN_ONLY)
167+
protected:
168+
169+
/* Acquire exclusive access to this serial port
170+
*/
171+
virtual void lock(void);
172+
173+
/* Release exclusive access to this serial port
174+
*/
175+
virtual void unlock(void);
176+
#endif
177+
};
178+
```
179+
180+
### Detailed design : MinimalSerial
181+
182+
The `MinimalSerial` class is a minimal abstract base class that provides basics I/O functionality. All other serial classes derive from it.
183+
184+
**API description**
185+
186+
This is the proposed API for the `MinimalSerial` class. Only two methods are provided to output `_base_putc()` and receive `_base_getc()` characters on the UART.
187+
188+
```C
189+
class MinimalSerial : private NonCopyable<MinimalSerial> {
190+
protected:
191+
MinimalSerial(PinName tx, PinName rx, int baud);
192+
virtual ~MinimalSerial();
193+
int _base_getc();
194+
int _base_putc(int c);
195+
};
196+
```
197+
198+
### Detailed design : MinimalConsole
199+
200+
`MinimalConsole` is an internal concrete class that derives from `MinimalSerial` and provides basic console functionality that can be used by the retarget code for resources constrained targets, see [Simplication of retarget code](#simplification-of-retarget-code).
201+
202+
**API description**
203+
204+
```C
205+
class MinimalConsole : public MinimalSerial, private NonCopyable<MinimalConsole> {
206+
public:
207+
MinimalConsole(PinName tx, PinName rx, int baud);
208+
virtual ~MinimalConsole();
209+
int getc();
210+
int putc(int c);
211+
};
212+
```
213+
214+
The constructor provides arguments to create a serial port connected to the specified transmit and receive pins and set to the specified baud rate. If a target has serial support, by default a serial port is used for the console and the pins and settings for the port selection come from target header files and JSON settings.
215+
216+
# Usage scenarios and examples
217+
218+
### Scenario 1 `Printing to stdout`
219+
220+
The below example shows pseudocode for how to print `Hello` to stdout using the new API. Printf cannot be called directly; instead the application first calls _fdopen_ to get a _FILE*_ to use the printf function.
221+
222+
```C
223+
BufferedSerial serial(RX, TX, 115200);
224+
FILE *out = fdopen(&serial, "w");
225+
fprintf(out, "Hello");
226+
```
227+
and similarly for `UnbufferedSerial`
228+
229+
```C
230+
UnbufferedSerial serial(RX, TX, 115200);
231+
FILE *out = fdopen(&serial, "w");
232+
fprintf(out, "Hello");
233+
```
234+
235+
# Other Work
236+
237+
## Related work-Simplification of retarget code
238+
239+
In Mbed, retargeting is implemented by redefining the system I/O functions.
240+
The `FileHandle` abstract class provides an interface with file-like operations, such as read and write that can be redefined by the retarget code. The high-level library functions perform input/output by calling the low-level functions which use the system I/O functions to interface with hardware.
241+
242+
The relationship of `FileHandle` and other APIs is as follows:
243+
244+
![Retarget](./diagrams/retarget.png)
245+
246+
The POSIX layer and the static array of `FileHandle*` allocated by the retarget code for file handling consume a lot of memory. A constrained target that only uses a console does not need file handling and should be able to turn this functionality off.
247+
248+
A new configuration parameter is introduced to compile the file handling code out. The application can override the default configuration in mbed_app.json as follows:
249+
250+
```C
251+
"target_overrides": {
252+
"*": {
253+
"platform.stdio-minimal-console-only": true
254+
}
255+
}
256+
```
257+
258+
There are two approaches to achieve a minimal retarget layer. You can:
259+
1. Redefine the low-level library functions. A detailed description can be found [here](http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0475m/chr1358938931411.html)
260+
1. Redefine the system I/O functions.
261+
262+
A minimal console only needs to write a single character at a time. So redefining the default fputc() to directly write to the serial port if the output stream is stdout and bypassing the system I/O functions should achieve higher memory savings. If we take this approach, we will have to rework some error handlers that rely on the POSIX form of `write(STDOUT_FILENO, buf, len)` to do emergency printing.
263+
264+
The second solution keeps the POSIX layer with the main saving coming from dropping the use of `FileHandle` and the file handle table itself. In this case, `write()` would call `MinimalConsole::putc` in a loop.
265+
266+
List of tasks to simplify the retarget code:
267+
268+
- Use `UnbufferedSerial` instead of `DirectSerial`
269+
- Remove `DirectSerial`
270+
- Add a configuration parameter to compile out file handling feature
271+
- Alternative uses weak console_putc/getc functions
272+
273+
## Future work-Deprecation of Stream
274+
275+
The `Stream` class pulls in the <stdio.h> library. It should be replaced by drivers implementing `FileHandle` directly and applications using `fdopen(FileHandle *)` to get a `FILE*` to use full C/C++ stream features.
276+
277+
`Stream` is currently used by the following classes:
278+
- `Serial`
279+
- `USBKeyboard`
280+
- `USBMouseKeyboard`
281+
- `USBSerial`
282+
283+
Deprecation of `Stream` should be planned in a future release.
284+
285+
# Roll-out Plan
286+
287+
This feature will be implemented in different phases as follows:
288+
289+
Phase 1:
290+
- [Deprecation of APIs](#Deprecations)
291+
- Implementation of new class `UnbufferedSerial`
292+
- Implementation of new class `BufferedSerial`
293+
- Use `UnbufferedSerial` instead of `DirectSerial` in retarget code
294+
295+
Phase 2:
296+
- Removal of deprecated APIs
297+
298+
# Tools and configuration changes
299+
300+
### Tool changes
301+
302+
None
303+
304+
### Configuration changes
305+
306+
None
307+
308+
# Other information
309+
310+
### Deprecations
311+
312+
The following APIs will be deprecated:
313+
- `Serial` class
314+
- `RawSerial` class
315+
- `UARTSerial` class
316+
317+
### References
318+
319+
https://github.com/ARMmbed/mbed-os/pull/5655
320+
321+
[Tailoring input/output functions in the C and C++ libraries](http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0475m/chr1358938931411.html)

0 commit comments

Comments
 (0)