SerialBufferRK with SC16IS740RK

Hi There

I would like to use the serial buffer with an I2C serial port.

Are there any easy changes to the SerialBuffer class you would recommend to support both physical serial ports and the I2C ports.


I changed the instantiation from UARTSerial to Stream

SerialBufferBase::SerialBufferBase(uint8_t *buf, size_t bufSize, Stream &port) :
	buf(buf), bufSize(bufSize), port(port), ring(buf, bufSize) {


It compiles now

SC16IS740 		  i2c_serial(Wire, 0x48);	//address 3 is the default address of 0x90
SerialBuffer<4096> serBuf(i2c_serial);

I’ll see if it works!

It doesn’t work…

I suspect that it has issues with the i2c bus and threads.

It looks like it will almost work, but the SC16IS740 library doesn’t handle multiple threads reading or writing correctly, for both SPI and I2C. It pre-dates I2C locking, and SPI transactions aren’t implemented correctly. It’s not a huge change.

Yeah, I already had the lock/unlock around the i2c access on the SC16IS740 library.

It still doesn’t work so I might have missed a lock somewhere else in the application.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.