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
* Copyright (C) 2018 Gunar Schorcht
3
*
4
* This file is subject to the terms and conditions of the GNU Lesser
5
* General Public License v2.1. See the file LICENSE in the top level
6
* directory for more details.
7
*/
8
17
#ifndef PCA9685_REGS_H
18
#define PCA9685_REGS_H
19
20
#ifdef __cplusplus
21
extern
"C"
22
{
23
#endif
24
29
#define PCA9685_REG_MODE1 (0x00)
30
#define PCA9685_REG_MODE2 (0x01)
31
#define PCA9685_REG_SUBADR1 (0x02)
32
#define PCA9685_REG_SUBADR2 (0x03)
33
#define PCA9685_REG_SUBADR3 (0x04)
34
#define PCA9685_REG_ALLCALLADDR (0x05)
35
#define PCA9685_REG_LED0_ON_L (0x06)
37
#define PCA9685_REG_ALL_LED_ON_L (0xfa)
38
#define PCA9685_REG_ALL_LED_ON_H (0xfb)
39
#define PCA9685_REG_ALL_LED_OFF_L (0xfc)
40
#define PCA9685_REG_ALL_LED_OFF_H (0xfd)
42
#define PCA9685_REG_ALL_LED_ON (0xfa)
43
#define PCA9685_REG_ALL_LED_OFF (0xfc)
45
#define PCA9685_REG_PRE_SCALE (0xfe)
46
#define PCA9685_REG_TEST_MODE (0xff)
48
#define PCA9685_REG_LED_ON(n) (0x06 + (n << 2))
49
#define PCA9685_REG_LED_OFF(n) (0x08 + (n << 2))
51
#define PCA9685_REG_LED_ON_L(n) (0x06 + (n << 2))
52
#define PCA9685_REG_LED_ON_H(n) (0x07 + (n << 2))
53
#define PCA9685_REG_LED_OFF_L(n) (0x08 + (n << 2))
54
#define PCA9685_REG_LED_OFF_H(n) (0x09 + (n << 2))
62
/* PCA9685_REG_MODE1 */
63
#define PCA9685_MODE1_RESTART (0x80)
64
#define PCA9685_MODE1_EXTCLK (0x40)
65
#define PCA9685_MODE1_AI (0x20)
66
#define PCA9685_MODE1_SLEEP (0x10)
67
#define PCA9685_MODE1_SUB1 (0x08)
68
#define PCA9685_MODE1_SUB2 (0x04)
69
#define PCA9685_MODE1_SUB3 (0x02)
70
#define PCA9685_MODE1_ALLCALL (0x01)
72
/* PCA9685_REG_MODE2 */
73
#define PCA9685_MODE2_INVERT (0x10)
74
#define PCA9685_MODE2_OCH (0x08)
75
#define PCA9685_MODE2_OUTDRV (0x04)
76
#define PCA9685_MODE2_OUTNE (0x03)
83
#define PCA9685_LED_ON (0x1000)
/* LEDs on word */
84
#define PCA9685_LED_OFF (0x1000)
/* LEDs off word */
85
#define PCA9685_LED_ON_H (0x10)
/* LEDs on high byte */
86
#define PCA9685_LED_OFF_H (0x10)
/* LEDs off high byte */
87
#define PCA9685_ALL_LED_ON (0x1000)
/* All LEDs on word */
88
#define PCA9685_ALL_LED_OFF (0x1000)
/* All LEDs off word */
89
#define PCA9685_ALL_LED_ON_H (0x10)
/* All LEDs on high byte */
90
#define PCA9685_ALL_LED_OFF_H (0x10)
/* All LEDs off word */
93
#ifdef __cplusplus
94
}
95
#endif
96
97
#endif
/* PCA9685_REGS_H */
Generated on Sat Dec 21 2024 20:58:03 by
1.9.8