|
SC16IS752 Serial Bridge Arduino Library
|
Per-channel Stream adapter for one SC16IS752 UART.
More...
#include <SC16IS752.h>


Public Member Functions | |
| ChannelStream (SC16IS752 &parent, SC16IS752_Channel channel) | |
| Creates a stream adapter bound to the selected UART channel. | |
| int | available () override |
| Returns the number of bytes available for reading on this channel. | |
| int | read () override |
| Reads one byte from this channel. | |
| int | peek () override |
| Peeks one byte from this channel without removing it. | |
| void | flush () override |
| Waits until pending transmission on this channel is complete. | |
| size_t | write (uint8_t val) override |
| Writes one byte to this channel. | |
| void | begin (uint32_t baudrate=SC16IS752_DEFAULT_SPEED, uint32_t config=SC16IS752_DEFAULT_CONFIG) |
| Initializes this channel with the specified baud rate and serial configuration. | |
| void | end () |
| Gracefully closes this channel. | |
| uint8_t | linestate () |
| Returns the line status register for this channel. | |
| uint8_t | interruptPendingTest () |
| Tests whether an interrupt is pending for this channel. | |
| int | interruptEventTest () |
| Returns the decoded interrupt event for this channel. | |
| void | enableRs485 (bool invert_rts) |
| Enables RS485 mode for this channel. | |
| void | enableTransmit (uint8_t tx_enable) |
| Enables or disables transmission for this channel. | |
| void | interruptControl (uint8_t int_ena) |
| Controls interrupt enable bits for this channel. | |
Per-channel Stream adapter for one SC16IS752 UART.
This nested class exposes a standard Arduino Stream interface for a single UART channel and forwards all operations to its parent SC16IS752 instance. It allows sketches to use channelA() and channelB() like regular stream objects while still exposing selected channel-specific helpers such as begin(), linestate(), interruptPendingTest(), enableRs485(), and interruptControl().
|
inline |
Initializes this channel with the specified baud rate and serial configuration.
| baudrate | UART baud rate. |
| config | Arduino-style serial format. Supported values are:
|