From 8cf7265f8fae6f94b17c5d78ed41e52b22e2b218 Mon Sep 17 00:00:00 2001 From: James Churchill Date: Wed, 23 Jan 2019 02:57:13 +1000 Subject: Rename i2c_slave functions so it can coexist with i2c_master (#4875) Also merges tx/rx buffers, as only one is necessary. --- drivers/avr/i2c_slave.h | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'drivers/avr/i2c_slave.h') diff --git a/drivers/avr/i2c_slave.h b/drivers/avr/i2c_slave.h index 1c3b9ecc00..7b5dcbdc3e 100755 --- a/drivers/avr/i2c_slave.h +++ b/drivers/avr/i2c_slave.h @@ -8,16 +8,11 @@ #ifndef I2C_SLAVE_H #define I2C_SLAVE_H -#define TX_BUFFER_SIZE 30 -#define RX_BUFFER_SIZE 30 +#define I2C_SLAVE_REG_COUNT 30 -volatile uint8_t buffer_address; -static volatile bool slave_has_register_set = false; -volatile uint8_t txbuffer[TX_BUFFER_SIZE]; -volatile uint8_t rxbuffer[RX_BUFFER_SIZE]; +extern volatile uint8_t i2c_slave_reg[I2C_SLAVE_REG_COUNT]; -void i2c_init(uint8_t address); -void i2c_stop(void); -ISR(TWI_vect); +void i2c_slave_init(uint8_t address); +void i2c_slave_stop(void); #endif // I2C_SLAVE_H \ No newline at end of file -- cgit v1.2.1