Loading...
Searching...
No Matches

Register definitions for the PCA9685 I2C PWM controller. More...

Detailed Description

Register definitions for the PCA9685 I2C PWM controller.

Author
Gunar Schorcht gunar.nosp@m.@sch.nosp@m.orcht.nosp@m..net

Definition in file pca9685_regs.h.

Go to the source code of this file.

Register addresses

#define PCA9685_REG_MODE1   (0x00)
 Mode1 register.
 
#define PCA9685_REG_MODE2   (0x01)
 Mode2 register.
 
#define PCA9685_REG_SUBADR1   (0x02)
 I2C bus subaddress 1 register.
 
#define PCA9685_REG_SUBADR2   (0x03)
 I2C bus subaddress 2 register.
 
#define PCA9685_REG_SUBADR3   (0x04)
 I2C bus subaddress 3 register.
 
#define PCA9685_REG_ALLCALLADDR   (0x05)
 LED All Call I 2 C-bus address.
 
#define PCA9685_REG_LED0_ON_L   (0x06)
 LED0 ON control low byte.
 
#define PCA9685_REG_ALL_LED_ON_L   (0xfa)
 Load all LEDn_OFF register low byte.
 
#define PCA9685_REG_ALL_LED_ON_H   (0xfb)
 Load all LEDn_OFF register high byte.
 
#define PCA9685_REG_ALL_LED_OFF_L   (0xfc)
 Load all LEDn_OFF register low byte.
 
#define PCA9685_REG_ALL_LED_OFF_H   (0xfd)
 Load all LEDn_OFF register high byte.
 
#define PCA9685_REG_ALL_LED_ON   (0xfa)
 Load all LEDn_OFF register word.
 
#define PCA9685_REG_ALL_LED_OFF   (0xfc)
 Load all LEDn_OFF register word.
 
#define PCA9685_REG_PRE_SCALE   (0xfe)
 Prescaler for PWM output frequency.
 
#define PCA9685_REG_TEST_MODE   (0xff)
 Enter test mode register.
 
#define PCA9685_REG_LED_ON(n)   (0x06 + (n << 2))
 LEDn ON control word.
 
#define PCA9685_REG_LED_OFF(n)   (0x08 + (n << 2))
 LEDn OFF control word.
 
#define PCA9685_REG_LED_ON_L(n)   (0x06 + (n << 2))
 LEDn ON control low byte.
 
#define PCA9685_REG_LED_ON_H(n)   (0x07 + (n << 2))
 LEDn ON control high byte.
 
#define PCA9685_REG_LED_OFF_L(n)   (0x08 + (n << 2))
 LEDn OFF control low byte.
 
#define PCA9685_REG_LED_OFF_H(n)   (0x09 + (n << 2))
 LEDn OFF control high byte.
 

Register structures

#define PCA9685_MODE1_RESTART   (0x80)
 State of restart logic, write 1 to clear.
 
#define PCA9685_MODE1_EXTCLK   (0x40)
 Use EXTCLK pin.
 
#define PCA9685_MODE1_AI   (0x20)
 Enable register auto-increment.
 
#define PCA9685_MODE1_SLEEP   (0x10)
 Enter low power mode, PWM is off.
 
#define PCA9685_MODE1_SUB1   (0x08)
 Enable I2C subaddress 1.
 
#define PCA9685_MODE1_SUB2   (0x04)
 Enable I2C subaddress 2.
 
#define PCA9685_MODE1_SUB3   (0x02)
 Enable I2C subaddress 3.
 
#define PCA9685_MODE1_ALLCALL   (0x01)
 Enable I2C all call address.
 
#define PCA9685_MODE2_INVERT   (0x10)
 Invert outputs.
 
#define PCA9685_MODE2_OCH   (0x08)
 Output change change configuration.
 
#define PCA9685_MODE2_OUTDRV   (0x04)
 Output driver configuration.
 
#define PCA9685_MODE2_OUTNE   (0x03)
 Output enabled configuration.
 

Register value definitions

#define PCA9685_LED_ON   (0x1000) /* LEDs on word */
 
#define PCA9685_LED_OFF   (0x1000) /* LEDs off word */
 
#define PCA9685_LED_ON_H   (0x10) /* LEDs on high byte */
 
#define PCA9685_LED_OFF_H   (0x10) /* LEDs off high byte */
 
