1
0
Fork 0

Add I2C slave library

- Add I2C slave library for general use.
This commit is contained in:
yiancar 2018-07-12 11:50:55 +03:00 committed by Jack Humbert
parent 3d9fda3629
commit 60797c8439
2 changed files with 119 additions and 0 deletions

19
drivers/avr/i2c_slave.h Executable file
View file

@ -0,0 +1,19 @@
/* Library made by: g4lvanix
* Github repository: https://github.com/g4lvanix/I2C-slave-lib
Info: Inititate the library by giving the required address.
Read or write to the necessary buffer according to the opperation.
*/
#ifndef I2C_SLAVE_H
#define I2C_SLAVE_H
volatile uint8_t buffer_address;
volatile uint8_t txbuffer[0xFF];
volatile uint8_t rxbuffer[0xFF];
void i2c_init(uint8_t address);
void i2c_stop(void);
ISR(TWI_vect);
#endif // I2C_SLAVE_H