DUNE: Uniform Navigational Environment
2016.05.0
|
Classes | |
class | Error |
Public Member Functions | |
I2C (const std::string &bus_dev) | |
~I2C (void) | |
int | transfer (uint8_t adr, uint8_t cmd, const uint8_t *wdata, uint8_t wlen, uint8_t *rdata, uint8_t rlen, uint8_t *bytes_read) |
unsigned | read (uint8_t adr, uint8_t *bfr, unsigned bfr_len) |
void | connect (uint8_t addr) |
unsigned | read (uint8_t *bfr, unsigned bfr_len) |
unsigned | write (const uint8_t *bfr, unsigned bfr_len) |
DUNE::Hardware::I2C::I2C | ( | const std::string & | bus_dev | ) |
I2C constructor.
References DUNE::System::Error::getLastMessage(), and DUNE::NotImplemented.
DUNE::Hardware::I2C::~I2C | ( | void | ) |
I2C destructor.
void DUNE::Hardware::I2C::connect | ( | uint8_t | addr | ) |
Connect to slave address.
addr | slave address. |
References DUNE::System::Error::getLastMessage().
Referenced by Power::MCBv2::MCP23017::MCP23017(), and DUNE::Hardware::LUCL::Protocol::open().
unsigned DUNE::Hardware::I2C::read | ( | uint8_t | adr, |
uint8_t * | bfr, | ||
unsigned | bfr_len | ||
) |
Referenced by DUNE::Hardware::LUCL::Protocol::read(), and read().
unsigned DUNE::Hardware::I2C::read | ( | uint8_t * | bfr, |
unsigned | bfr_len | ||
) |
References DUNE::System::Error::getLastMessage(), and read().
int DUNE::Hardware::I2C::transfer | ( | uint8_t | adr, |
uint8_t | cmd, | ||
const uint8_t * | wdata, | ||
uint8_t | wlen, | ||
uint8_t * | rdata, | ||
uint8_t | rlen, | ||
uint8_t * | bytes_read | ||
) |
Initialize an I2C transfer.
adr | slave address. |
cmd | command to send. |
wdata | data to write. |
wlen | number of bytes to write (or in 0x80 for a block write). |
rdata | place to store data read. |
rlen | number of bytes to read (or in 0x80 for a block read). |
bytes_read | place to store number of bytes read. |
unsigned DUNE::Hardware::I2C::write | ( | const uint8_t * | bfr, |
unsigned | bfr_len | ||
) |
References DUNE::System::Error::getLastMessage().
Referenced by DUNE::Hardware::LUCL::Protocol::write().