Linduino  1.3.0
Linear Technology Arduino-Compatible Demonstration Board
LTC6953.h
Go to the documentation of this file.
1 /*!
2  LTC6953: Ultra-Low Jitter, JESD204B Clock Distributor with Eleven Programmable Outputs
3 
4 @verbatim
5  SPI DATA FORMAT (MSB First):
6 
7  Write Sequence:
8  Byte #1 Byte #2
9  MOSI: A6 A5 A4 A3 A2 A1 A0 W D7 D6 D5 D4 D3 D2 D1 D0
10  MISO: X X X X X X X X X X X X X X X X
11 
12  Read Sequence:
13  Byte #1 Byte #2
14  MOSI: A6 A5 A4 A3 A2 A1 A0 R X X X X X X X X
15  MISO: X X X X X X X X D7 D6 D5 D4 D3 D2 D1 D0
16 
17  W : SPI Write (0)
18  R : SPI Read (1)
19  Ax : Address
20  Dx : Data Bits
21  X : Don't care
22 
23 @endverbatim
24 
25 http://www.linear.com/product/LTC6953
26 
27 http://www.linear.com/product/LTC6953#demoboards
28 
29 
30 Copyright 2018(c) Analog Devices, Inc.
31 
32 All rights reserved.
33 
34 Redistribution and use in source and binary forms, with or without
35 modification, are permitted provided that the following conditions are met:
36  - Redistributions of source code must retain the above copyright
37  notice, this list of conditions and the following disclaimer.
38  - Redistributions in binary form must reproduce the above copyright
39  notice, this list of conditions and the following disclaimer in
40  the documentation and/or other materials provided with the
41  distribution.
42  - Neither the name of Analog Devices, Inc. nor the names of its
43  contributors may be used to endorse or promote products derived
44  from this software without specific prior written permission.
45  - The use of this software may or may not infringe the patent rights
46  of one or more patent holders. This license does not release you
47  from the requirement that you obtain separate licenses from these
48  patent holders to use this software.
49  - Use of the software either in source or binary form, must be run
50  on or directly connected to an Analog Devices Inc. component.
51 
52 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
53 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
54 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
55 IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
56 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
57 LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
58 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
59 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
60 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
61 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
62 */
63 
64 /*! @file
65  @ingroup LTC6953
66  Header for LTC6953: Ultra-Low Jitter, JESD204B Clock Distributor with Eleven Programmable Outputs
67 */
68 
69 #ifndef LTC6953_H
70 
71 #define LTC6953_H
72 
73 
74 //! Define the SPI CS pin
75 #ifndef LTC6953_CS
76 #define LTC6953_CS QUIKEVAL_CS //! SPI Chip Select Pin
77 #endif
78 
79 #define LTC6953_ADEL0 1 //!< for spi_map array, defines location for field specific information used to create the spi map
80 #define LTC6953_ADEL1 2 //!< for spi_map array, defines location for field specific information used to create the spi map
81 #define LTC6953_ADEL2 3 //!< for spi_map array, defines location for field specific information used to create the spi map
82 #define LTC6953_ADEL3 4 //!< for spi_map array, defines location for field specific information used to create the spi map
83 #define LTC6953_ADEL4 5 //!< for spi_map array, defines location for field specific information used to create the spi map
84 #define LTC6953_ADEL5 6 //!< for spi_map array, defines location for field specific information used to create the spi map
85 #define LTC6953_ADEL6 7 //!< for spi_map array, defines location for field specific information used to create the spi map
86 #define LTC6953_ADEL7 8 //!< for spi_map array, defines location for field specific information used to create the spi map
87 #define LTC6953_ADEL8 9 //!< for spi_map array, defines location for field specific information used to create the spi map
88 #define LTC6953_ADEL9 10 //!< for spi_map array, defines location for field specific information used to create the spi map
89 #define LTC6953_ADEL10 11 //!< for spi_map array, defines location for field specific information used to create the spi map
90 #define LTC6953_DDEL0 12 //!< for spi_map array, defines location for field specific information used to create the spi map
91 #define LTC6953_DDEL1 13 //!< for spi_map array, defines location for field specific information used to create the spi map
92 #define LTC6953_DDEL2 14 //!< for spi_map array, defines location for field specific information used to create the spi map
93 #define LTC6953_DDEL3 15 //!< for spi_map array, defines location for field specific information used to create the spi map
94 #define LTC6953_DDEL4 16 //!< for spi_map array, defines location for field specific information used to create the spi map
95 #define LTC6953_DDEL5 17 //!< for spi_map array, defines location for field specific information used to create the spi map
96 #define LTC6953_DDEL6 18 //!< for spi_map array, defines location for field specific information used to create the spi map
97 #define LTC6953_DDEL7 19 //!< for spi_map array, defines location for field specific information used to create the spi map
98 #define LTC6953_DDEL8 20 //!< for spi_map array, defines location for field specific information used to create the spi map
99 #define LTC6953_DDEL9 21 //!< for spi_map array, defines location for field specific information used to create the spi map
100 #define LTC6953_DDEL10 22 //!< for spi_map array, defines location for field specific information used to create the spi map
101 #define LTC6953_EZMD 23 //!< for spi_map array, defines location for field specific information used to create the spi map
102 #define LTC6953_FILTV 24 //!< for spi_map array, defines location for field specific information used to create the spi map
103 #define LTC6953_INVSTAT 25 //!< for spi_map array, defines location for field specific information used to create the spi map
104 #define LTC6953_MD0 26 //!< for spi_map array, defines location for field specific information used to create the spi map
105 #define LTC6953_MD1 27 //!< for spi_map array, defines location for field specific information used to create the spi map
106 #define LTC6953_MD2 28 //!< for spi_map array, defines location for field specific information used to create the spi map
107 #define LTC6953_MD3 29 //!< for spi_map array, defines location for field specific information used to create the spi map
108 #define LTC6953_MD4 30 //!< for spi_map array, defines location for field specific information used to create the spi map
109 #define LTC6953_MD5 31 //!< for spi_map array, defines location for field specific information used to create the spi map
110 #define LTC6953_MD6 32 //!< for spi_map array, defines location for field specific information used to create the spi map
111 #define LTC6953_MD7 33 //!< for spi_map array, defines location for field specific information used to create the spi map
112 #define LTC6953_MD8 34 //!< for spi_map array, defines location for field specific information used to create the spi map
113 #define LTC6953_MD9 35 //!< for spi_map array, defines location for field specific information used to create the spi map
114 #define LTC6953_MD10 36 //!< for spi_map array, defines location for field specific information used to create the spi map
115 #define LTC6953_MODE0 37 //!< for spi_map array, defines location for field specific information used to create the spi map
116 #define LTC6953_MODE1 38 //!< for spi_map array, defines location for field specific information used to create the spi map
117 #define LTC6953_MODE2 39 //!< for spi_map array, defines location for field specific information used to create the spi map
118 #define LTC6953_MODE3 40 //!< for spi_map array, defines location for field specific information used to create the spi map
119 #define LTC6953_MODE4 41 //!< for spi_map array, defines location for field specific information used to create the spi map
120 #define LTC6953_MODE5 42 //!< for spi_map array, defines location for field specific information used to create the spi map
121 #define LTC6953_MODE6 43 //!< for spi_map array, defines location for field specific information used to create the spi map
122 #define LTC6953_MODE7 44 //!< for spi_map array, defines location for field specific information used to create the spi map
123 #define LTC6953_MODE8 45 //!< for spi_map array, defines location for field specific information used to create the spi map
124 #define LTC6953_MODE9 46 //!< for spi_map array, defines location for field specific information used to create the spi map
125 #define LTC6953_MODE10 47 //!< for spi_map array, defines location for field specific information used to create the spi map
126 #define LTC6953_MP0 48 //!< for spi_map array, defines location for field specific information used to create the spi map
127 #define LTC6953_MP1 49 //!< for spi_map array, defines location for field specific information used to create the spi map
128 #define LTC6953_MP2 50 //!< for spi_map array, defines location for field specific information used to create the spi map
129 #define LTC6953_MP3 51 //!< for spi_map array, defines location for field specific information used to create the spi map
130 #define LTC6953_MP4 52 //!< for spi_map array, defines location for field specific information used to create the spi map
131 #define LTC6953_MP5 53 //!< for spi_map array, defines location for field specific information used to create the spi map
132 #define LTC6953_MP6 54 //!< for spi_map array, defines location for field specific information used to create the spi map
133 #define LTC6953_MP7 55 //!< for spi_map array, defines location for field specific information used to create the spi map
134 #define LTC6953_MP8 56 //!< for spi_map array, defines location for field specific information used to create the spi map
135 #define LTC6953_MP9 57 //!< for spi_map array, defines location for field specific information used to create the spi map
136 #define LTC6953_MP10 58 //!< for spi_map array, defines location for field specific information used to create the spi map
137 #define LTC6953_OINV0 59 //!< for spi_map array, defines location for field specific information used to create the spi map
138 #define LTC6953_OINV1 60 //!< for spi_map array, defines location for field specific information used to create the spi map
139 #define LTC6953_OINV2 61 //!< for spi_map array, defines location for field specific information used to create the spi map
140 #define LTC6953_OINV3 62 //!< for spi_map array, defines location for field specific information used to create the spi map
141 #define LTC6953_OINV4 63 //!< for spi_map array, defines location for field specific information used to create the spi map
142 #define LTC6953_OINV5 64 //!< for spi_map array, defines location for field specific information used to create the spi map
143 #define LTC6953_OINV6 65 //!< for spi_map array, defines location for field specific information used to create the spi map
144 #define LTC6953_OINV7 66 //!< for spi_map array, defines location for field specific information used to create the spi map
145 #define LTC6953_OINV8 67 //!< for spi_map array, defines location for field specific information used to create the spi map
146 #define LTC6953_OINV9 68 //!< for spi_map array, defines location for field specific information used to create the spi map
147 #define LTC6953_OINV10 69 //!< for spi_map array, defines location for field specific information used to create the spi map
148 #define LTC6953_PART 70 //!< for spi_map array, defines location for field specific information used to create the spi map
149 #define LTC6953_PDALL 71 //!< for spi_map array, defines location for field specific information used to create the spi map
150 #define LTC6953_PDVCOPK 72 //!< for spi_map array, defines location for field specific information used to create the spi map
151 #define LTC6953_PD10 73 //!< for spi_map array, defines location for field specific information used to create the spi map
152 #define LTC6953_PD9 74 //!< for spi_map array, defines location for field specific information used to create the spi map
153 #define LTC6953_PD8 75 //!< for spi_map array, defines location for field specific information used to create the spi map
154 #define LTC6953_PD7 76 //!< for spi_map array, defines location for field specific information used to create the spi map
155 #define LTC6953_PD6 77 //!< for spi_map array, defines location for field specific information used to create the spi map
156 #define LTC6953_PD5 78 //!< for spi_map array, defines location for field specific information used to create the spi map
157 #define LTC6953_PD4 79 //!< for spi_map array, defines location for field specific information used to create the spi map
158 #define LTC6953_PD3 80 //!< for spi_map array, defines location for field specific information used to create the spi map
159 #define LTC6953_PD2 81 //!< for spi_map array, defines location for field specific information used to create the spi map
160 #define LTC6953_PD1 82 //!< for spi_map array, defines location for field specific information used to create the spi map
161 #define LTC6953_PD0 83 //!< for spi_map array, defines location for field specific information used to create the spi map
162 #define LTC6953_POR 84 //!< for spi_map array, defines location for field specific information used to create the spi map
163 #define LTC6953_REV 85 //!< for spi_map array, defines location for field specific information used to create the spi map
164 #define LTC6953_SYSCT 86 //!< for spi_map array, defines location for field specific information used to create the spi map
165 #define LTC6953_SRQMD 87 //!< for spi_map array, defines location for field specific information used to create the spi map
166 #define LTC6953_SSRQ 88 //!< for spi_map array, defines location for field specific information used to create the spi map
167 #define LTC6953_SRQEN0 89 //!< for spi_map array, defines location for field specific information used to create the spi map
168 #define LTC6953_SRQEN1 90 //!< for spi_map array, defines location for field specific information used to create the spi map
169 #define LTC6953_SRQEN2 91 //!< for spi_map array, defines location for field specific information used to create the spi map
170 #define LTC6953_SRQEN3 92 //!< for spi_map array, defines location for field specific information used to create the spi map
171 #define LTC6953_SRQEN4 93 //!< for spi_map array, defines location for field specific information used to create the spi map
172 #define LTC6953_SRQEN5 94 //!< for spi_map array, defines location for field specific information used to create the spi map
173 #define LTC6953_SRQEN6 95 //!< for spi_map array, defines location for field specific information used to create the spi map
174 #define LTC6953_SRQEN7 96 //!< for spi_map array, defines location for field specific information used to create the spi map
175 #define LTC6953_SRQEN8 97 //!< for spi_map array, defines location for field specific information used to create the spi map
176 #define LTC6953_SRQEN9 98 //!< for spi_map array, defines location for field specific information used to create the spi map
177 #define LTC6953_SRQEN10 99 //!< for spi_map array, defines location for field specific information used to create the spi map
178 #define LTC6953_TEMPO 100 //!< for spi_map array, defines location for field specific information used to create the spi map
179 #define LTC6953_nVCOOK 101 //!< for spi_map array, defines location for field specific information used to create the spi map
180 #define LTC6953_VCOOK 102 //!< for spi_map array, defines location for field specific information used to create the spi map
181 #define LTC6953_x 103 //!< for spi_map array, defines location for field specific information used to create the spi map
182 
183 #define LTC6953_NUM_REGADDR 57 //!< Defines number of LTC6953 SPI registers, used in spi_map array
184 #define LTC6953_NUM_REGFIELD 103 //!< Defines number of LTC6953 SPI fields, used in spi_map array
185 
186 #define ADDRx 0 //!< used for 2nd dim of 2d spi_map array
187 #define DxMSB 1 //!< used for 2nd dim of 2d spi_map array
188 #define NUMBITS 2 //!< used for 2nd dim of 2d spi_map array
189 #define R_ONLY 3 //!< used for 2nd dim of 2d spi_map array
190 
191 //! @} */
192 
193 /* ------------------------------------------------------------------------- */
194 //! LTC6953 Read Single Address
195 //! reads 8 bit Data field to LTC6953.
196 //! has to shift data by one bit to account for RW bit
197 //! @return data that was read from address
198 uint8_t LTC6953_read(uint8_t cs, //!< Chip Select Pin
199  int8_t address //!< Register address for the LTC6953.
200  );
201 
202 
203 /* ------------------------------------------------------------------------- */
204 //! LTC6953 Read Single Field
205 //! For SPI FIELDS located in 1 or multiple address location
206 //! reads specific address locations
207 //! identifies and returns specific field in question
208 //! can handle SPI fields in multiple addresses, if MSB bit is in the lower number address
209 //! @return data that was read from field
210 long LTC6953_read_field(uint8_t cs, //!< Chip Select Pin
211  uint8_t address, //!< Register address for the LTC6953.
212  uint8_t MSB_loc, //!< MSB bit location of field
213  uint8_t numbits //!< length of field (i.e. number of bits in field)
214  );
215 
216 
217 /* ------------------------------------------------------------------------- */
218 //! Gets the LTC6953 SPI field value
219 //! calls function LTC6953_read_field, which
220 //! reads specific address locations
221 //! identifies and returns specific field in question
222 //! can handle SPI fields in multiple addresses, if MSB bit is in the lower number address
223 //! @return data that was read from field
224 long get_LTC6953_SPI_FIELD(uint8_t cs, //!< Chip Select Pin
225  uint8_t f //!< SPI field number
226  );
227 
228 
229 /* ------------------------------------------------------------------------- */
230 //! LTC6953 Write Single Address
231 //! writes 8 bit Data field to LTC6953.
232 //! has to shift data by one bit to account for RW bit
233 //! @return void
234 void LTC6953_write(uint8_t cs, //!< Chip Select Pin
235  uint8_t address, //!< Register address for the LTC6953.
236  uint8_t Data //!< 8-bit data to be written to register
237  );
238 
239 
240 /* ------------------------------------------------------------------------- */
241 //! LTC6953 Write Single Field
242 //! For SPI FIELDS in 1 or multiple address locations
243 //! reads specific address/field location then writes to specific field
244 //! can handle SPI fields in multiple addresses, if MSB bit is in the lower number address
245 //! @return void
246 uint8_t LTC6953_write_field(uint8_t cs, //!< Chip Select Pin
247  long field_data, //!< Value field value to be set to
248  uint8_t address, //!< Register address for the LTC6953.
249  uint8_t MSB_loc, //!< MSB bit location of field
250  uint8_t numbits //!< length of field (i.e. number of bits in field)
251  );
252 
253 
254 /* ------------------------------------------------------------------------- */
255 //! Sets the LTC6953 SPI field value
256 //! calls function LTC6953_read_field, which
257 //! reads specific address/field location then writes to specific field
258 //! can handle SPI fields in multiple addresses, if MSB bit is in the lower number address
259 //! @return void
260 void set_LTC6953_SPI_FIELD(uint8_t cs, //!< Chip Select Pin
261  uint8_t f, //!< SPI field number
262  long field_data //!< Value field value to be set to
263  );
264 
265 
266 /* ------------------------------------------------------------------------- */
267 //! Writes values to ALL LTC6953 RW addresses from a look-up table
268 //! - uses the Multi-byte write option for more efficient data transfer
269 //! - Either SPI Syncs or recommends the use to SYNC pin based on RAO value
270 //! @return void
271 void set_LTC6953_REGS_lkup_tbl(uint8_t lkup_tbl_row //!< Any number 0-2, lookup table has 2 options
272  );
273 
274 /* ------------------------------------------------------------------------- */
275 //! Initializes the SPI MAP arrays
276 //! The values set in initialization are used for all the LTC6953 SPI/WRITE and
277 //! read functions (set_LTC6953_SPI_FIELD, get_LTC6953_SPI_FIELD,
278 //! LTC6953_read, LTC6953_write, etc, etc)
279 //! @return void
280 void LTC6953_init();
281 
282 
283 /* ------------------------------------------------------------------------- */
284 //! returns # of addresses in parts register map (array size)
285 //! @return # of addresses in parts register map
286 uint8_t get_LTC6953_REGSIZE();
287 
288 
289 /* ------------------------------------------------------------------------- */
290 //! returns the number of bits for a given field name in the SPI map
291 //! @return the number of bits for a given field name in the SPI map
292 uint8_t get_LTC6953_SPI_FIELD_NUMBITS(uint8_t f //!< SPI field number
293  );
294 
295 
296 /* ------------------------------------------------------------------------- */
297 //! returns if the given field name is (0)read/write or (1)read_only field
298 //! @return if the given field is a (0)read/write or (1)read_only field
299 uint8_t get_LTC6953_SPI_FIELD_RW(uint8_t f //!< SPI field number
300  ) ;
301 
302 /* ------------------------------------------------------------------------- */
303 //! Read the ID string from the EEPROM and determine if any demo board is connected.
304 //! Returns 1 if successful, 0 if not successful
306  );
307 
308 #endif // LTC6953_H
long get_LTC6953_SPI_FIELD(uint8_t cs, uint8_t f)
Gets the LTC6953 SPI field value calls function LTC6953_read_field, which reads specific address loca...
Definition: LTC6953.cpp:154
uint8_t LTC6953_write_field(uint8_t cs, long field_data, uint8_t address, uint8_t MSB_loc, uint8_t numbits)
LTC6953 Write Single Field For SPI FIELDS in 1 or multiple address locations reads specific address/f...
Definition: LTC6953.cpp:191
void LTC6953_write(uint8_t cs, uint8_t address, uint8_t Data)
LTC6953 Write Single Address writes 8 bit Data field to LTC6953.
Definition: LTC6953.cpp:175
uint8_t LTC6953_read(uint8_t cs, int8_t address)
LTC6953 Read Single Address reads 8 bit Data field to LTC6953.
Definition: LTC6953.cpp:98
void set_LTC6953_REGS_lkup_tbl(uint8_t lkup_tbl_row)
Writes values to ALL LTC6953 RW addresses from a look-up table.
Definition: LTC6953.cpp:303
int8_t discover_demo_board_local(char *demo_name)
Read the ID string from the EEPROM and determine if any demo board is connected.
Definition: LTC6951.cpp:831
static uint8_t address
Definition: DC2091A.ino:83
void set_LTC6953_SPI_FIELD(uint8_t cs, uint8_t f, long field_data)
Sets the LTC6953 SPI field value calls function LTC6953_read_field, which reads specific address/fiel...
Definition: LTC6953.cpp:281
void LTC6953_init()
Initializes the SPI MAP arrays The values set in initialization are used for all the LTC6953 SPI/WRIT...
Definition: LTC6953.cpp:353
long LTC6953_read_field(uint8_t cs, uint8_t address, uint8_t MSB_loc, uint8_t numbits)
LTC6953 Read Single Field For SPI FIELDS located in 1 or multiple address location reads specific add...
Definition: LTC6953.cpp:118
uint8_t get_LTC6953_SPI_FIELD_NUMBITS(uint8_t f)
returns the number of bits for a given field name in the SPI map
Definition: LTC6953.cpp:252
uint8_t get_LTC6953_SPI_FIELD_RW(uint8_t f)
returns if the given field name is (0)read/write or (1)read_only field
Definition: LTC6953.cpp:265
char demo_name[]
Demo Board Name stored in QuikEval EEPROM.
Definition: DC1880A.ino:97
uint8_t get_LTC6953_REGSIZE()
returns # of addresses in parts register map (array size)
Definition: LTC6953.cpp:242