mirror of
https://github.com/eclipse/upm.git
synced 2025-03-15 04:57:30 +03:00
pca9685: Add i2c raw bus option
Signed-off-by: Kevron Rees <kevron.m.rees@intel.com> Signed-off-by: sisinty sasmita patra <sisinty.s.patra@intel.com>
This commit is contained in:
parent
45738d0b93
commit
fba8139416
@ -33,12 +33,21 @@ using namespace upm;
|
||||
using namespace std;
|
||||
|
||||
|
||||
PCA9685::PCA9685(int bus, uint8_t address)
|
||||
PCA9685::PCA9685(int bus, uint8_t address, bool raw)
|
||||
{
|
||||
m_addr = address;
|
||||
|
||||
// setup our i2c link
|
||||
if ( !(m_i2c = mraa_i2c_init(bus)) )
|
||||
if ( raw )
|
||||
{
|
||||
m_i2c = mraa_i2c_init_raw(bus);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_i2c = mraa_i2c_init(bus);
|
||||
}
|
||||
|
||||
if ( !m_i2c)
|
||||
{
|
||||
cerr << "PCA9685: mraa_i2c_init() failed." << endl;
|
||||
return;
|
||||
|
@ -183,7 +183,7 @@ namespace upm {
|
||||
* @param bus I2C bus to use
|
||||
* @param address Address for this device
|
||||
*/
|
||||
PCA9685(int bus, uint8_t address = PCA9685_DEFAULT_I2C_ADDR);
|
||||
PCA9685(int bus, uint8_t address = PCA9685_DEFAULT_I2C_ADDR, bool raw = false);
|
||||
|
||||
/**
|
||||
* PCA9685 destructor
|
||||
|
Loading…
x
Reference in New Issue
Block a user