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
ATSerialFlowControl Class Reference
This class derives from MTSBufferedIO/ATSerial and provides a buffered wrapper to the standard mbed Serial class along with generic RTS/CTS HW flow control. More...
#include <ATSerialFlowControl.h>
Inherits mts::ATSerial.
Public Member Functions | |
ATSerialFlowControl (PinName TXD, PinName RXD, PinName RTS, PinName CTS, int txBufSize=256, int rxBufSize=256) | |
Creates a new ATSerialFlowControl object that can be used to talk to an mbed serial port through internal SW buffers. | |
virtual | ~ATSerialFlowControl () |
Destructs an ATSerialFlowControl object and frees all related resources. | |
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/ATSerial and provides a buffered wrapper to the standard mbed Serial class along with generic RTS/CTS HW flow control.
Since it depends only on the mbed Serial, DigitalOut and DigitalIn classes for accessing the serial data, this class is inherently portable accross different mbed platforms and provides HW flow control even when not natively supported by the processors serial port. If HW flow control is not needed, use ATSerial instead. It should also be noted that the RTS/CTS functionality in this class is implemented as a DTE device.
Definition at line 17 of file ATSerialFlowControl.h.
Constructor & Destructor Documentation
ATSerialFlowControl | ( | PinName | TXD, |
PinName | RXD, | ||
PinName | RTS, | ||
PinName | CTS, | ||
int | txBufSize = 256 , |
||
int | rxBufSize = 256 |
||
) |
Creates a new ATSerialFlowControl object that can be used to talk to an mbed serial port through internal SW buffers.
Note that this class also adds the ability to use RTS/CTS HW Flow Conrtol through and standard mbed DigitalIn and DigitalOut pins. The RTS and CTS functionality assumes this is a DTE device.
- Parameters:
-
TXD the transmit data pin on the desired mbed serial interface. RXD the receive data pin on the desired mbed serial interface. RTS the DigitalOut pin that RTS will be attached to. (DTE) CTS the DigitalIn pin that CTS will be attached to. (DTE) 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 8 of file ATSerialFlowControl.cpp.
~ATSerialFlowControl | ( | ) | [virtual] |
Destructs an ATSerialFlowControl object and frees all related resources.
Definition at line 24 of file ATSerialFlowControl.cpp.
Member Function Documentation
void baud | ( | int | baudrate ) | [inherited] |
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 | ( | ) | [inherited] |
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 |
||
) | [inherited] |
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 | ||
) | [inherited] |
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 | ( | ) | [inherited] |
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
