Can a Raspberry Pi be an I2C slave?
I also have connected the SDA1 and SCL1 of the raspberry to this I2C bus so that I can do i2cdetect -y 1 to list I2C devices on the bus. The problem with this code is that despite correctly Addressing the Raspberry Pi, i2cdetect -y 1 is able to see address 0x0A, I can not receive any message.
What’s the default I2C bus speed on Raspberry Pi?
The default is usually set to 100000. I successfully used 400000 with an OLED display module to increase the rate at which images could be updated. Finally, for a list of I2C related articles click here. More information about the I2C protocol can be found on Wikipedia.
How do I change the bus speed on Raspberry Pi?
This is particularly important when using the I2C interface to control a display module. In the newer versions of Raspbian this change must be made using a Device Tree parameter. The bus speed is sometimes referred to as “baudrate” although the two aren’t actually the same thing.
Is it easy to implement the I2C protocol?
The I2c-protocol is relatively easy to implement once understood. A problem could be the real-time aspects if you’re really sampling the I2c-bus yourself: to have an I2c-bus running at 100kHz you need at least read the GPIO used for SCL (clock) 200000 times per second ideally with a constant interval to not miss a cycle.
When to use bscxfer in Raspberry Pi?
In the source code, the data in the bsc_xfer_t struct are used add or receive messages but those are only applied when bscXfer is executed with the address to the struct (as joan pointed out in his solution).
How to test a Raspberry Pi as a Master?
To shortly test it a master, a popular option is to use smbus, which is far easier and can be found by simply searching with an search engine of your choice. Look up the SDA, SCL pins (they differ as a master!) I hope, that I could clarify this topic for other people.