2012-12-14 21:55:38 -04:00
|
|
|
|
2015-08-11 03:28:43 -03:00
|
|
|
#include <AP_HAL/AP_HAL.h>
|
2012-12-14 21:55:38 -04:00
|
|
|
#include "I2CDriver.h"
|
|
|
|
|
|
|
|
using namespace Empty;
|
|
|
|
|
2015-12-07 14:53:55 -04:00
|
|
|
void I2CDriver::begin() {}
|
|
|
|
void I2CDriver::end() {}
|
|
|
|
void I2CDriver::setTimeout(uint16_t ms) {}
|
|
|
|
void I2CDriver::setHighSpeed(bool active) {}
|
2012-12-14 21:55:38 -04:00
|
|
|
|
2015-12-07 14:53:55 -04:00
|
|
|
uint8_t I2CDriver::write(uint8_t addr, uint8_t len, uint8_t* data)
|
2014-06-30 17:40:53 -03:00
|
|
|
{return 1;}
|
2015-12-07 14:53:55 -04:00
|
|
|
uint8_t I2CDriver::writeRegister(uint8_t addr, uint8_t reg, uint8_t val)
|
2014-06-30 17:40:53 -03:00
|
|
|
{return 1;}
|
2015-12-07 14:53:55 -04:00
|
|
|
uint8_t I2CDriver::writeRegisters(uint8_t addr, uint8_t reg,
|
2012-12-14 21:55:38 -04:00
|
|
|
uint8_t len, uint8_t* data)
|
2014-06-30 17:40:53 -03:00
|
|
|
{return 1;}
|
2012-12-14 21:55:38 -04:00
|
|
|
|
2015-12-07 14:53:55 -04:00
|
|
|
uint8_t I2CDriver::read(uint8_t addr, uint8_t len, uint8_t* data)
|
2013-11-22 18:40:45 -04:00
|
|
|
{
|
|
|
|
memset(data, 0, len);
|
|
|
|
return 0;
|
|
|
|
}
|
2015-12-07 14:53:55 -04:00
|
|
|
uint8_t I2CDriver::readRegister(uint8_t addr, uint8_t reg, uint8_t* data)
|
2013-11-22 18:40:45 -04:00
|
|
|
{
|
|
|
|
*data = 0;
|
2014-06-30 17:40:53 -03:00
|
|
|
return 1;
|
2013-11-22 18:40:45 -04:00
|
|
|
}
|
|
|
|
|
2015-12-07 14:53:55 -04:00
|
|
|
uint8_t I2CDriver::readRegisters(uint8_t addr, uint8_t reg,
|
2013-11-22 18:40:45 -04:00
|
|
|
uint8_t len, uint8_t* data)
|
|
|
|
{
|
|
|
|
memset(data, 0, len);
|
2014-06-30 17:40:53 -03:00
|
|
|
return 1;
|
2013-11-22 18:40:45 -04:00
|
|
|
}
|
2012-12-14 21:55:38 -04:00
|
|
|
|
2015-12-13 23:19:34 -04:00
|
|
|
#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX
|
|
|
|
uint8_t I2CDriver::readRegistersMultiple(uint8_t addr, uint8_t reg,
|
|
|
|
uint8_t len, uint8_t count,
|
|
|
|
uint8_t* data)
|
|
|
|
{
|
|
|
|
memset(data, 0, len*count);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2015-12-07 14:53:55 -04:00
|
|
|
uint8_t I2CDriver::lockup_count() {return 0;}
|