summaryrefslogtreecommitdiff
path: root/drivers/avr
diff options
context:
space:
mode:
authorFlorian Didron <fdidron@users.noreply.github.com>2019-04-23 08:44:02 +0900
committerGitHub <noreply@github.com>2019-04-23 08:44:02 +0900
commit95462d0d65a8afd326b0dede3a9887cf8c70194e (patch)
treef795b3e6d2ababc896defffdfb1563b3ffdff8de /drivers/avr
parent70945f1146a035da81f2545671f4768a2e97847b (diff)
parentc3a160bf721b4ec428ec389b696784c27d1d2e42 (diff)
Merge pull request #20 from zsa/feature/oled_driver
Adds support for OLED Driver
Diffstat (limited to 'drivers/avr')
-rwxr-xr-xdrivers/avr/i2c_master.c4
-rwxr-xr-xdrivers/avr/i2c_master.h6
2 files changed, 5 insertions, 5 deletions
diff --git a/drivers/avr/i2c_master.c b/drivers/avr/i2c_master.c
index 0db949db4a..6137f9b15f 100755
--- a/drivers/avr/i2c_master.c
+++ b/drivers/avr/i2c_master.c
@@ -109,7 +109,7 @@ int16_t i2c_read_nack(uint16_t timeout) {
return TWDR;
}
-i2c_status_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout) {
+i2c_status_t i2c_transmit(uint8_t address, const uint8_t* data, uint16_t length, uint16_t timeout) {
i2c_status_t status = i2c_start(address | I2C_WRITE, timeout);
for (uint16_t i = 0; i < length && status >= 0; i++) {
@@ -143,7 +143,7 @@ i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16
return (status < 0) ? status : I2C_STATUS_SUCCESS;
}
-i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout) {
+i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout) {
i2c_status_t status = i2c_start(devaddr | 0x00, timeout);
if (status >= 0) {
status = i2c_write(regaddr, timeout);
diff --git a/drivers/avr/i2c_master.h b/drivers/avr/i2c_master.h
index 81a7fb5e32..b4613115d9 100755
--- a/drivers/avr/i2c_master.h
+++ b/drivers/avr/i2c_master.h
@@ -22,10 +22,10 @@ i2c_status_t i2c_start(uint8_t address, uint16_t timeout);
i2c_status_t i2c_write(uint8_t data, uint16_t timeout);
int16_t i2c_read_ack(uint16_t timeout);
int16_t i2c_read_nack(uint16_t timeout);
-i2c_status_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout);
+i2c_status_t i2c_transmit(uint8_t address, const uint8_t* data, uint16_t length, uint16_t timeout);
i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout);
-i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout);
+i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout);
i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout);
void i2c_stop(void);
-#endif // I2C_MASTER_H \ No newline at end of file
+#endif // I2C_MASTER_H