Adafruit-PWM-Servo-Driver-Library
Adafruit-PWM-Servo-Driver-Library copied to clipboard
Resetting of I2C bus speed
I make the experience that the command Adafruit_PWMServoDriver::begin() resets the I2C bus speed to 100 kHz. Is this correct? I can set it again to 400 kHz after the begin, but this is not really nice when having a general I2C parameter and bus definition in a larger program context and having many different I2C devices on the bus.
Would it be possible to leave the I2C bus properties untouched of the Adafruit PWM Servo code?
Cheers Reto
yeah i dont think it should, do you want to do a PR?
I would like to leave it to the developers to confirm the issue and find the solution if possible. However, If you want I can try to analyze where the problem arises in the library, ok?
This might be BSP specific? What board are you using?
This library's ::begin() calls begin() on the I2C device:
https://github.com/adafruit/Adafruit-PWM-Servo-Driver-Library/blob/73cf3ecc79c7c33a72f8ce1a3d91ca556cd34ab3/Adafruit_PWMServoDriver.cpp#L70
which then just calls the BSP's begin() for Wire:
https://github.com/adafruit/Adafruit_BusIO/blob/a09a91d13ecf321befb148e12304777db1633c7a/Adafruit_I2CDevice.cpp#L31