diff --git a/drivers/avr/i2c_slave.c b/drivers/avr/i2c_slave.c new file mode 100755 index 000000000..3edf85b12 --- /dev/null +++ b/drivers/avr/i2c_slave.c @@ -0,0 +1,100 @@ +/* Library made by: g4lvanix + * Github repository: https://github.com/g4lvanix/I2C-slave-lib + */ + +#include +#include +#include + +#include "i2c_slave.h" + +void i2c_init(uint8_t address){ + // load address into TWI address register + TWAR = (address << 1); + // set the TWCR to enable address matching and enable TWI, clear TWINT, enable TWI interrupt + TWCR = (1<