AvrIO  1.4.5
Bibliothèque C modulaire pour ATMEL AVR
ledrgb_defs.h
1 
22 #ifndef _AVRIO_LEDRGB_DEFS_H_
23 #define _AVRIO_LEDRGB_DEFS_H_
24 #if ! defined(__DOXYGEN__)
25 
26 #include <avrio/defs.h>
27 
28 __BEGIN_C_DECLS
29 /* ========================================================================== */
30 
31 /* constants ================================================================ */
32 #define LEDRGB_CTRL_TLC59116 1
33 
34 #define TLC59116_ADDR_BASE 0xC0
35 #define TLC59116_ADDR_ALL 0xD0
36 #define TLC59116_ADDR_SUB1 0xD2
37 #define TLC59116_ADDR_SUB2 0xD4
38 #define TLC59116_ADDR_SWRST 0xD6
39 #define TLC59116_ADDR_SUB3 0xD8
40 
41 #define TLC59116_ADDR(_a3,_a2,_a1,_a0) \
42  ((TLC59116_ADDR_BASE) + ((_a3)*16)+((_a2)*8)+((_a1)*4)+((_a0)*2))
43 
44 #define TLC59116_CM 7
45 #define TLC59116_HC 6
46 #define TLC59116_CC 0x3F
47 #define TLC59116_IREF(_cm,_hc,_cc) (((_cm)<<TLC59116_CM)+((_hc)<<TLC59116_HC)+((_cc)&TLC59116_CC))
48 
49 #define TLC59116_SWRST_BYTE1 0xA5
50 #define TLC59116_SWRST_BYTE2 0x5A
51 
52 
53 __END_C_DECLS
54 /* ========================================================================== */
55 #endif /* __DOXYGEN__ not defined */
56 #endif /* _AVRIO_LEDRGB_DEFS_H_ not defined */