Library for interfacing NXPs SC16IS741 Single UART with I2C-bus/SPI interface
typical SPI clock speed to be used
configuration of clock polarity and clock phase for the SC16IS741
typical I2C clock speed to be used (400kHz, I2C Fast-Mode)
Available I2C addresses
SC16IS741 UART Configuration Bits (Bitmask)
Initializes communication with the SC16IS741 and prepares it for use
In SPI mode (cs >= 0, addr =-1) first of all the used CS pin is configured as an output and set to high so no data transfer takes place at the beginning. If the optional RESET pin is specified, a hardware reset sequence is performed. Communication with the SC16IS741 is verified by reading the contents of the SC16IS741_REG_LCR register, which after reset must match a default value of 0x1D.
Activates the SC16IS741 in Auto RS-485 RTS control.
Write data to the SC16IS741
Called every time when data has been received by the SC16IS741
Disables Rx/Tx functions as well as all interrupts and enables the sleep mode of the SC16IS741
absolute maximum SPI clock speed (4MHz)
absolute maximum I2C clock speed (400kHz, I2C Fast-Mode)
send buffer size [bytes] (default = 256 bytes)
sets the maximum number of SC16IS741 that can be managed by the library. (default = 1)
Clock frequenz [Hz] used for the baud rate oscillator (default = 1843200)
SC16IS741 Available register (Address | R/W | Default | Description)
Interrupt Enable Register
FIFO Control Register
Trigger level for the RX FIFO (FIFO Control Register, bit 6-7)
Trigger level for the TX FIFO (FIFO Control Register, bit 4-5)
Interrupt Identification Register
bit 5-1: Interrupt source (Interrupt Identification Register, bit 1-5)
Line Control Register
bit 0-1: Word length (Line Control Register, bit 0-1)
Modem Control Register
Line Status Register
Modem Status Register
Transmission control register
Trigger level register
UART Reset Register
Extra Feature Register
Enhanced Feature Register
Transmit software flow control (Enhanced Feature Register, bit 2-3)
Receiver software flow control (Enhanced Feature Register, bit 0-1)
Reads register of SC16IS741
Writes register of SC16IS741
Updates register of SC16IS741