Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: Base_I2C_Device.cpp
- Revision:
- 2:0a77105ec549
- Parent:
- 1:700cce0a0ca8
- Child:
- 3:bc08f5c87a7d
--- a/Base_I2C_Device.cpp Tue Jul 28 14:45:29 2015 +0000
+++ b/Base_I2C_Device.cpp Wed Jul 29 14:53:01 2015 -0400
@@ -26,6 +26,19 @@
return (((uint16_t)temp_read[0]) << 8) | (uint16_t)temp_read[1];
}
+
+char * Base_I2C_Device::ReadRegisterMultiByte(uint8_t reg, uint8_t bytes, char * temp_read)
+{
+char temp_write[1];
+
+ temp_write[0] = reg;
+ i2c.write(m_address, temp_write, 1, false); // no stop (unsure)
+ i2c.read(m_address, temp_read, bytes, 0);
+
+ return temp_read;
+
+}
+
int Base_I2C_Device::WriteRegister(uint8_t reg, uint8_t value)
{
char temp_write[2];