Toggle navigation
Documentation
The friendly Operating System for the Internet of Things
Loading...
Searching...
No Matches
pca9685_regs.h
Go to the documentation of this file.
1
/*
2
* SPDX-FileCopyrightText: 2018 Gunar Schorcht
3
* SPDX-License-Identifier: LGPL-2.1-only
4
*/
5
6
#pragma once
7
15
16
#ifdef __cplusplus
17
extern
"C"
18
{
19
#endif
20
25
#define PCA9685_REG_MODE1 (0x00)
26
#define PCA9685_REG_MODE2 (0x01)
27
#define PCA9685_REG_SUBADR1 (0x02)
28
#define PCA9685_REG_SUBADR2 (0x03)
29
#define PCA9685_REG_SUBADR3 (0x04)
30
#define PCA9685_REG_ALLCALLADDR (0x05)
31
#define PCA9685_REG_LED0_ON_L (0x06)
32
33
#define PCA9685_REG_ALL_LED_ON_L (0xfa)
34
#define PCA9685_REG_ALL_LED_ON_H (0xfb)
35
#define PCA9685_REG_ALL_LED_OFF_L (0xfc)
36
#define PCA9685_REG_ALL_LED_OFF_H (0xfd)
37
38
#define PCA9685_REG_ALL_LED_ON (0xfa)
39
#define PCA9685_REG_ALL_LED_OFF (0xfc)
40
41
#define PCA9685_REG_PRE_SCALE (0xfe)
42
#define PCA9685_REG_TEST_MODE (0xff)
43
44
#define PCA9685_REG_LED_ON(n) (0x06 + (n << 2))
45
#define PCA9685_REG_LED_OFF(n) (0x08 + (n << 2))
46
47
#define PCA9685_REG_LED_ON_L(n) (0x06 + (n << 2))
48
#define PCA9685_REG_LED_ON_H(n) (0x07 + (n << 2))
49
#define PCA9685_REG_LED_OFF_L(n) (0x08 + (n << 2))
50
#define PCA9685_REG_LED_OFF_H(n) (0x09 + (n << 2))
52
57
58
/* PCA9685_REG_MODE1 */
59
#define PCA9685_MODE1_RESTART (0x80)
60
#define PCA9685_MODE1_EXTCLK (0x40)
61
#define PCA9685_MODE1_AI (0x20)
62
#define PCA9685_MODE1_SLEEP (0x10)
63
#define PCA9685_MODE1_SUB1 (0x08)
64
#define PCA9685_MODE1_SUB2 (0x04)
65
#define PCA9685_MODE1_SUB3 (0x02)
66
#define PCA9685_MODE1_ALLCALL (0x01)
67
68
/* PCA9685_REG_MODE2 */
69
#define PCA9685_MODE2_INVERT (0x10)
70
#define PCA9685_MODE2_OCH (0x08)
71
#define PCA9685_MODE2_OUTDRV (0x04)
72
#define PCA9685_MODE2_OUTNE (0x03)
74
79
#define PCA9685_LED_ON (0x1000)
/* LEDs on word */
80
#define PCA9685_LED_OFF (0x1000)
/* LEDs off word */
81
#define PCA9685_LED_ON_H (0x10)
/* LEDs on high byte */
82
#define PCA9685_LED_OFF_H (0x10)
/* LEDs off high byte */
83
#define PCA9685_ALL_LED_ON (0x1000)
/* All LEDs on word */
84
#define PCA9685_ALL_LED_OFF (0x1000)
/* All LEDs off word */
85
#define PCA9685_ALL_LED_ON_H (0x10)
/* All LEDs on high byte */
86
#define PCA9685_ALL_LED_OFF_H (0x10)
/* All LEDs off word */
88
89
#ifdef __cplusplus
90
}
91
#endif
92
Generated on Wed Apr 15 2026 03:46:10 by
1.13.2