|
|
| SC16IS752 (TwoWire &wire, uint8_t addr=SC16IS750_I2C_ADDRESS_AD, uint32_t crystal_freq_hz=SC16IS750_CRYSTCAL_FREQ) |
| | Constructs an SC16IS752 instance using I2C transport.
|
| |
|
| SC16IS752 (SPIClass &spi, uint8_t ss_pin, uint32_t crystal_freq_hz=SC16IS750_CRYSTCAL_FREQ) |
| | Constructs an SC16IS752 instance using SPI transport.
|
| |
|
| SC16IS752 (const SC16IS752 &)=delete |
| | Prevent copying and moving of the driver instance.
|
| |
|
SC16IS752 & | operator= (const SC16IS752 &)=delete |
| | Prevent copying and moving of the driver instance.
|
| |
|
| SC16IS752 (SC16IS752 &&)=delete |
| | Prevent copying and moving of the driver instance.
|
| |
|
SC16IS752 & | operator= (SC16IS752 &&)=delete |
| | Prevent copying and moving of the driver instance.
|
| |
|
ChannelStream & | channelA () |
| | Returns channel A stream adapter.
|
| |
|
ChannelStream & | channelB () |
| | Returns channel B stream adapter.
|
| |
|
void | setLogger (SC16IS752Logger *log) |
| | Set logger for debug output.
|
| |
|
void | setTimeout (uint32_t time_out) |
| | Sets read timeout in milliseconds.
|
| |
|
void | end () |
| | Gracefully closes both UART channels and resets the device.
|
| |
|
| void | beginChannel (SC16IS752_Channel channel, uint32_t baudrate, uint32_t config=SC16IS752_DEFAULT_CONFIG) |
| | Initializes a specific UART channel with the given baud rate and serial configuration.
|
| |
|
void | endChannel (SC16IS752_Channel channel) |
| | Gracefully closes a specific UART channel.
|
| |
|
int | read (SC16IS752_Channel channel) |
| | Reads a byte from the specified channel.
|
| |
|
size_t | write (SC16IS752_Channel channel, uint8_t val) |
| | Writes a byte to the specified channel.
|
| |
|
int | available (SC16IS752_Channel channel) |
| | Returns number of bytes available to read from the channel.
|
| |
|
uint8_t | linestate (SC16IS752_Channel channel) |
| | Returns line status register for the channel.
|
| |
|
uint8_t | ping () |
| | Verifies device communication (returns 1 if successful)
|
| |
|
int | peek (SC16IS752_Channel channel) |
| | Reads a byte without removing it from the buffer.
|
| |
|
void | flush (SC16IS752_Channel channel) |
| | Waits for transmission to complete on the channel.
|
| |
|
uint8_t | interruptPendingTest (SC16IS752_Channel channel) |
| | Tests if an interrupt is pending on the channel.
|
| |
|
int | interruptEventTest (SC16IS752_Channel channel) |
| | Returns the type of interrupt event for the channel.
|
| |
|
void | setPinInterrupt (uint8_t io_int_ena) |
| | Configures GPIO pin interrupt settings.
|
| |
| void | enableRs485 (SC16IS752_Channel channel, bool invert_rts) |
| |
|
void | enableTransmit (SC16IS752_Channel channel, uint8_t tx_enable) |
| | Enables or disables transmission on the specified channel.
|
| |
|
void | initializeDevice () |
| | Initializes the SC16IS752 device state on an already configured bus.
|
| |
|
uint8_t | gpioGetPortState (void) |
| | Returns the current state of all GPIO pins as a bitmask.
|
| |
|
void | interruptControl (SC16IS752_Channel channel, uint8_t int_ena) |
| | Writes interrupt enable flags for the selected UART channel.
|
| |
|
void | modemPin (uint8_t gpio) |
| | Selects whether upper IO pins operate as modem pins or GPIO pins.
|
| |
|
void | gpioLatch (uint8_t latch) |
| | Enables or disables GPIO output latching behavior.
|
| |
|
int16_t | setBaudrate (SC16IS752_Channel channel, uint32_t baudrate) |
| | Configures baud rate divisor and returns error in parts-per-thousand.
|
| |
|
uint8_t | readRegister (SC16IS752_Channel channel, uint8_t reg_addr) |
| | Reads one register byte from the selected channel via I2C or SPI.
|
| |
|
void | writeRegister (SC16IS752_Channel channel, uint8_t reg_addr, uint8_t val) |
| | Writes one register byte to the selected channel via I2C or SPI.
|
| |
|
void | setLine (SC16IS752_Channel channel, uint8_t data_length, uint8_t parity_select, uint8_t stop_length) |
| | Configures line format by data bits, parity mode, and stop bits.
|
| |
|
void | setLine (SC16IS752_Channel channel, uint32_t config) |
| | Configures data bits, parity, and stop bits from an Arduino SERIAL_* value.
|
| |
|
void | pinMode (uint8_t pin, uint8_t io) |
| | Sets GPIO pin as input or output (OUTPUT or INPUT)
|
| |
|
void | digitalWrite (uint8_t pin, uint8_t value) |
| | Sets GPIO pin output level (HIGH or LOW)
|
| |
|
uint8_t | digitalRead (uint8_t pin) |
| | Reads GPIO pin level (returns 0 or 1)
|
| |
|
void | gpioSetPinMode (uint8_t pin_number, uint8_t i_o) |
| | Sets one GPIO pin direction (OUTPUT or INPUT).
|
| |
|
void | gpioSetPinState (uint8_t pin_number, uint8_t pin_state) |
| | Sets one GPIO output pin state (HIGH or LOW).
|
| |
|
uint8_t | gpioGetPinState (uint8_t pin_number) |
| | Reads one GPIO pin state and returns 0 or 1.
|
| |
|
void | gpioSetPortMode (uint8_t port_io) |
| | Sets direction of all GPIO pins using a bitmask.
|
| |
|
void | gpioSetPortState (uint8_t port_state) |
| | Sets output state of all GPIO pins using a bitmask.
|
| |
|
void | resetDevice () |
| | Issues a software reset to the SC16IS752 device.
|
| |
|
void | fifoEnable (SC16IS752_Channel channel, uint8_t fifo_enable) |
| | Enables or disables FIFO for the selected channel.
|
| |
|
void | fifoReset (SC16IS752_Channel channel, uint8_t rx_fifo) |
| | Resets RX or TX FIFO for the selected channel.
|
| |
|
void | fifoSetTriggerLevel (SC16IS752_Channel channel, uint8_t rx_fifo, uint8_t length) |
| | Sets RX or TX FIFO trigger level for interrupt generation.
|
| |
|
uint8_t | fifoAvailableData (SC16IS752_Channel channel) |
| | Returns number of bytes currently available in RX FIFO.
|
| |
|
uint8_t | fifoAvailableSpace (SC16IS752_Channel channel) |
| | Returns free space currently available in TX FIFO.
|
| |
|
void | writeByte (SC16IS752_Channel channel, uint8_t val) |
| | Writes one byte to TX holding register when transmitter is ready.
|
| |
|
int | readByte (SC16IS752_Channel channel) |
| | Reads one byte from RX holding register, or -1 when no data is available.
|
| |
|
bool | decodeSerialConfig (uint32_t config, uint8_t *data_length, uint8_t *parity_select, uint8_t *stop_length) |
| | Decodes Arduino SERIAL_* format into data bits, parity, and stop bits.
|
| |
Driver for the NXP SC16IS752 dual UART bridge over I2C or SPI.
The SC16IS752 provides two independent UART channels (A and B) and optional GPIO/interrupt capabilities. This class wraps register-level access and exposes:
Construction selects the transport layer:
Typical usage:
SC16IS752 uart(Wire, SC16IS750_I2C_ADDRESS_AD);
uart.channelA().begin(9600);
uart.channelB().begin(115200);
uart.channelA().write('H');
Driver for the NXP SC16IS752 dual UART bridge over I2C or SPI.
Definition SC16IS752.h:170
Optionally, attach a logger with setLogger() to receive debug output.