code for I2C slave mode on NS9360

Although I guess its a little unusual, we have an application where we need to hook up a Digi Wi9c to an I2C bus mastered by another embedded device and have it receive data over the bus from the other device. This data will then be made available to Linux userspace applications running on the Wi9c.

Whilst this could be done with existing code using an I2C EEPROM as a buffer and a multi-master approach (Board A writes to EEPROM as master, Wi9c reads from EEPROM as master), this is a bit cumbersome and slow, and there is the risk of master contention as Board A also needs to do other stuff on the I2C bus. Consequently its going to be a little difficult to create clear time windows during which the Wi9c can read the EEPROM without interfering with Board A’s tasks.

Much better is for the Wi9c to act as slave - then there is no master - master contention and its quicker; also we only need data to travel one way from Board A to the Wi9c so what is required from the Wi9c as slave is pretty simple.

The NS9360 specs indicate it is capable of slave operation, but I assume the Linux kernel driver will need to be modified to set the device up as a slave and make the data available in a buffer to Linux applications on the Wi9c.

So my question is - can anyone give me any pointers on how to do this? Is there example code available for the NS9360 or failing that for a similar device which can help us get up and running?

check the NS9360 hardware reference manual:

not sure by heart if it can run I2C in slave mode at all.