PicoLC Arduino Library Arduino library for PicoLC hardware |
Provides Arduino Stream-compatible access to the PicoLC RS-485 port. More...
#include <PicoLCSerial.h>

Public Member Functions | |
| void | begin (uint32_t baud, uint16_t config=SERIAL_8N1) |
| Initializes the RS-485 UART and transceiver-control pins. | |
| void | end () |
| Releases PicoLC control of the UART and transceiver-control pins. | |
| int | available () override |
| Returns the number of received bytes available to read. | |
| int | read () override |
| Reads the next received byte. | |
| int | peek () override |
| Returns the next received byte without removing it. | |
| size_t | write (uint8_t byte) override |
| Transmits one byte over RS-485. | |
| size_t | write (const uint8_t *data, size_t length) override |
| Transmits a buffer over RS-485. | |
| void | flush () override |
| Waits for pending UART transmission to complete. | |
| bool | started () const |
| Reports whether the RS-485 interface is initialized. | |
Friends | |
| class | PicoLC |
Provides Arduino Stream-compatible access to the PicoLC RS-485 port.
PicoLCSerial wraps the hardware UART and RS-485 transmit/receive control pins. The current implementation is blocking: write operations do not return until the requested data has been transmitted and the interface has returned to receive mode.
Instances are created and owned by PicoLC.
Definition at line 15 of file PicoLCSerial.h.
| override |
Returns the number of received bytes available to read.
Definition at line 29 of file PicoLCSerial.cpp.
| void PicoLCSerial::begin | ( | uint32_t | baud, |
| uint16_t | config = SERIAL_8N1 ) |
Initializes the RS-485 UART and transceiver-control pins.
Calling begin() after end() reinitializes the UART and associated pins.
| baud | Serial baud rate. |
| config | Arduino serial framing configuration. |
Definition at line 9 of file PicoLCSerial.cpp.
| void PicoLCSerial::end | ( | ) |
Releases PicoLC control of the UART and transceiver-control pins.
Received data already present in the UART receive buffer is retained. A later call to begin() reinitializes the interface.
Definition at line 22 of file PicoLCSerial.cpp.
| override |
Waits for pending UART transmission to complete.
This method wraps the underlying Arduino serial implementation. It does nothing when the interface is not started.
Definition at line 53 of file PicoLCSerial.cpp.
| override |
Returns the next received byte without removing it.
Definition at line 31 of file PicoLCSerial.cpp.
| override |
Reads the next received byte.
Definition at line 30 of file PicoLCSerial.cpp.
| bool PicoLCSerial::started | ( | ) | const |
Reports whether the RS-485 interface is initialized.
Definition at line 70 of file PicoLCSerial.cpp.
| override |
Transmits a buffer over RS-485.
This operation is blocking and returns after the complete buffer has been transmitted and the transceiver has returned to receive mode.
| data | Pointer to the data to transmit. |
| length | Number of bytes to transmit. |
Definition at line 43 of file PicoLCSerial.cpp.
| override |
Transmits one byte over RS-485.
This operation is blocking and returns after transmission completes and the transceiver has returned to receive mode.
| byte | Byte to transmit. |
Definition at line 33 of file PicoLCSerial.cpp.
| friend |
Definition at line 16 of file PicoLCSerial.h.