|
28 | 28 | // REGISTER ADDRESSES
|
29 | 29 | #define PCA9685_MODE1 0x00 /**< Mode Register 1 */
|
30 | 30 | #define PCA9685_MODE2 0x01 /**< Mode Register 2 */
|
31 |
| -#define PCA9685_SUBADR1 0x02 /**< i2c bus address 1 */ |
32 |
| -#define PCA9685_SUBADR2 0x03 /**< i2c bus address 2 */ |
33 |
| -#define PCA9685_SUBADR3 0x04 /**< i2c bus address 3 */ |
34 |
| -#define PCA9685_ALLCALLADR 0x05 |
| 31 | +#define PCA9685_SUBADR1 0x02 /**< I2C-bus subaddress 1 */ |
| 32 | +#define PCA9685_SUBADR2 0x03 /**< I2C-bus subaddress 2 */ |
| 33 | +#define PCA9685_SUBADR3 0x04 /**< I2C-bus subaddress 3 */ |
| 34 | +#define PCA9685_ALLCALLADR 0x05 /**< LED All Call I2C-bus address */ |
35 | 35 | #define PCA9685_LED0_ON_L 0x06 /**< LED0 output and brightness control byte 0 */
|
36 | 36 | #define PCA9685_LED0_ON_H 0x07 /**< LED0 output and brightness control byte 1 */
|
37 | 37 | #define PCA9685_LED0_OFF_L 0x08 /**< LED0 output and brightness control byte 2 */
|
|
42 | 42 | #define PCA9685_ALLLED_OFF_L 0xFC /**< load all the LEDn_OFF registers, byte 0 */
|
43 | 43 | #define PCA9685_ALLLED_OFF_H 0xFD /**< load all the LEDn_OFF registers, byte 1 */
|
44 | 44 | #define PCA9685_PRESCALE 0xFE /**< Prescaler for PWM output frequency */
|
45 |
| -#define PCA9685_TESTMODE 0xFF |
| 45 | +#define PCA9685_TESTMODE 0xFF /**< defines the test mode to be entered */ |
46 | 46 |
|
47 | 47 | // MODE1 bits
|
48 |
| -#define MODE1_ALLCAL 0x01 |
49 |
| -#define MODE1_SUB3 0x02 |
50 |
| -#define MODE1_SUB2 0x04 |
51 |
| -#define MODE1_SUB1 0x08 |
52 |
| -#define MODE1_SLEEP 0x10 |
53 |
| -#define MODE1_AI 0x20 |
54 |
| -#define MODE1_EXTCLK 0x40 |
55 |
| -#define MODE1_RESTART 0x80 |
| 48 | +#define MODE1_ALLCAL 0x01 /**< respond to LED All Call I2C-bus address */ |
| 49 | +#define MODE1_SUB3 0x02 /**< respond to I2C-bus subaddress 3 */ |
| 50 | +#define MODE1_SUB2 0x04 /**< respond to I2C-bus subaddress 2 */ |
| 51 | +#define MODE1_SUB1 0x08 /**< respond to I2C-bus subaddress 1 */ |
| 52 | +#define MODE1_SLEEP 0x10 /**< Low power mode. Oscillator off */ |
| 53 | +#define MODE1_AI 0x20 /**< Auto-Increment enabled */ |
| 54 | +#define MODE1_EXTCLK 0x40 /**< Use EXTCLK pin clock */ |
| 55 | +#define MODE1_RESTART 0x80 /**< Restart enabled */ |
56 | 56 | // MODE2 bits
|
57 |
| -#define MODE2_OUTNE_0 0x01 |
58 |
| -#define MODE2_OUTNE_1 0x02 |
59 |
| -#define MODE2_OUTDRV 0x04 |
60 |
| -#define MODE2_OCH 0x08 |
61 |
| -#define MODE2_INVRT 0x10 |
| 57 | +#define MODE2_OUTNE_0 0x01 /**< Active LOW output enable input */ |
| 58 | +#define MODE2_OUTNE_1 0x02 /**< Active LOW output enable input - high impedience */ |
| 59 | +#define MODE2_OUTDRV 0x04 /**< totem pole structure vs open-drain */ |
| 60 | +#define MODE2_OCH 0x08 /**< Outputs change on ACK vs STOP */ |
| 61 | +#define MODE2_INVRT 0x10 /**< Output logic state inverted */ |
62 | 62 |
|
63 |
| -// Default PCA9685 I2C Slave Address if A0-A5 are not set |
64 |
| -#define PCA9685_I2C_ADDRESS 0x40 |
| 63 | +#define PCA9685_I2C_ADDRESS 0x40 /**< Default PCA9685 I2C Slave Address */ |
65 | 64 |
|
66 |
| -#define FREQUENCY_OSCILLATOR 25000000 |
67 |
| -#define FREQUENCY_CALIBRATED 26075000 // measured 104.3% compared to official 25 MHz |
68 |
| -#define FREQUENCY_LEGACY 27777778 // Effect of freq /= 0,9 |
| 65 | +#define FREQUENCY_OSCILLATOR 25000000 /**< Oscillator frequency cf satasheet */ |
| 66 | +#define FREQUENCY_CALIBRATED 26075000 /**< Oscillator frequency measured at 104.3% */ |
| 67 | +#define FREQUENCY_LEGACY 27777778 /**< Oscillator frequency using freq /= 0,9 */ |
69 | 68 |
|
70 |
| -#define PCA9685_PRESCALE_MIN 3 |
71 |
| -#define PCA9685_PRESCALE_MAX 255 |
| 69 | +#define PCA9685_PRESCALE_MIN 3 /**< minimum prescale value */ |
| 70 | +#define PCA9685_PRESCALE_MAX 255 /**< maximum prescale value */ |
72 | 71 |
|
73 | 72 | /*!
|
74 | 73 | * @brief Class that stores state and functions for interacting with PCA9685 PWM chip
|
|
0 commit comments