MCPcopy Create free account
hub / github.com/CalcProgrammer1/OpenRGB / i2c_read

Function i2c_read

i2c_tools/i2c_tools.cpp:138–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136\******************************************************************************************/
137
138std::string i2c_read(i2c_smbus_interface * bus, unsigned char address, unsigned char regaddr, unsigned char size)
139{
140 int i;
141
142 bus->i2c_smbus_write_byte(address, regaddr);
143
144 char line[128];
145 std::string text;
146
147 for(i = 0; i < size; i++)
148 {
149 snprintf(line, 128, "%02x ", (unsigned char)bus->i2c_smbus_read_byte(address));
150 text.append(line);
151 }
152
153 return text;
154
155} /* i2c_read() */

Callers 1

on_ReadButton_clickedMethod · 0.85

Calls 4

snprintfFunction · 0.85
i2c_smbus_write_byteMethod · 0.80
i2c_smbus_read_byteMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected