Kenji Arai / mbed-os_TYBLE16

Dependents:   TYBLE16_simple_data_logger TYBLE16_MP3_Air

Embed: (wiki syntax)

« Back to documentation index

RawSerial class

RawSerial class
[UART]

Functions

class MBED_DEPRECATED_SINCE ("mbed-os-6.0.0","Use UnbufferedSerial instead.") RawSerial

Function Documentation

class mbed::MBED_DEPRECATED_SINCE ( "mbed-os-6.0.0"  ,
"Use UnbufferedSerial instead."   
)

Can be used for Full Duplex communication, or Simplex by specifying one pin as NC (Not Connected)

Note:
Synchronization level: Not protected

Example:

 // Send a char to the PC

 #include "mbed.h"

 RawSerial pc(USBTX, USBRX);

 int main() {
     pc.putc('A');
 }

Parameters:
txTransmit pin
rxReceive pin
baudThe baud rate of the serial port (optional, defaults to MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE)
Note:
Either tx or rx may be specified as NC if unused
Parameters:
cThe char to write
Returns:
The written char or -1 if an error occurred
Returns:
The char read from the serial port
Parameters:
strThe string to write
Returns:
0 if the write succeeds, EOF for error

Definition at line 64 of file RawSerial.h.