diff options
| author | James Churchill <pelrun@gmail.com> | 2019-01-23 02:57:13 +1000 |
|---|---|---|
| committer | Drashna Jaelre <drashna@live.com> | 2019-01-22 08:57:13 -0800 |
| commit | 8cf7265f8fae6f94b17c5d78ed41e52b22e2b218 (patch) | |
| tree | 232852c96d17fc612a78f788ab8ce713b99c3ffe /drivers/avr/i2c_slave.h | |
| parent | 127ec5f1e38e9472990f956a4b76192c07508feb (diff) | |
| download | qmk_firmware-8cf7265f8fae6f94b17c5d78ed41e52b22e2b218.tar.gz qmk_firmware-8cf7265f8fae6f94b17c5d78ed41e52b22e2b218.zip | |
Rename i2c_slave functions so it can coexist with i2c_master (#4875)
Also merges tx/rx buffers, as only one is necessary.
Diffstat (limited to 'drivers/avr/i2c_slave.h')
| -rwxr-xr-x | drivers/avr/i2c_slave.h | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/avr/i2c_slave.h b/drivers/avr/i2c_slave.h index 1c3b9ecc0..7b5dcbdc3 100755 --- a/drivers/avr/i2c_slave.h +++ b/drivers/avr/i2c_slave.h | |||
| @@ -8,16 +8,11 @@ | |||
| 8 | #ifndef I2C_SLAVE_H | 8 | #ifndef I2C_SLAVE_H |
| 9 | #define I2C_SLAVE_H | 9 | #define I2C_SLAVE_H |
| 10 | 10 | ||
| 11 | #define TX_BUFFER_SIZE 30 | 11 | #define I2C_SLAVE_REG_COUNT 30 |
| 12 | #define RX_BUFFER_SIZE 30 | ||
| 13 | 12 | ||
| 14 | volatile uint8_t buffer_address; | 13 | extern volatile uint8_t i2c_slave_reg[I2C_SLAVE_REG_COUNT]; |
| 15 | static volatile bool slave_has_register_set = false; | ||
| 16 | volatile uint8_t txbuffer[TX_BUFFER_SIZE]; | ||
| 17 | volatile uint8_t rxbuffer[RX_BUFFER_SIZE]; | ||
| 18 | 14 | ||
| 19 | void i2c_init(uint8_t address); | 15 | void i2c_slave_init(uint8_t address); |
| 20 | void i2c_stop(void); | 16 | void i2c_slave_stop(void); |
| 21 | ISR(TWI_vect); | ||
| 22 | 17 | ||
| 23 | #endif // I2C_SLAVE_H \ No newline at end of file | 18 | #endif // I2C_SLAVE_H \ No newline at end of file |