#define PCA9685_ALL_LED_ON   (0x1000) /* All LEDs on word */
 
#define PCA9685_ALL_LED_OFF   (0x1000) /* All LEDs off word */
 
#define PCA9685_ALL_LED_ON_H   (0x10) /* All LEDs on high byte */
 
#define PCA9685_ALL_LED_OFF_H   (0x10) /* All LEDs off word */
 

Macro Definition Documentation

◆ PCA9685_ALL_LED_OFF

#define PCA9685_ALL_LED_OFF   (0x1000) /* All LEDs off word */

Definition at line 88 of file pca9685_regs.h.

◆ PCA9685_ALL_LED_OFF_H

#define PCA9685_ALL_LED_OFF_H   (0x10) /* All LEDs off word */

Definition at line 90 of file pca9685_regs.h.

◆ PCA9685_ALL_LED_ON

#define PCA9685_ALL_LED_ON   (0x1000) /* All LEDs on word */

Definition at line 87 of file pca9685_regs.h.

◆ PCA9685_ALL_LED_ON_H

#define PCA9685_ALL_LED_ON_H   (0x10) /* All LEDs on high byte */

Definition at line 89 of file pca9685_regs.h.

◆ PCA9685_LED_OFF

#define PCA9685_LED_OFF   (0x1000) /* LEDs off word */

Definition at line 84 of file pca9685_regs.h.

◆ PCA9685_LED_OFF_H

#define PCA9685_LED_OFF_H   (0x10) /* LEDs off high byte */

Definition at line 86 of file pca9685_regs.h.

◆ PCA9685_LED_ON

#define PCA9685_LED_ON   (0x1000) /* LEDs on word */

Definition at line 83 of file pca9685_regs.h.

◆ PCA9685_LED_ON_H

#define PCA9685_LED_ON_H   (0x10) /* LEDs on high byte */

Definition at line 85 of file pca9685_regs.h.

◆ PCA9685_MODE1_AI

#define PCA9685_MODE1_AI   (0x20)

Enable register auto-increment.

Definition at line 65 of file pca9685_regs.h.

◆ PCA9685_MODE1_ALLCALL

#define PCA9685_MODE1_ALLCALL   (0x01)

Enable I2C all call address.

Definition at line 70 of file pca9685_regs.h.

◆ PCA9685_MODE1_EXTCLK

#define PCA9685_MODE1_EXTCLK   (0x40)

Use EXTCLK pin.

Definition at line 64 of file pca9685_regs.h.

◆ PCA9685_MODE1_RESTART

#define PCA9685_MODE1_RESTART   (0x80)

State of restart logic, write 1 to clear.

Definition at line 63 of file pca9685_regs.h.

◆ PCA9685_MODE1_SLEEP

#define PCA9685_MODE1_SLEEP   (0x10)

Enter low power mode, PWM is off.

Definition at line 66 of file pca9685_regs.h.

◆ PCA9685_MODE1_SUB1

#define PCA9685_MODE1_SUB1   (0x08)

Enable I2C subaddress 1.

Definition at line 67 of file pca9685_regs.h.

◆ PCA9685_MODE1_SUB2

#define PCA9685_MODE1_SUB2   (0x04)

Enable I2C subaddress 2.

Definition at line 68 of file pca9685_regs.h.

◆ PCA9685_MODE1_SUB3

#define PCA9685_MODE1_SUB3   (0x02)

Enable I2C subaddress 3.

Definition at line 69 of file pca9685_regs.h.

◆ PCA9685_MODE2_INVERT

#define PCA9685_MODE2_INVERT   (0x10)

Invert outputs.

Definition at line 73 of file pca9685_regs.h.

◆ PCA9685_MODE2_OCH

#define PCA9685_MODE2_OCH   (0x08)

Output change change configuration.

Definition at line 74 of file pca9685_regs.h.

◆ PCA9685_MODE2_OUTDRV

#define PCA9685_MODE2_OUTDRV   (0x04)

Output driver configuration.

Definition at line 75 of file pca9685_regs.h.

◆ PCA9685_MODE2_OUTNE

#define PCA9685_MODE2_OUTNE   (0x03)

Output enabled configuration.

Definition at line 76 of file pca9685_regs.h.

◆ PCA9685_REG_ALL_LED_OFF

#define PCA9685_REG_ALL_LED_OFF   (0xfc)

