simavr
simavr copied to clipboard
I2c slave implementation
Hello,
I have implemented a small example for a twi slave on an AVR device. While I implemented this, I have seen that there a some small bugs within the implementation of the sim_twi.
I think the first was, that the interrupt Flag is cleared while writing a 1 TWIINT register. The second was some invalid states of the TWI.
I think I have corrected these and attach a very simple implementation of the avr twi slave.
Best regards and many thanks for that great simulator! seplog
This needed some small changes when merging: the include paths in parts/i2c_master.[ch] point to an installed version (that I do not have) rather than the build tree and after PR #440 was merged, the firmware struct in i2ctest.c must be initialised. I also tidied some spelling and syntax in the README. My version is here.