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.
Dependencies: MTS-Serial libmDot-mbed5
Fork of Dot-AT-Firmware by
ATSerial Class Reference
This class derives from MTSBufferedIO and provides a buffered wrapper to the standard mbed Serial class. More...
#include <ATSerial.h>
Inherited by ATSerialFlowControl.
Public Member Functions | |
ATSerial (PinName TXD, PinName RXD, int txBufferSize=256, int rxBufferSize=256) | |
Creates a new ATSerial object that can be used to talk to an mbed serial port through internal SW buffers. | |
virtual | ~ATSerial () |
Destructs an ATSerial object and frees all related resources, including internal buffers. | |
void | reattach (PinName TXD, PinName RXD) |
Attach the internal serial object to provided pins. | |
void | baud (int baudrate) |
This method is used to the set the baud rate of the serial port. | |
void | format (int bits=8, SerialBase::Parity parity=mbed::SerialBase::None, int stop_bits=1) |
This method sets the transmission format used by the serial port. | |
void | sendBreak () |
Generate a break condition on the serial line. | |
bool | escaped () |
Check for escape sequence detected on serial input. |
Detailed Description
This class derives from MTSBufferedIO and provides a buffered wrapper to the standard mbed Serial class.
Since it depends only on the mbed Serial class for accessing serial data, this class is inherently portable accross different mbed platforms.
Definition at line 15 of file ATSerial.h.
Constructor & Destructor Documentation
ATSerial | ( | PinName | TXD, |
PinName | RXD, | ||
int | txBufferSize = 256 , |
||
int | rxBufferSize = 256 |
||
) |
Creates a new ATSerial object that can be used to talk to an mbed serial port through internal SW buffers.
- Parameters:
-
TXD the transmit data pin on the desired mbed Serial interface. RXD the receive data pin on the desired mbed Serial interface. txBufferSize the size in bytes of the internal SW transmit buffer. The default is 256 bytes. rxBufferSize the size in bytes of the internal SW receive buffer. The default is 256 bytes.
Definition at line 7 of file ATSerial.cpp.
~ATSerial | ( | ) | [virtual] |
Destructs an ATSerial object and frees all related resources, including internal buffers.
Definition at line 23 of file ATSerial.cpp.
Member Function Documentation
void baud | ( | int | baudrate ) |
This method is used to the set the baud rate of the serial port.
- Parameters:
-
baudrate the baudrate in bps as an int. The default is 9600 bps.
Definition at line 30 of file ATSerial.cpp.
bool escaped | ( | ) |
Check for escape sequence detected on serial input.
- Returns:
- true if escape sequence was seen
Definition at line 74 of file ATSerial.cpp.
void format | ( | int | bits = 8 , |
SerialBase::Parity | parity = mbed::SerialBase::None , |
||
int | stop_bits = 1 |
||
) |
This method sets the transmission format used by the serial port.
- Parameters:
-
bits the number of bits in a word (5-8; default = 8) parity the parity used (SerialBase::None, SerialBase::Odd, SerialBase::Even, SerialBase::Forced1, SerialBase::Forced0; default = SerialBase::None) stop the number of stop bits (1 or 2; default = 1)
Definition at line 36 of file ATSerial.cpp.
void reattach | ( | PinName | TXD, |
PinName | RXD | ||
) |
Attach the internal serial object to provided pins.
- Parameters:
-
TXD the transmit data pin on the desired mbed Serial interface. RXD the receive data pin on the desired mbed Serial interface.
Definition at line 60 of file ATSerial.cpp.
void sendBreak | ( | ) |
Generate a break condition on the serial line.
Definition at line 70 of file ATSerial.cpp.
Generated on Tue Jul 12 2022 20:40:04 by
