SoftwareSerial controller.
More...
#include <SoftwareSerial.h>
|
| | SoftwareSerial (uint8_t receivePin, uint8_t transmitPin) |
| | Create SoftwareSerial object.
|
| |
|
| ~SoftwareSerial () |
| | Destroy SoftwareSerial object.
|
| |
| void | begin (long speed) |
| | Initialize the serial communication.
|
| |
|
void | end () |
| | Deinitialize the serial communication.
|
| |
| bool | listen () |
| | Sets the current object as the "listening" one.
|
| |
| bool | isListening () |
| | Checks if the SoftwareSerial object is listening.
|
| |
| bool | stopListening () |
| | Stop listening.
|
| |
| bool | overflow () |
| | Checks if a SoftwareSerial buffer overflow has occurred.
|
| |
| int | peek () |
| | Get a character that was received on the RX pin of the SoftwareSerial object.
|
| |
| virtual size_t | write (uint8_t byte) |
| | Send a single byte to the transmit pin of SoftwareSerial object.
|
| |
| virtual int | read () |
| | Read data from buffer.
|
| |
| virtual int | available () |
| | Get the number of bytes available for reading from a SoftwareSerial objects.
|
| |
|
virtual void | flush () |
| | There is no tx buffering, simply return.
|
| |
|
| static int | handle_interrupt (int irq, FAR void *context, FAR void *arg) |
| | Interrupt handling.
|
| |
SoftwareSerial controller.
You can control Software Serial comunication by operating SoftwareSerial objects instantiated in your app. It is usable on all the GPIO pins (D0 - D28).
◆ SoftwareSerial()
| SoftwareSerial::SoftwareSerial |
( |
uint8_t | receivePin, |
|
|
uint8_t | transmitPin ) |
Create SoftwareSerial object.
- Parameters
-
| [in] | receivePin | Pin used for receive |
| [in] | transmitPin | Pin used for transmit |
◆ begin()
| void SoftwareSerial::begin |
( |
long | speed | ) |
|
Initialize the serial communication.
- Parameters
-
| [in] | speed | Baud rate. The maximum speed is 250,000 bps. |
◆ listen()
| bool SoftwareSerial::listen |
( |
| ) |
|
Sets the current object as the "listening" one.
- Returns
- true if success, false if failure
◆ isListening()
| bool SoftwareSerial::isListening |
( |
| ) |
|
|
inline |
Checks if the SoftwareSerial object is listening.
- Returns
- true if is listening
◆ stopListening()
| bool SoftwareSerial::stopListening |
( |
| ) |
|
Stop listening.
- Returns
- true if we were actually listening
◆ overflow()
| bool SoftwareSerial::overflow |
( |
| ) |
|
|
inline |
Checks if a SoftwareSerial buffer overflow has occurred.
- Returns
- true if overflow
◆ peek()
| int SoftwareSerial::peek |
( |
| ) |
|
Get a character that was received on the RX pin of the SoftwareSerial object.
Subsequent calls to this function will return the same character.
- Returns
- the character read, or -1 if none is available
◆ write()
| virtual size_t SoftwareSerial::write |
( |
uint8_t | byte | ) |
|
|
virtual |
Send a single byte to the transmit pin of SoftwareSerial object.
- Parameters
-
- Returns
- Return the number of bytes written
◆ read()
| virtual int SoftwareSerial::read |
( |
| ) |
|
|
virtual |
Read data from buffer.
- Returns
- The byte read, or -1 if none is available
◆ available()
| virtual int SoftwareSerial::available |
( |
| ) |
|
|
virtual |
Get the number of bytes available for reading from a SoftwareSerial objects.
- Returns
- number of bytes available to read
◆ handle_interrupt()
| static int SoftwareSerial::handle_interrupt |
( |
int | irq, |
|
|
FAR void * | context, |
|
|
FAR void * | arg ) |
|
inlinestatic |
Interrupt handling.
- Parameters
-
| [in] | irq | Interrupt number |
| [in] | context | Context (not used) |
| [in] | arg | Argument (not used) |
The documentation for this class was generated from the following file: