Linduino  1.3.0
Linear Technology Arduino-Compatible Demonstration Board
LTC6945.h
Go to the documentation of this file.
1 /*!
2  LTC6945: Ultralow Noise and Spurious 0.35GHz to 6GHz Integer-N Synthesizer
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/LTC6945
26 
27 http://www.linear.com/product/LTC6945#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 LTC6945
66  Header for LTC6945: Ultralow Noise and Spurious 0.35GHz to 6.39GHz Integer-N Synthesizer
67 */
68 
69 #ifndef LTC6945_H
70 
71 #define LTC6945_H
72 
73 
74 //! Define the SPI CS pin
75 #ifndef LTC6945_CS
76 #define LTC6945_CS QUIKEVAL_CS //! SPI Chip Select Pin
77 #endif
78 
79 
80 /*! @name LTC6945 Registers Fields in Alphabetical Order */
81 #define LTC6945_BST 1 //!< for spi_map array, defines location for field specific information used to create the spi map
82 #define LTC6945_CP 2 //!< for spi_map array, defines location for field specific information used to create the spi map
83 #define LTC6945_CPCHI 3 //!< for spi_map array, defines location for field specific information used to create the spi map
84 #define LTC6945_CPCLO 4 //!< for spi_map array, defines location for field specific information used to create the spi map
85 #define LTC6945_CPDN 5 //!< for spi_map array, defines location for field specific information used to create the spi map
86 #define LTC6945_CPINV 6 //!< for spi_map array, defines location for field specific information used to create the spi map
87 #define LTC6945_CPMID 7 //!< for spi_map array, defines location for field specific information used to create the spi map
88 #define LTC6945_CPRST 8 //!< for spi_map array, defines location for field specific information used to create the spi map
89 #define LTC6945_CPUP 9 //!< for spi_map array, defines location for field specific information used to create the spi map
90 #define LTC6945_CPWIDE 10 //!< for spi_map array, defines location for field specific information used to create the spi map
91 #define LTC6945_FILT 11 //!< for spi_map array, defines location for field specific information used to create the spi map
92 #define LTC6945_LKCT 12 //!< for spi_map array, defines location for field specific information used to create the spi map
93 #define LTC6945_LKEN 13 //!< for spi_map array, defines location for field specific information used to create the spi map
94 #define LTC6945_LKWIN 14 //!< for spi_map array, defines location for field specific information used to create the spi map
95 #define LTC6945_LOCK 15 //!< for spi_map array, defines location for field specific information used to create the spi map
96 #define LTC6945_ND 16 //!< for spi_map array, defines location for field specific information used to create the spi map
97 #define LTC6945_OD 17 //!< for spi_map array, defines location for field specific information used to create the spi map
98 #define LTC6945_OMUTE 18 //!< for spi_map array, defines location for field specific information used to create the spi map
99 #define LTC6945_PART 19 //!< for spi_map array, defines location for field specific information used to create the spi map
100 #define LTC6945_PDALL 20 //!< for spi_map array, defines location for field specific information used to create the spi map
101 #define LTC6945_PDOUT 21 //!< for spi_map array, defines location for field specific information used to create the spi map
102 #define LTC6945_PDPLL 22 //!< for spi_map array, defines location for field specific information used to create the spi map
103 #define LTC6945_PDREFO 23 //!< for spi_map array, defines location for field specific information used to create the spi map
104 #define LTC6945_POR 24 //!< for spi_map array, defines location for field specific information used to create the spi map
105 #define LTC6945_RD 25 //!< for spi_map array, defines location for field specific information used to create the spi map
106 #define LTC6945_REV 26 //!< for spi_map array, defines location for field specific information used to create the spi map
107 #define LTC6945_RFO 27 //!< for spi_map array, defines location for field specific information used to create the spi map
108 #define LTC6945_THI 28 //!< for spi_map array, defines location for field specific information used to create the spi map
109 #define LTC6945_TLO 29 //!< for spi_map array, defines location for field specific information used to create the spi map
110 #define LTC6945_UNLOCK 30 //!< for spi_map array, defines location for field specific information used to create the spi map
111 #define LTC6945_x 31 //!< for spi_map array, defines location for field specific information used to create the spi map
112 
113 #define LTC6945_NUM_REGADDR 12 //!< Defines number of LTC6945 SPI registers, used in spi_map array
114 #define LTC6945_NUM_REGFIELD 31 //!< Defines number of LTC6945 SPI fields, used in spi_map array
115 
116 #define ADDRx 0 //!< used for 2nd dim of 2d spi_map array
117 #define DxMSB 1 //!< used for 2nd dim of 2d spi_map array
118 #define NUMBITS 2 //!< used for 2nd dim of 2d spi_map array
119 #define R_ONLY 3 //!< used for 2nd dim of 2d spi_map array
120 
121 #define OneMHz 1000000L //!< 1MHz in long format, used in 64 bit math
122 
123 #define LTC6945_MINFREQ 350 //!< LTC6945 lower freq limit
124 #define LTC6945_MAXFREQ 6000 //!< LTC6945 upper freq limit
125 
126 #define LTC6945_MIN_REF_FREQ 10 //!< LTC6945 lower reference frequency limit
127 #define LTC6945_MAX_REF_FREQ 250 //!< LTC6945 upper reference frequency limit
128 
129 //! @} */
130 
131 /* ------------------------------------------------------------------------- */
132 //! LTC6945 Read Single Address
133 //! reads 8 bit Data field to LTC6945.
134 //! has to shift data by one bit to account for RW bit
135 //! @return data that was read from address
136 uint8_t LTC6945_read(uint8_t cs, //!< Chip Select Pin
137  int8_t address //!< Register address for the LTC6945.
138  );
139 
140 
141 /* ------------------------------------------------------------------------- */
142 //! LTC6945 Read Single Field
143 //! For SPI FIELDS located in 1 or multiple address location
144 //! reads specific address locations
145 //! identifies and returns specific field in question
146 //! can handle SPI fields in multiple addresses, if MSB bit is in the lower number address
147 //! @return data that was read from field
148 long LTC6945_read_field(uint8_t cs, //!< Chip Select Pin
149  uint8_t address, //!< Register address for the LTC6945.
150  uint8_t MSB_loc, //!< MSB bit location of field
151  uint8_t numbits //!< length of field (i.e. number of bits in field)
152  );
153 
154 
155 /* ------------------------------------------------------------------------- */
156 //! Gets the LTC6945 SPI field value
157 //! calls function LTC6945_read_field, which
158 //! reads specific address locations
159 //! identifies and returns specific field in question
160 //! can handle SPI fields in multiple addresses, if MSB bit is in the lower number address
161 //! @return data that was read from field
162 long get_LTC6945_SPI_FIELD(uint8_t cs, //!< Chip Select Pin
163  uint8_t f //!< SPI field number
164  );
165 
166 
167 /* ------------------------------------------------------------------------- */
168 //! LTC6945 Write Single Address
169 //! writes 8 bit Data field to LTC6945.
170 //! has to shift data by one bit to account for RW bit
171 //! @return void
172 void LTC6945_write(uint8_t cs, //!< Chip Select Pin
173  uint8_t address, //!< Register address for the LTC6945.
174  uint8_t Data //!< 8-bit data to be written to register
175  );
176 
177 
178 /* ------------------------------------------------------------------------- */
179 //! LTC6945 Write Single Field
180 //! For SPI FIELDS in 1 or multiple address locations
181 //! reads specific address/field location then writes to specific field
182 //! can handle SPI fields in multiple addresses, if MSB bit is in the lower number address
183 //! @return void
184 uint8_t LTC6945_write_field(uint8_t cs, //!< Chip Select Pin
185  long field_data, //!< Value field value to be set to
186  uint8_t address, //!< Register address for the LTC6945.
187  uint8_t MSB_loc, //!< MSB bit location of field
188  uint8_t numbits //!< length of field (i.e. number of bits in field)
189  );
190 
191 
192 /* ------------------------------------------------------------------------- */
193 //! Sets the LTC6945 SPI field value
194 //! calls function LTC6945_read_field, which
195 //! reads specific address/field location then writes to specific field
196 //! can handle SPI fields in multiple addresses, if MSB bit is in the lower number address
197 //! @return void
198 void set_LTC6945_SPI_FIELD(uint8_t cs, //!< Chip Select Pin
199  uint8_t f, //!< SPI field number
200  long field_data //!< Value field value to be set to
201  );
202 
203 
204 /* ------------------------------------------------------------------------- */
205 //! Writes values to ALL LTC6945 RW addresses
206 //! @return void
207 void set_LTC6945_ALLREGS(uint8_t cs, //!< Chip Select Pin
208  uint8_t reg01, //!< LTC6945 register 1
209  uint8_t reg02, //!< LTC6945 register 2
210  uint8_t reg03, //!< LTC6945 register 3
211  uint8_t reg04, //!< LTC6945 register 4
212  uint8_t reg05, //!< LTC6945 register 5
213  uint8_t reg06, //!< LTC6945 register 6
214  uint8_t reg07, //!< LTC6945 register 7
215  uint8_t reg08, //!< LTC6945 register 8
216  uint8_t reg09, //!< LTC6945 register 9
217  uint8_t reg0A //!< LTC6945 register 10
218  );
219 
220 /* ------------------------------------------------------------------------- */
221 //! Initializes the SPI MAP arrays
222 //! The values set in initialization are used for all the LTC6945 SPI/WRITE and
223 //! read functions (set_LTC6945_SPI_FIELD, get_LTC6945_SPI_FIELD,
224 //! LTC6945_read, LTC6945_write, etc, etc)
225 //! @return void
226 void LTC6945_init();
227 
228 
229 /* ------------------------------------------------------------------------- */
230 //! returns # of addresses in parts register map (array size)
231 //! @return # of addresses in parts register map
232 uint8_t get_LTC6945_REGSIZE();
233 
234 
235 /* ------------------------------------------------------------------------- */
236 //! returns the number of bits for a given field name in the SPI map
237 //! @return the number of bits for a given field name in the SPI map
238 uint8_t get_LTC6945_SPI_FIELD_NUMBITS(uint8_t f //!< SPI field number
239  );
240 
241 
242 /* ------------------------------------------------------------------------- */
243 //! returns if the given field name is (0)read/write or (1)read_only field
244 //! @return if the given field is a (0)read/write or (1)read_only field
245 uint8_t get_LTC6945_SPI_FIELD_RW(uint8_t f //!< SPI field number
246  ) ;
247 
248 
249 /* ------------------------------------------------------------------------- */
250 //! calculates the output divider setting based on the frf and on board
251 //! VCO frequencies of LTC6945
252 //! @return odiv = 1-6 divider setting for valid frequency, or 999 for invalid frequency
253 unsigned long LTC6945_calc_odiv(unsigned long frf[2] //!< output frequency
254  );
255 
256 /* ------------------------------------------------------------------------- */
257 //! FUNCTION: LTC6945_set_frf
258 //! Calculates the integer (N), fractional (NUM) and output divider (OD) SPI values
259 //! using self created 64bit math functions.
260 //!
261 //! Datasheet equations:
262 //! - fvco = fpfd*(N + F)
263 //! - frf = fvco/O
264 //! - fpfd = fref/R
265 //!
266 //! can be modified to the following equations:
267 //! - N = (int) (fvco/fpfd) = (int) frf*O*R/fref
268 //!
269 //! where:
270 //! - N = ndiv, O= odiv in the code below
271 //!
272 //! Linduino One (Arduino Uno) is limited to 32 bit floats/double/long.
273 //! 32 bit math functions will create rounding errors with the above equations,
274 //! that can result in frequency errors.
275 //! Therefore, the following code uses self created 64bit functions for 64bit integer math.
276 //!
277 //! - frf (33 bits) LTC6945 max frf/fvco = 6.0GHZ, which is 23 bit number (2^33 = 8.59G)
278 //! - fref (23 bits) LTC6945 min fref = 10MHz, which is a 23 bit number (2^23 = 8.3M)
279 //! - O (3 bits)
280 //! - R (10 bits)
281 //!
282 //! step 1: create 64 bit frf and fref numbers
283 //!
284 //! step 2: calculate O (output divider)
285 //!
286 //! step 3: get current R-divider setting
287 //!
288 //! step 4: calculate frf*O*R
289 //! - max bit count/resolution: 33b+3b+10b= 46b
290 //!
291 //! step 5: calculate N(16b), using value from step 1
292 //! - N = (int) frf*O*R/fref
293 //! - max bit count/resolution: 46b-23b = 13b
294 //!
295 //! @return void
296 void LTC6945_set_frf();
297 
298 
299 /* ------------------------------------------------------------------------- */
300 //! sets globals LTC6945_Fref_MHz and LTC6945_Fref_Hz
301 //! @return void
302 void set_LTC6945_global_fref(unsigned long fref_MHz, unsigned long fref_Hz);
303 
304 
305 /* ------------------------------------------------------------------------- */
306 //! sets globals LTC6945_Frf_MHz and LTC6945_Frf_Hz
307 //! @return void
308 void set_LTC6945_global_frf(unsigned long frf_MHz, unsigned long frf_Hz);
309 
310 /* ------------------------------------------------------------------------- */
311 //! sets globals LTC6945_VCO_Max_Freq_MHz, LTC6945_VCO_Max_Freq_Hz, LTC6945_VCO_Min_Freq_MHz and LTC6945_VCO_Min_Freq_Hz
312 //! @return void
313 void set_LTC6945_global_vcolim(unsigned long fvco_max_MHz, unsigned long fvco_max_Hz, unsigned long fvco_min_MHz, unsigned long fvco_min_Hz);
314 
315 
316 /* ------------------------------------------------------------------------- */
317 //! returns global LTC6945_Fref_MHz
318 //! @return LTC6945_Fref_MHz
319 unsigned long get_LTC6945_global_fref_MHz();
320 
321 
322 /* ------------------------------------------------------------------------- */
323 //! returns global LTC6945_Fref_Hz
324 //! @return LTC6945_Fref_Hz
325 unsigned long get_LTC6945_global_fref_Hz();
326 
327 
328 /* ------------------------------------------------------------------------- */
329 //! returns global LTC6945_Frf_MHz
330 //! @return LTC6945_Frf_MHz
331 unsigned long get_LTC6945_global_frf_MHz();
332 
333 
334 /* ------------------------------------------------------------------------- */
335 //! returns global LTC6945_Frf_Hz
336 //! @return LTC6945_Frf_Hz
337 unsigned long get_LTC6945_global_frf_Hz();
338 
339 
340 /* ------------------------------------------------------------------------- */
341 //! returns global LTC6945_VCO_Max_Freq_MHz
342 //! @return LTC6945_VCO_Max_Freq_MHz
343 unsigned long get_LTC6945_global_VCO_MAX_MHz();
344 
345 
346 /* ------------------------------------------------------------------------- */
347 //! returns global LTC6945_VCO_Min_Freq_MHz
348 //! @return LTC6945_VCO_Min_Freq_MHz
349 unsigned long get_LTC6945_global_VCO_MIN_MHz();
350 
351 
352 /* ------------------------------------------------------------------------- */
353 //! returns global LTC6945_VCO_Max_Freq_Hz
354 //! @return LTC6945_VCO_Max_Freq_Hz
355 unsigned long get_LTC6945_global_VCO_MAX_Hz();
356 
357 
358 /* ------------------------------------------------------------------------- */
359 //! returns global LTC6945_VCO_Min_Freq_Hz
360 //! @return LTC6945_VCO_Min_Freq_Hz
361 unsigned long get_LTC6945_global_VCO_MIN_Hz();
362 
363 
364 /* ------------------------------------------------------------------------- */
365 //! create a 64 bit Hz number from
366 //! 32 bit xxxx MHz number and 32 bit yyy yyy Hz number.
367 //! A) if an < 2^32 bits:
368 //! - an(upper 32b) = 0;
369 //! - an(lower 32b) = MHzPart(32b)*1MHz + HzPart (32b)
370 //!
371 //! B) if an > 2^32 bits (4,294,967,296):
372 //! - an(upper 32b) = 1
373 //! - an(lower 32b) = ((MHzPart-4294)*1MHz+HzPart)-967296
374 //! @return void
375 void HZto64(unsigned long an[], //!< 64 bit number, 1x2 32 bit array
376  unsigned long MHzPart, //!< integer in MHZ
377  unsigned long HzPart //!< integer in Hz
378  );
379 
380 /* ------------------------------------------------------------------------- */
381 //! Creates a equivalent 64 bit number from 2 32 bit numbers
382 //! - an[0]=bigPart upper 32 bits
383 //! - an[1]=littlePart lower 32 bits
384 //! @return void
385 void init64(unsigned long an[], //!< 64 bit number, 1x2 32 bit array
386  unsigned long bigPart, //!< upper 32 bits
387  unsigned long littlePart //!< lower 32 bits
388  );
389 
390 /* ------------------------------------------------------------------------- */
391 //! Single Bit shift left of equivalent 64 bit number (an[] = an[]<<1)
392 //! @return void
393 void shl64(unsigned long an[] //!< an[] = an[]<<1
394  );
395 
396 /* ------------------------------------------------------------------------- */
397 //! Multi Bit shift left of equivalent 64 bit number (an[] = an[]<<shiftnum)
398 //! @return void
399 void shl64by(unsigned long an[], //!< an[] = an[]<<shiftnum
400  uint8_t shiftnum //!< number of bits to shift left
401  );
402 
403 /* ------------------------------------------------------------------------- */
404 //! Single Bit shift right of equivalent 64 bit number (an[] = an[]<<1)
405 //! @return void
406 void shr64(unsigned long an[] //!< an[] = an[]>>shiftnum
407  );
408 
409 /* ------------------------------------------------------------------------- */
410 //! Multi Bit shift right of equivalent 64 bit number (an[] = an[]>>shiftnum)
411 //! @return void
412 void shr64by(unsigned long an[], //!< an[] = an[]>>shiftnum
413  uint8_t shiftnum //!< number of bits to shift right
414  );
415 
416 /* ------------------------------------------------------------------------- */
417 //! 64 bit Add ann to an (an[] = an[] + ann[])
418 //! @return void
419 void add64(unsigned long an[], //!< 64 bit number, in 1x2 32bit array
420  unsigned long ann[] //!< 64 bit number, in 1x2 32bit array
421  );
422 
423 /* ------------------------------------------------------------------------- */
424 //! 64 bit Subtract ann from an (an[] = an[] - ann[])
425 //! @return void
426 void sub64(unsigned long an[], //!< 64 bit number, in 1x2 32bit array
427  unsigned long ann[] //!< 64 bit number, in 1x2 32bit array
428  );
429 
430 /* ------------------------------------------------------------------------- */
431 //! 64 bit, if an == ann, then true
432 //! @return true, if an==ann; false, if an<>ann
433 boolean eq64(unsigned long an[], //!< 64 bit number, in 1x2 32bit array
434  unsigned long ann[] //!< 64 bit number, in 1x2 32bit array
435  );
436 
437 /* ------------------------------------------------------------------------- */
438 //! 64 bit, if an < ann, then true
439 //! @return true, if an<ann; false, if an=>ann
440 boolean lt64(unsigned long an[], //!< 64 bit number, in 1x2 32bit array
441  unsigned long ann[] //!< 64 bit number, in 1x2 32bit array
442  );
443 
444 /* ------------------------------------------------------------------------- */
445 //! 64 bit Divide, num=num/div
446 //! @return void
447 void div64(unsigned long num[], //!< numerator: 64 bit number, in 1x2 32bit array
448  unsigned long den[] //!< denominator: 64 bit number, in 1x2 32bit array
449  );
450 
451 
452 /* ------------------------------------------------------------------------- */
453 //! 64 bit multiply, an=an*ann
454 //! @return void
455 void mul64(unsigned long an[], //!< 64 bit number, in 1x2 32bit array
456  unsigned long ann[] //!< 64 bit number, in 1x2 32bit array
457  );
458 
459 /* ------------------------------------------------------------------------- */
460 //! Prints HEX representation of 64 bit an
461 //! @return void
462 void prt(unsigned long an[] //!< 64 bit number, in 1x2 32bit array
463  );
464 
465 #endif // LTC6945_H
void shl64by(unsigned long an[], uint8_t shiftnum)
Multi Bit shift left of equivalent 64 bit number (an[] = an[]<<shiftnum)
Definition: LTC6945.cpp:774
unsigned long get_LTC6945_global_frf_MHz()
returns global LTC6945_Frf_MHz
Definition: LTC6945.cpp:472
void set_LTC6945_global_frf(unsigned long frf_MHz, unsigned long frf_Hz)
sets globals LTC6945_Frf_MHz and LTC6945_Frf_Hz
Definition: LTC6945.cpp:446
void LTC6945_init()
Initializes the SPI MAP arrays The values set in initialization are used for all the LTC6945 SPI/WRIT...
Definition: LTC6945.cpp:308
unsigned long get_LTC6945_global_VCO_MIN_MHz()
returns global LTC6945_VCO_Min_Freq_MHz
Definition: LTC6945.cpp:487
long get_LTC6945_SPI_FIELD(uint8_t cs, uint8_t f)
Gets the LTC6945 SPI field value calls function LTC6945_read_field, which reads specific address loca...
Definition: LTC6945.cpp:163
unsigned long get_LTC6945_global_VCO_MAX_MHz()
returns global LTC6945_VCO_Max_Freq_MHz
Definition: LTC6945.cpp:482
void shr64(unsigned long an[])
Single Bit shift right of equivalent 64 bit number (an[] = an[]<<1)
Definition: LTC6945.cpp:761
void mul64(unsigned long an[], unsigned long ann[])
64 bit multiply, an=an*ann
Definition: LTC6945.cpp:906
void set_LTC6945_ALLREGS(uint8_t cs, uint8_t reg01, uint8_t reg02, uint8_t reg03, uint8_t reg04, uint8_t reg05, uint8_t reg06, uint8_t reg07, uint8_t reg08, uint8_t reg09, uint8_t reg0A)
Writes values to ALL LTC6945 RW addresses.
Definition: LTC6945.cpp:284
boolean lt64(unsigned long an[], unsigned long ann[])
64 bit, if an < ann, then true
Definition: LTC6945.cpp:848
void LTC6945_write(uint8_t cs, uint8_t address, uint8_t Data)
LTC6945 Write Single Address writes 8 bit Data field to LTC6945.
Definition: LTC6945.cpp:174
uint8_t get_LTC6945_SPI_FIELD_NUMBITS(uint8_t f)
returns the number of bits for a given field name in the SPI map
Definition: LTC6945.cpp:251
uint8_t LTC6945_write_field(uint8_t cs, long field_data, uint8_t address, uint8_t MSB_loc, uint8_t numbits)
LTC6945 Write Single Field For SPI FIELDS in 1 or multiple address locations reads specific address/f...
Definition: LTC6945.cpp:190
void set_LTC6945_global_vcolim(unsigned long fvco_max_MHz, unsigned long fvco_max_Hz, unsigned long fvco_min_MHz, unsigned long fvco_min_Hz)
sets globals LTC6945_VCO_Max_Freq_MHz, LTC6945_VCO_Max_Freq_Hz, LTC6945_VCO_Min_Freq_MHz and LTC6945_...
Definition: LTC6945.cpp:452
void set_LTC6945_global_fref(unsigned long fref_MHz, unsigned long fref_Hz)
sets globals LTC6945_Fref_MHz and LTC6945_Fref_Hz
Definition: LTC6945.cpp:440
void set_LTC6945_SPI_FIELD(uint8_t cs, uint8_t f, long field_data)
Sets the LTC6945 SPI field value calls function LTC6945_read_field, which reads specific address/fiel...
Definition: LTC6945.cpp:274
void shl64(unsigned long an[])
Single Bit shift left of equivalent 64 bit number (an[] = an[]<<1)
Definition: LTC6945.cpp:748
void LTC6945_set_frf()
FUNCTION: LTC6945_set_frf Calculates the integer (N), fractional (NUM) and output divider (OD) SPI va...
Definition: LTC6945.cpp:583
static uint8_t address
Definition: DC2091A.ino:83
uint8_t LTC6945_read(uint8_t cs, int8_t address)
LTC6945 Read Single Address reads 8 bit Data field to LTC6945.
Definition: LTC6945.cpp:107
void shr64by(unsigned long an[], uint8_t shiftnum)
Multi Bit shift right of equivalent 64 bit number (an[] = an[]>>shiftnum)
Definition: LTC6945.cpp:792
void prt(unsigned long an[])
Prints HEX representation of 64 bit an.
Definition: LTC6945.cpp:698
unsigned long get_LTC6945_global_VCO_MAX_Hz()
returns global LTC6945_VCO_Max_Freq_Hz
Definition: LTC6945.cpp:492
void add64(unsigned long an[], unsigned long ann[])
64 bit Add ann to an (an[] = an[] + ann[])
Definition: LTC6945.cpp:810
unsigned long get_LTC6945_global_fref_Hz()
returns global LTC6945_Fref_Hz
Definition: LTC6945.cpp:467
unsigned long get_LTC6945_global_fref_MHz()
returns global LTC6945_Fref_MHz
Definition: LTC6945.cpp:462
unsigned long get_LTC6945_global_frf_Hz()
returns global LTC6945_Frf_Hz
Definition: LTC6945.cpp:477
void init64(unsigned long an[], unsigned long bigPart, unsigned long littlePart)
Creates a equivalent 64 bit number from 2 32 bit numbers.
Definition: LTC6945.cpp:712
void div64(unsigned long num[], unsigned long den[])
64 bit Divide, num=num/div
Definition: LTC6945.cpp:859
long LTC6945_read_field(uint8_t cs, uint8_t address, uint8_t MSB_loc, uint8_t numbits)
LTC6945 Read Single Field For SPI FIELDS located in 1 or multiple address location reads specific add...
Definition: LTC6945.cpp:127
unsigned long LTC6945_calc_odiv(unsigned long frf[2])
calculates the output divider setting based on the frf and on board VCO frequencies of LTC6945 ...
Definition: LTC6945.cpp:508
void sub64(unsigned long an[], unsigned long ann[])
64 bit Subtract ann from an (an[] = an[] - ann[])
Definition: LTC6945.cpp:823
uint8_t get_LTC6945_SPI_FIELD_RW(uint8_t f)
returns if the given field name is (0)read/write or (1)read_only field
Definition: LTC6945.cpp:261
uint8_t get_LTC6945_REGSIZE()
returns # of addresses in parts register map (array size)
Definition: LTC6945.cpp:241
unsigned long get_LTC6945_global_VCO_MIN_Hz()
returns global LTC6945_VCO_Min_Freq_Hz
Definition: LTC6945.cpp:497
boolean eq64(unsigned long an[], unsigned long ann[])
64 bit, if an == ann, then true
Definition: LTC6945.cpp:838
void HZto64(unsigned long an[], unsigned long MHzPart, unsigned long HzPart)
create a 64 bit Hz number from 32 bit xxxx MHz number and 32 bit yyy yyy Hz number.
Definition: LTC6945.cpp:729