Yes; this is something I did when building a weather station where I needed Arduino analog and interrupt-triggering inputs. On the Master the python code will look something like:
i2c_ch = 1
bus = smbus.SMBus(i2c_ch)
#address of the Arduino slave:
i2c_address = 20
...
readArray = bus.read_i2c_block_data(i2c_address,8)
Then on the Arduino the code will look like:
#define I2C_SLAVE_ADDR 20
void setup() {
Wire.begin(I2C_SLAVE_ADDR);
Wire.onReceive(receieveEvent);
Wire.onRequest(requestEvent);
}
void receieveEvent() { //for reading data from the master
byte byteRead = 0;
while(0 < Wire.available()) // loop through all but the last
{
byteRead = Wire.read();
}
}
void requestEvent(){ //for sending data to the master
long val = millis(); //whatever you want to send, in this case millis()
byte buffer[4];
buffer[0] = val >> 24;
buffer[1] = val >> 16;
buffer[2] = val >> 8;
buffer[3] = val;
Wire.write(buffer, 4);
}
For more details on this, check out the github repo I made for this weather station's code here: https://github.com/judasgutenberg/i2c-weather-slave