Linduino  1.3.0
Linear Technology Arduino-Compatible Demonstration Board
LT3965.h
Go to the documentation of this file.
1 /*!
2 LT3965 - Octal Matrix LED Bypass Switch
3 
4 @verbatim
5 
6 The LT3965 is an LED bypass switching device for dimming indiviadual LEDs in a
7 string using a common current source. It features eight individually controlled
8 floating source N-channel MOSFET switches rated for 17V/330 mΩ. The eight
9 switches can be connected in parallel and/or in series to bypass current around
10 one or more LEDs in a string. The LT3965 as a slave uses the I2C serial interface
11 to communicate with the master. Each of eight channels can be independently
12 programmed to bypass the LED string in constant on, constant off, dimming without
13 fade transition or dimming with fade transition mode.
14 
15 WRITE PROTOCOLS (MSB FIRST):
16 
17  Byte #1 Byte #2 Byte #3
18 
19 ACMODE WRITE 0 1 0 A4 A3 A2 A1 0(W) B7 B6 B5 B4 B3 B2 B1 B0
20 SCMODE WRITE SHORT 1 0 1 A4 A3 A2 A1 0(W) 0 C3 C2 C1 B3 B2 B1 B0
21 SCMODE WRITE LONG 1 0 1 A4 A3 A2 A1 0(W) 1 C3 C2 C1 B11 B10 B9 B8 B7 B6 B5 B4 B3 B2 B1 B0
22 BCMODE WRITE 0 0 0 1 1 0 0 0(W)
23 
24 W : I2C Write (0)
25 R : I2C Read (1)
26 Ax : Device Address
27 Bx : Data Bits
28 Cx : Channel Address
29 
30 
31 @endverbatim
32 
33 
34 http://www.linear.com/product/LT3965
35 
36 http://www.linear.com/product/LT3965#demoboards
37 
38 
39 Copyright 2018(c) Analog Devices, Inc.
40 
41 All rights reserved.
42 
43 Redistribution and use in source and binary forms, with or without
44 modification, are permitted provided that the following conditions are met:
45  - Redistributions of source code must retain the above copyright
46  notice, this list of conditions and the following disclaimer.
47  - Redistributions in binary form must reproduce the above copyright
48  notice, this list of conditions and the following disclaimer in
49  the documentation and/or other materials provided with the
50  distribution.
51  - Neither the name of Analog Devices, Inc. nor the names of its
52  contributors may be used to endorse or promote products derived
53  from this software without specific prior written permission.
54  - The use of this software may or may not infringe the patent rights
55  of one or more patent holders. This license does not release you
56  from the requirement that you obtain separate licenses from these
57  patent holders to use this software.
58  - Use of the software either in source or binary form, must be run
59  on or directly connected to an Analog Devices Inc. component.
60 
61 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
62 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
63 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
64 IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
65 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
66 LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
67 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
68 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
69 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
70 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
71 */
72 
73 /*! @file
74  @ingroup LT3965
75  Header for LT3965: Octal Matrix LED Bypass Switch
76 */
77 
78 //! @name LT3965 I2C 7-BIT DEVICE ADDRESS
79 //! @{
80 #define address1 0b00000000 // I2C Device address 1
81 #define address2 0b00001111 // I2C Device address 2
82 
83 #define AC_ADDR_0 0x20
84 #define SC_ADDR_0 0x50
85 #define BC_ADDR 0x0C
86 #define TM_ADDR 0x73
87 //! @}
88 
89 //! @name 8 CHANNELS
90 //! @{
91 #define CHANNEL0 0X00
92 #define CHANNEL1 0X01
93 #define CHANNEL2 0X02
94 #define CHANNEL3 0X03
95 #define CHANNEL4 0X04
96 #define CHANNEL5 0X05
97 #define CHANNEL6 0X06
98 #define CHANNEL7 0X07
99 //! @}
100 
101 #define UP 1
102 #define DOWN 0
103 
104 #define TRUE 1
105 #define FALSE 0
106 
107 #define ALERTPIN 2
108 #define PWMPIN 7
109 #define LOADPIN 9
110 #define BUTTONPIN 12
111 #define REDLED 11
112 
113 //! ACMODE Write Command to write a "value" byte to device at "address"
114 int8_t i2c_acwrite(uint8_t address, uint8_t value);
115 
116 //! ACMODE Read Command to read 3 data bytes from device at "address"
117 int8_t i2c_acread(uint8_t address, uint8_t *values);
118 
119 //! SCMODE Write Command Short Format to write a "value" byte to device at "address"
120 int8_t i2c_scwriteshort(uint8_t address, uint8_t channel, uint8_t data_SCMREG);
121 
122 //! SCMODE Write Command Long Format to write 2 "value" bytes to device at "address"
123 int8_t i2c_scwritelong(uint8_t address, uint8_t channel, uint8_t data_SCMREG, uint8_t dimming_value);
124 
125 //! SCMODE Write Short + SCMODE Read Command
126 int8_t i2c_scwriteshort_scread(uint8_t address, uint8_t channel, uint8_t data_SCMREG, uint8_t *values);
127 
128 //! BCMODE Read Command
129 int8_t i2c_bcread(uint8_t *value);
int8_t i2c_scwritelong(uint8_t address, uint8_t channel, uint8_t data_SCMREG, uint8_t dimming_value)
SCMODE Write Command Long Format to write 2 "value" bytes to device at "address". ...
Definition: LT3965.cpp:107
int8_t i2c_scwriteshort_scread(uint8_t address, uint8_t channel, uint8_t data_SCMREG, uint8_t *values)
SCMODE Write Short + SCMODE Read Command.
Definition: LT3965.cpp:121
static uint8_t channel
LTC2305 Channel selection.
Definition: DC1444A.ino:127
static uint8_t address
Definition: DC2091A.ino:83
int8_t i2c_acread(uint8_t address, uint8_t *values)
ACMODE Read Command to read 3 data bytes from device at "address".
Definition: LT3965.cpp:83
int8_t i2c_acwrite(uint8_t address, uint8_t value)
ACMODE Write Command to write a "value" byte to device at "address".
Definition: LT3965.cpp:73
int8_t i2c_scwriteshort(uint8_t address, uint8_t channel, uint8_t data_SCMREG)
SCMODE Write Command Short Format to write a "value" byte to device at "address". ...
Definition: LT3965.cpp:93
int8_t i2c_bcread(uint8_t *value)
BCMODE Read Command.
Definition: LT3965.cpp:135
static uint8_t values[4]
Definition: DC2218A.ino:117