pca9633_regs.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Freie Universität Berlin
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 PCA9633_REGS_H
18 #define PCA9633_REGS_H
19 
20 #include "bitarithm.h"
21 
22 #ifdef __cplusplus
23 extern "C"
24 {
25 #endif
26 
27 /* Register definitions (page 11, table 7) */
28 
32 #define PCA9633_REG_MODE1 0x00
33 
37 #define PCA9633_REG_MODE2 0x01
38 
42 #define PCA9633_REG_PWM0 0x02
43 
47 #define PCA9633_REG_PWM1 0x03
48 
52 #define PCA9633_REG_PWM2 0x04
53 
57 #define PCA9633_REG_PWM3 0x05
58 
62 #define PCA9633_REG_GRPPWM 0x06
63 
67 #define PCA9633_REG_GRPFREQ 0x07
68 
72 #define PCA9633_REG_LEDOUT 0x08
73 
77 #define PCA9633_REG_SUBADR1 0x09
78 
82 #define PCA9633_REG_SUBADR2 0x0A
83 
87 #define PCA9633_REG_SUBADR3 0x0B
88 
92 #define PCA9633_REG_ALLCALLADR 0x0C
93 
94 
95 
96 /* Bits in REG_MODE1 (page 12, table 8) */
97 
103 #define PCA9633_BIT_AI2 BIT7
104 
108 #define PCA9633_BIT_AI1 BIT6
109 
113 #define PCA9633_BIT_AI0 BIT5
114 
119 #define PCA9633_BIT_SLEEP BIT4
120 
125 #define PCA9633_BIT_SUB1 BIT3
126 
131 #define PCA9633_BIT_SUB2 BIT2
132 
137 #define PCA9633_BIT_SUB3 BIT1
138 
143 #define PCA9633_BIT_ALLCALL BIT0
144 
145 
146 
147 /* Bits in REG_MODE2 (page 12-13, table 9) */
148 
152 #define PCA9633_BIT_DMBLNK BIT5
153 
158 #define PCA9633_BIT_INVRT BIT4
159 
164 #define PCA9633_BIT_OCH BIT3
165 
170 #define PCA9633_BIT_OUTDRV BIT2
171 
180 #define PCA9633_BITMASK_OUTNE 0x03
181 
182 
183 
184 /* Bits in REG_LEDOUT (page 14, table 13) */
185 
189 #define PCA9633_BITMASK_LDR3 0xC0
190 
194 #define PCA9633_BITMASK_LDR2 0x30
195 
199 #define PCA9633_BITMASK_LDR1 0x0C
200 
204 #define PCA9633_BITMASK_LDR0 0x03
205 
206 #ifdef __cplusplus
207 }
208 #endif
209 
210 #endif /* PCA9633_REGS_H */
211 
bitarithm.h
Helper functions for bit arithmetic.