Is there any way for an Arduino slave to send a byte array to the raspberry pi master without the master having called on it?
This is not how I2C is specified and supposed to work:
The aforementioned reference design is a bus with a clock (SCL) and data (SDA) lines with 7-bit addressing. The bus has two roles for nodes: master and slave:
- Master node – node that generates the clock and initiates communication with slaves.
- Slave node – node that receives the clock and responds when addressed by the master.
So it is up to the master to initiate any communication whereas the slave may not... and while there is such a thing as a multi-master mode on the I2C bus the Pi does not seem to support that either (source).
So the two relevant options here are:
1) have the Pi as master poll the Arduino on a regular basis to check if it (the Arduino) has any data to transmit.
2) have another GPIO line between the two (output on the Arduino, input on the Pi; mind the voltage levels though). Sort of an IRQ - a hardware interrupt request - which allows the Arduino to trigger the Pi to act as a master on the I2C bus and fetch the data as it becomes available.