diff options
author | Ryan Caltabiano <rcalt2vt@gmail.com> | 2019-04-15 22:32:57 -0500 |
---|---|---|
committer | skullydazed <skullydazed@users.noreply.github.com> | 2019-04-20 08:05:10 -0700 |
commit | 0a645225b9c863a106921185a6c2e0c340f10694 (patch) | |
tree | 2bf8c295650e54fb4548a7ac4d348ccfc8caa307 /drivers/avr/i2c_master.c | |
parent | b5cb5ec6ddb15cfe336b835055f546f72d440a66 (diff) | |
download | qmk_firmware-0a645225b9c863a106921185a6c2e0c340f10694.tar.gz qmk_firmware-0a645225b9c863a106921185a6c2e0c340f10694.zip |
OLED Driver Feature
Diffstat (limited to 'drivers/avr/i2c_master.c')
-rwxr-xr-x | drivers/avr/i2c_master.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/avr/i2c_master.c b/drivers/avr/i2c_master.c index ba6d0d158..a7364bae0 100755 --- a/drivers/avr/i2c_master.c +++ b/drivers/avr/i2c_master.c | |||
@@ -121,7 +121,7 @@ int16_t i2c_read_nack(uint16_t timeout) { | |||
121 | return TWDR; | 121 | return TWDR; |
122 | } | 122 | } |
123 | 123 | ||
124 | i2c_status_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout) { | 124 | i2c_status_t i2c_transmit(uint8_t address, const uint8_t* data, uint16_t length, uint16_t timeout) { |
125 | i2c_status_t status = i2c_start(address | I2C_WRITE, timeout); | 125 | i2c_status_t status = i2c_start(address | I2C_WRITE, timeout); |
126 | 126 | ||
127 | for (uint16_t i = 0; i < length && status >= 0; i++) { | 127 | for (uint16_t i = 0; i < length && status >= 0; i++) { |
@@ -155,7 +155,7 @@ i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16 | |||
155 | return (status < 0) ? status : I2C_STATUS_SUCCESS; | 155 | return (status < 0) ? status : I2C_STATUS_SUCCESS; |
156 | } | 156 | } |
157 | 157 | ||
158 | i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout) { | 158 | i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout) { |
159 | i2c_status_t status = i2c_start(devaddr | 0x00, timeout); | 159 | i2c_status_t status = i2c_start(devaddr | 0x00, timeout); |
160 | if (status >= 0) { | 160 | if (status >= 0) { |
161 | status = i2c_write(regaddr, timeout); | 161 | status = i2c_write(regaddr, timeout); |