###################################### Version 0.9 (August 2013) (Changes from version 0.8) ###################################### Bug Fixes: ---------- + Fixed incorrect mask in member function PWM_Board::setDutyCycle in pca9685_pwm.cc Said error caused led on/off times to be incorrectly set causing catastrophic damage to servo motors when using certain duty cycle values. + Fixed incorrect register read in member function PWM_Board::sleep in pca9685_pwm.cc that resulted in incorrect restoration of Mode1 register after sleep. + Added missing destructor for the PWM_Board class. The destructor is necessary since terminating the master program or even shutting down the R-Pi does not turn off the PWM channels on the PCA9685. Enhancements: ------------- + Added a new member function PWM_Board::getFreq in pca9685_pwm.cc to enable us to determine the frequency that the board is (or, at least thinks that it is) operating at. + Added a new member function PWM_Board::readRegister in pca9685_pwm.cc to allow a simple way to read a single register on the pca9685. + Added a new member function PWM_Board::fullOn in pca9685_pwm.cc to allow us to set a single channel (or all channels) to logic 1 without any transitions at the end of pulse periods. This also allows us to use a channel as a (non real time) chip select for other peripherals, thus freeing up a GPIO pin on the host microcontroller. + Added a new member function PWM_Board::fullOff in pca9685_pwm.cc to allow us to set a single channel (or all channels) to logic 0 without any transitions at the end of pulse periods. This also allows us to use a channel as a (non real time) chip select for other peripherals, thus freeing up a GPIO pin on the host microcontroller. + Added a new member function PWM_Board::wakeUp in pca9685_pwm.cc to wake up the pca9685 from sleep in just a few I2C cycles, with all PWM channels restored to their pre-sleep state. + Changed member function PWM_Board::sleep in pca9685_pwm.cc so that all PWM channels are not shut down explicitly prior to sleeping. Otherwise, we cannot restore all PWM channels to their pre-sleep state without explicitly reloading all the LEDn_ON and LEDn_OFF registers. + Added a new member function PWM_Board::setPulseWidth in pca9685_pwm.cc to allow more accurate setting of pulse widths for use with servo motors. + Implemented missing error checks in member function pca9685_pwm.cc to ensure that read/write failures to the PWM board result in an appropriate error return code (I2C_TRANSACTION_FAILED). + Changed member function PWM_Board::softReset in pca9685_pwm.cc so that executing this function now leaves the pca9685 with clean, default values in its Mode1, Mode2, Prescale, LEDn_On_H, LEDn_On_L, LEDn_Off_H and LEDn_Off_L registers. + Cleaned up code and naming conventions for functions and variables. Miscellaneous: -------------- + Renamed the project to more accurately reflect the hardware chip (PCA9685) that it is written for. Although the reference implementation is Adfruit's PCA9685 breakout board, these routines should work for *any* PCA9685-based board. TO DO: ------ * Allow I2C device 's path and minor device number to be use-specifiable in member functions PWM_Board::initialize and PWM_Board::hardReset.