You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
379 B
17 lines
379 B
#include "i2c_driver.h"
|
|
#include "systemCall.h"
|
|
|
|
I2C_Driver::I2C_Driver()
|
|
{
|
|
}
|
|
|
|
std::string I2C_Driver::readByte(const uint8_t& address, const uint8_t& reg)
|
|
{
|
|
std::string addrs = std::to_string(address);
|
|
std::string regs = std::to_string(reg);
|
|
std::string command = "i2cget -y 1 " + addrs + " " + regs;
|
|
char* c = const_cast<char*>(command.c_str());
|
|
return execBash(c);
|
|
}
|
|
|