This bean encapsulates serial communication interface (UART) and provides methods and events for asynchronous serial communication.
The bean provides standard features of asynchronous serial communications (if supported by hardware) and also special functions provided by the hardware:
- Number of data bits/number of stop bits
- Baud rate
- Parity
- Handshake flow control
- etc.
The bean can work in two basic modes:
- Polling mode - no events available, no block transfer functions available
- Interrupt mode - user can choose from a set of events for data transfer management
When the Interrupt mode the bean offers possibility to define communication buffers to further extend the functionality of the bean
with block transfer functions. The driver of the bean stores all the incoming data to the input buffer and automatically transmits
all the data from the output buffer. All the send/receive methods operate on the internal buffers.
The AsynchroSerial bean also offers possibility to control the data transfer with standard RTS/CTS handshake mechanism:
- CTS - an input pin. When in low level the device is allowed the send data. When in high level the device has to stop transmitting.
- RTS - an output pin. When the device is able to receive data the RTS is set to low level. If the device can't accept new data the RTS is set to high level.
The following picture shows an example of a connection between two DCE devices (RS232C interface) with a possible handshake (dashed line):
This bean belongs to the category: CPU Internal Peripherals-Communication