Load all LEDn_OFF register word.

Definition at line 43 of file pca9685_regs.h.

◆ PCA9685_REG_ALL_LED_OFF_H

#define PCA9685_REG_ALL_LED_OFF_H   (0xfd)

Load all LEDn_OFF register high byte.

Definition at line 40 of file pca9685_regs.h.

◆ PCA9685_REG_ALL_LED_OFF_L

#define PCA9685_REG_ALL_LED_OFF_L   (0xfc)

Load all LEDn_OFF register low byte.

Definition at line 39 of file pca9685_regs.h.

◆ PCA9685_REG_ALL_LED_ON

#define PCA9685_REG_ALL_LED_ON   (0xfa)

Load all LEDn_OFF register word.

Definition at line 42 of file pca9685_regs.h.

◆ PCA9685_REG_ALL_LED_ON_H

#define PCA9685_REG_ALL_LED_ON_H   (0xfb)

Load all LEDn_OFF register high byte.

Definition at line 38 of file pca9685_regs.h.

◆ PCA9685_REG_ALL_LED_ON_L

#define PCA9685_REG_ALL_LED_ON_L   (0xfa)

Load all LEDn_OFF register low byte.

Definition at line 37 of file pca9685_regs.h.

◆ PCA9685_REG_ALLCALLADDR

#define PCA9685_REG_ALLCALLADDR   (0x05)

LED All Call I 2 C-bus address.

Definition at line 34 of file pca9685_regs.h.

◆ PCA9685_REG_LED0_ON_L

#define PCA9685_REG_LED0_ON_L   (0x06)

LED0 ON control low byte.

Definition at line 35 of file pca9685_regs.h.

◆ PCA9685_REG_LED_OFF

#define PCA9685_REG_LED_OFF (   n)    (0x08 + (n << 2))

LEDn OFF control word.

Definition at line 49 of file pca9685_regs.h.

◆ PCA9685_REG_LED_OFF_H

#define PCA9685_REG_LED_OFF_H (   n)    (0x09 + (n << 2))

LEDn OFF control high byte.

Definition at line 54 of file pca9685_regs.h.

◆ PCA9685_REG_LED_OFF_L

#define PCA9685_REG_LED_OFF_L (   n)    (0x08 + (n << 2))

LEDn OFF control low byte.

Definition at line 53 of file pca9685_regs.h.

◆ PCA9685_REG_LED_ON

#define PCA9685_REG_LED_ON (   n)    (0x06 + (n << 2))

LEDn ON control word.

Definition at line 48 of file pca9685_regs.h.

◆ PCA9685_REG_LED_ON_H

#define PCA9685_REG_LED_ON_H (   n)    (0x07 + (n << 2))

LEDn ON control high byte.

Definition at line 52 of file pca9685_regs.h.

◆ PCA9685_REG_LED_ON_L

#define PCA9685_REG_LED_ON_L (   n)    (0x06 + (n << 2))

LEDn ON control low byte.

Definition at line 51 of file pca9685_regs.h.

◆ PCA9685_REG_MODE1

#define PCA9685_REG_MODE1   (0x00)

Mode1 register.

Definition at line 29 of file pca9685_regs.h.

◆ PCA9685_REG_MODE2

#define PCA9685_REG_MODE2   (0x01)

Mode2 register.

Definition at line 30 of file pca9685_regs.h.

◆ PCA9685_REG_PRE_SCALE

#define PCA9685_REG_PRE_SCALE   (0xfe)

Prescaler for PWM output frequency.

Definition at line 45 of file pca9685_regs.h.

◆ PCA9685_REG_SUBADR1

#define PCA9685_REG_SUBADR1   (0x02)

I2C bus subaddress 1 register.

Definition at line 31 of file pca9685_regs.h.

◆ PCA9685_REG_SUBADR2

#define PCA9685_REG_SUBADR2   (0x03)

I2C bus subaddress 2 register.

Definition at line 32 of file pca9685_regs.h.

◆ PCA9685_REG_SUBADR3

#define PCA9685_REG_SUBADR3   (0x04)

I2C bus subaddress 3 register.

Definition at line 33 of file pca9685_regs.h.

◆ PCA9685_REG_TEST_MODE

#define PCA9685_REG_TEST_MODE   (0xff)

Enter test mode register.

Definition at line 46 of file pca9685_regs.h.