Linduino  1.3.0
Linear Technology Arduino-Compatible Demonstration Board
LTC6946.h
Go to the documentation of this file.
1 /*!
2 LTC6946: Ultralow Noise and Spurious 0.37GHz to 6.39GHz Integer-N Synthesizer with Integrated VCO
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/LTC6946
26 
27 http://www.linear.com/product/LTC6946#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 LTC6946
66  Header for LTC6946: Ultralow Noise and Spurious 0.37GHz to 6.39GHz IntegerN Synthesizer with Integrated VCO
67 */
68 
69 #ifndef LTC6946_H
70 
71 #define LTC6946_H
72 
73 
74 //! Define the SPI CS pin
75 #ifndef LTC6946_CS
76 #define LTC6946_CS QUIKEVAL_CS //! SPI Chip Select Pin
77 #endif
78 
79 
80 /*! @name LTC6946 Registers Fields in Alphabetical Order */
81 #define LTC6946_ALCCAL 1 //!< for spi_map array, defines location for field specific information used to create the spi map
82 #define LTC6946_ALCEN 2 //!< for spi_map array, defines location for field specific information used to create the spi map
83 #define LTC6946_ALCHI 3 //!< for spi_map array, defines location for field specific information used to create the spi map
84 #define LTC6946_ALCLO 4 //!< for spi_map array, defines location for field specific information used to create the spi map
85 #define LTC6946_ALCMON 5 //!< for spi_map array, defines location for field specific information used to create the spi map
86 #define LTC6946_ALCULOK 6 //!< for spi_map array, defines location for field specific information used to create the spi map
87 #define LTC6946_BD 7 //!< for spi_map array, defines location for field specific information used to create the spi map
88 #define LTC6946_BST 8 //!< for spi_map array, defines location for field specific information used to create the spi map
89 #define LTC6946_CAL 9 //!< for spi_map array, defines location for field specific information used to create the spi map
90 #define LTC6946_CP 10 //!< for spi_map array, defines location for field specific information used to create the spi map
91 #define LTC6946_CPCHI 11 //!< for spi_map array, defines location for field specific information used to create the spi map
92 #define LTC6946_CPCLO 12 //!< for spi_map array, defines location for field specific information used to create the spi map
93 #define LTC6946_CPDN 13 //!< for spi_map array, defines location for field specific information used to create the spi map
94 #define LTC6946_CPINV 14 //!< for spi_map array, defines location for field specific information used to create the spi map
95 #define LTC6946_CPMID 15 //!< for spi_map array, defines location for field specific information used to create the spi map
96 #define LTC6946_CPRST 16 //!< for spi_map array, defines location for field specific information used to create the spi map
97 #define LTC6946_CPUP 17 //!< for spi_map array, defines location for field specific information used to create the spi map
98 #define LTC6946_CPWIDE 18 //!< for spi_map array, defines location for field specific information used to create the spi map
99 #define LTC6946_FILT 19 //!< for spi_map array, defines location for field specific information used to create the spi map
100 #define LTC6946_LKCT 20 //!< for spi_map array, defines location for field specific information used to create the spi map
101 #define LTC6946_LKEN 21 //!< for spi_map array, defines location for field specific information used to create the spi map
102 #define LTC6946_LKWIN 22 //!< for spi_map array, defines location for field specific information used to create the spi map
103 #define LTC6946_LOCK 23 //!< for spi_map array, defines location for field specific information used to create the spi map
104 #define LTC6946_MTCAL 24 //!< for spi_map array, defines location for field specific information used to create the spi map
105 #define LTC6946_ND 25 //!< for spi_map array, defines location for field specific information used to create the spi map
106 #define LTC6946_OD 26 //!< for spi_map array, defines location for field specific information used to create the spi map
107 #define LTC6946_OMUTE 27 //!< for spi_map array, defines location for field specific information used to create the spi map
108 #define LTC6946_PART 28 //!< for spi_map array, defines location for field specific information used to create the spi map
109 #define LTC6946_PDALL 29 //!< for spi_map array, defines location for field specific information used to create the spi map
110 #define LTC6946_PDOUT 30 //!< for spi_map array, defines location for field specific information used to create the spi map
111 #define LTC6946_PDPLL 31 //!< for spi_map array, defines location for field specific information used to create the spi map
112 #define LTC6946_PDREFO 32 //!< for spi_map array, defines location for field specific information used to create the spi map
113 #define LTC6946_PDVCO 33 //!< for spi_map array, defines location for field specific information used to create the spi map
114 #define LTC6946_POR 34 //!< for spi_map array, defines location for field specific information used to create the spi map
115 #define LTC6946_RD 35 //!< for spi_map array, defines location for field specific information used to create the spi map
116 #define LTC6946_REV 36 //!< for spi_map array, defines location for field specific information used to create the spi map
117 #define LTC6946_RFO 37 //!< for spi_map array, defines location for field specific information used to create the spi map
118 #define LTC6946_THI 38 //!< for spi_map array, defines location for field specific information used to create the spi map
119 #define LTC6946_TLO 39 //!< for spi_map array, defines location for field specific information used to create the spi map
120 #define LTC6946_UNLOK 40 //!< for spi_map array, defines location for field specific information used to create the spi map
121 #define LTC6946_x 41 //!< for spi_map array, defines location for field specific information used to create the spi map
122 
123 
124 #define LTC6946_NUM_REGADDR 12 //!< Defines number of LTC6946 SPI registers, used in spi_map array
125 #define LTC6946_NUM_REGFIELD 41 //!< Defines number of LTC6946 SPI fields, used in spi_map array
126 
127 #define ADDRx 0 //!< used for 2nd dim of 2d spi_map array
128 #define DxMSB 1 //!< used for 2nd dim of 2d spi_map array
129 #define NUMBITS 2 //!< used for 2nd dim of 2d spi_map array
130 #define R_ONLY 3 //!< used for 2nd dim of 2d spi_map array
131 
132 #define OneMHz 1000000L //!< 1MHz in long format, used in 64 bit math
133 
134 #define LTC6946_1_MAXFREQ 3740 //!< LTC6946-1 upper freq limit
135 #define LTC6946_2_MAXFREQ 4910 //!< LTC6946-2 upper freq limit
136 #define LTC6946_3_MAXFREQ 5790 //!< LTC6946-3 upper freq limit
137 #define LTC6946_4_MAXFREQ 6390 //!< LTC6946-4 upper freq limit
138 
139 #define LTC6946_1_MINFREQ 2240 //!< LTC6946-1 lower freq limit
140 #define LTC6946_2_MINFREQ 3080 //!< LTC6946-2 lower freq limit
141 #define LTC6946_3_MINFREQ 3840 //!< LTC6946-3 lower freq limit
142 #define LTC6946_4_MINFREQ 4200 //!< LTC6946-4 lower freq limit
143 
144 #define LTC6946_MIN_REF_FREQ 10 //!< LTC6946 lower reference frequency limit
145 #define LTC6946_MAX_REF_FREQ 250 //!< LTC6946 upper reference frequency limit
146 
147 //! @} */
148 
149 /* ------------------------------------------------------------------------- */
150 //! LTC6946 Read Single Address
151 //! reads 8 bit Data field to LTC6946.
152 //! has to shift data by one bit to account for RW bit
153 //! @return data that was read from address
154 uint8_t LTC6946_read(uint8_t cs, //!< Chip Select Pin
155  int8_t address //!< Register address for the LTC6946.
156  );
157 
158 
159 /* ------------------------------------------------------------------------- */
160 //! LTC6946 Read Single Field
161 //! For SPI FIELDS located in 1 or multiple address locations
162 //! reads specific address locations
163 //! identifies and returns specific field in question
164 //! can handle SPI fields in multiple addresses, if MSB bit is in the lower number address
165 //! @return data that was read from field
166 long LTC6946_read_field(uint8_t cs, //!< Chip Select Pin
167  uint8_t address, //!< Register address for the LTC6946.
168  uint8_t MSB_loc, //!< MSB bit location of field
169  uint8_t numbits //!< length of field (i.e. number of bits in field)
170  );
171 
172 
173 /* ------------------------------------------------------------------------- */
174 //! Gets the LTC6946 SPI field value
175 //! calls function LTC6946_read_field, which
176 //! reads specific address locations
177 //! identifies and returns specific field in question
178 //! can handle SPI fields in multiple addresses, if MSB bit is in the lower number address
179 //! @return data that was read from field
180 long get_LTC6946_SPI_FIELD(uint8_t cs, //!< Chip Select Pin
181  uint8_t f //!< SPI field number
182  );
183 
184 
185 /* ------------------------------------------------------------------------- */
186 //! LTC6946 Write Single Address
187 //! writes 8 bit Data field to LTC6946.
188 //! has to shift data by one bit to account for RW bit
189 //! @return void
190 void LTC6946_write(uint8_t cs, //!< Chip Select Pin
191  uint8_t address, //!< Register address for the LTC6946.
192  uint8_t Data //!< 8-bit data to be written to register
193  );
194 
195 
196 /* ------------------------------------------------------------------------- */
197 //! LTC6946 Write Single Field
198 //! For SPI FIELDS in 1 or multiple address locations
199 //! reads specific address/field location then writes to specific field
200 //! can handle SPI fields in multiple addresses, if MSB bit is in the lower number address
201 //! @return void
202 uint8_t LTC6946_write_field(uint8_t cs, //!< Chip Select Pin
203  long field_data, //!< Value field value to be set to
204  uint8_t address, //!< Register address for the LTC6946.
205  uint8_t MSB_loc, //!< MSB bit location of field
206  uint8_t numbits //!< length of field (i.e. number of bits in field)
207  );
208 
209 
210 /* ------------------------------------------------------------------------- */
211 //! Sets the LTC6946 SPI field value
212 //! calls function LTC6946_read_field, which
213 //! reads specific address/field location then writes to specific field
214 //! can handle SPI fields in multiple addresses, if MSB bit is in the lower number address
215 //! @return void
216 void set_LTC6946_SPI_FIELD(uint8_t cs, //!< Chip Select Pin
217  uint8_t f, //!< SPI field number
218  long field_data //!< Value field value to be set to
219  );
220 
221 
222 /* ------------------------------------------------------------------------- */
223 //! Writes values to ALL LTC6946 RW address
224 //! @return void
225 void set_LTC6946_ALLREGS(uint8_t cs, //!< Chip Select Pin
226  uint8_t reg01, //!< LTC6946 register 1
227  uint8_t reg02, //!< LTC6946 register 2
228  uint8_t reg03, //!< LTC6946 register 3
229  uint8_t reg04, //!< LTC6946 register 4
230  uint8_t reg05, //!< LTC6946 register 5
231  uint8_t reg06, //!< LTC6946 register 6
232  uint8_t reg07, //!< LTC6946 register 7
233  uint8_t reg08, //!< LTC6946 register 8
234  uint8_t reg09, //!< LTC6946 register 9
235  uint8_t reg0A //!< LTC6946 register 10
236  );
237 
238 /* ------------------------------------------------------------------------- */
239 //! Initializes the SPI MAP arrays
240 //! The values set in initialization are used all the LTC6946 SPI/WRITE and
241 //! read functions (set_LTC6946_SPI_FIELD, get_LTC6946_SPI_FIELD,
242 //! LTC6946_read, LTC6946_write, etc, etc)
243 //! @return void
244 void LTC6946_init();
245 
246 
247 /* ------------------------------------------------------------------------- */
248 //! returns # of addresses in parts register map (array size)
249 //! @return # of addresses in parts register map
250 uint8_t get_LTC6946_REGSIZE();
251 
252 
253 /* ------------------------------------------------------------------------- */
254 //! returns the number of bits for a given field name in the SPI map
255 //! @return the number of bits for a given field name in the SPI map
256 uint8_t get_LTC6946_SPI_FIELD_NUMBITS(uint8_t f //!< SPI field number
257  );
258 
259 
260 /* ------------------------------------------------------------------------- */
261 //! returns if the given field name is (0)read/write or (1)read_only field
262 //! @return if the given field is a (0)read/write or (1)read_only field
263 uint8_t get_LTC6946_SPI_FIELD_RW(uint8_t f //!< SPI field number
264  ) ;
265 
266 
267 /* ------------------------------------------------------------------------- */
268 //! calculates the output divider setting based on the frf and version of LTC6946
269 //! @return odiv = 1-6 divider setting for valid frequency, or 999 for invalid frequency
270 unsigned long LTC6946_calc_odiv(char part_version[], //!< LTC6946 part number LTC6946-x
271  unsigned long frf[2] //!< output frequency
272  );
273 
274 /* ------------------------------------------------------------------------- */
275 //! FUNCTION: LTC6946_set_frf
276 //! Calculates the integer (N), fractional (NUM) and output divider (OD) SPI values
277 //! using self created 64bit math functions.
278 //!
279 //! Datasheet equations:
280 //! - fvco = fpfd*(N + F)
281 //! - frf = fvco/O
282 //! - fpfd = fref/R
283 //!
284 //! can be modified to the following equations:
285 //! - N = (int) (fvco/fpfd) = (int) frf*O*R/fref
286 //!
287 //! where:
288 //! - N = ndiv, O= odiv in the code below
289 //!
290 //! Linduino One (Arduino Uno) is limited to 32 bit floats/double/long.
291 //! 32 bit math functions will create rounding errors with the above equations,
292 //! that can result in frequency errors.
293 //! Therefore, the following code uses self created 64bit functions for 64bit integer math.
294 //!
295 //! - frf (33 bits) LTC6946-4 max frf/fvco = 6.4GHZ, which is 33 bit number (2^33 = 8.59G)
296 //! - fref (23 bits) LTC6946 min fref = 10MHz, which is a 23 bit number (2^23 = 8.3M)
297 //! - O (3 bits)
298 //! - R (10 bits)
299 //!
300 //! step 1: create 64 bit frf and fref numbers
301 //!
302 //! step 2: calculate O (output divider)
303 //!
304 //! step 3: get current R-divider setting
305 //!
306 //! step 4: calculate frf*O*R
307 //! max bit count/resolution: 33b+3b+10b= 46b
308 //!
309 //! step 5: calculate N(16b), using value from step 1
310 //! - N = (int) frf*O*R/fref
311 //! - max bit count/resolution: 46b-23b = 23b
312 //! @return void
313 void LTC6946_set_frf(char part_version[] //!< LTC6946 part number LTC6946-x
314  );
315 
316 
317 /* ------------------------------------------------------------------------- */
318 //! sets globals LTC6946_Fref_MHz and LTC6946_Fref_Hz
319 //! @return void
320 void set_LTC6946_global_fref(unsigned long fref_MHz, unsigned long fref_Hz);
321 
322 
323 /* ------------------------------------------------------------------------- */
324 //! sets globals LTC6946_Frf_MHz and LTC6946_Frf_Hz
325 //! @return void
326 void set_LTC6946_global_frf(unsigned long frf_MHz, unsigned long frf_Hz);
327 
328 
329 /* ------------------------------------------------------------------------- */
330 //! returns global LTC6946_Fref_MHz
331 //! @return LTC6946_Fref_MHz
332 unsigned long get_LTC6946_global_fref_MHz();
333 
334 
335 /* ------------------------------------------------------------------------- */
336 //! returns global LTC6946_Fref_Hz
337 //! @return LTC6946_Fref_Hz
338 unsigned long get_LTC6946_global_fref_Hz();
339 
340 
341 /* ------------------------------------------------------------------------- */
342 //! returns global LTC6946_Frf_MHz
343 //! @return LTC6946_Frf_MHz
344 unsigned long get_LTC6946_global_frf_MHz();
345 
346 
347 /* ------------------------------------------------------------------------- */
348 //! returns global LTC6946_Frf_Hz
349 //! @return LTC6946_Frf_Hz
350 unsigned long get_LTC6946_global_frf_Hz();
351 
352 
353 /* ------------------------------------------------------------------------- */
354 //! create a 64 bit Hz number from
355 //! 32 bit xxxx MHz number and 32 bit yyy yyy Hz number.
356 //! A) if an < 2^32 bits:
357 //! - an(upper 32b) = 0;
358 //! - an(lower 32b) = MHzPart(32b)*1MHz + HzPart (32b)
359 //!
360 //! B) if an > 2^32 bits (4,294,967,296):
361 //! - an(upper 32b) = 1
362 //! - an(lower 32b) = ((MHzPart-4294)*1MHz+HzPart)-967296
363 //! @return void
364 void HZto64(unsigned long an[], //!< 64 bit number, 1x2 32 bit array
365  unsigned long MHzPart, //!< integer in MHZ
366  unsigned long HzPart //!< integer in Hz
367  );
368 
369 
370 /* ------------------------------------------------------------------------- */
371 //! Creates a equivalent 64 bit number from 2 32 bit numbers
372 //! - an[0]=bigPart //upper 32 bits
373 //! - an[1]=littlePart //lower 32 bits
374 //! @return void
375 void init64(unsigned long an[], //!< 64 bit number, 1x2 32 bit array
376  unsigned long bigPart, //!< upper 32 bits
377  unsigned long littlePart //!< lower 32 bits
378  );
379 
380 /* ------------------------------------------------------------------------- */
381 //! Single Bit shift left of equivalent 64 bit number (an[] = an[]<<1)
382 //! @return void
383 void shl64(unsigned long an[] //!< an[] = an[]<<1
384  );
385 
386 /* ------------------------------------------------------------------------- */
387 //! Multi Bit shift left of equivalent 64 bit number (an[] = an[]<<shiftnum)
388 //! @return void
389 void shl64by(unsigned long an[], //!< an[] = an[]<<shiftnum
390  uint8_t shiftnum //!< number of bits to shift left
391  );
392 
393 /* ------------------------------------------------------------------------- */
394 //! Single Bit shift right of equivalent 64 bit number (an[] = an[]<<1)
395 //! @return void
396 void shr64(unsigned long an[] //!< an[] = an[]>>shiftnum
397  );
398 
399 /* ------------------------------------------------------------------------- */
400 //! Multi Bit shift right of equivalent 64 bit number (an[] = an[]>>shiftnum)
401 //! @return void
402 void shr64by(unsigned long an[], //!< an[] = an[]>>shiftnum
403  uint8_t shiftnum //!< number of bits to shift right
404  );
405 
406 /* ------------------------------------------------------------------------- */
407 //! 64 bit Add ann to an (an[] = an[] + ann[])
408 //! @return void
409 void add64(unsigned long an[], //!< 64 bit number, in 1x2 32bit array
410  unsigned long ann[] //!< 64 bit number, in 1x2 32bit array
411  );
412 
413 /* ------------------------------------------------------------------------- */
414 //! 64 bit Subtract ann from an (an[] = an[] - ann[])
415 //! @return void
416 void sub64(unsigned long an[], //!< 64 bit number, in 1x2 32bit array
417  unsigned long ann[] //!< 64 bit number, in 1x2 32bit array
418  );
419 
420 /* ------------------------------------------------------------------------- */
421 //! 64 bit, if an == ann, then true
422 //! @return true, if an==ann; false, if an<>ann
423 boolean eq64(unsigned long an[], //!< 64 bit number, in 1x2 32bit array
424  unsigned long ann[] //!< 64 bit number, in 1x2 32bit array
425  );
426 
427 /* ------------------------------------------------------------------------- */
428 //! 64 bit, if an < ann, then true
429 //! @return true, if an<ann; false, if an=>ann
430 boolean lt64(unsigned long an[], //!< 64 bit number, in 1x2 32bit array
431  unsigned long ann[] //!< 64 bit number, in 1x2 32bit array
432  );
433 
434 /* ------------------------------------------------------------------------- */
435 //! 64 bit Divide, num=num/div
436 //! @return void
437 void div64(unsigned long num[], //!< numerator: 64 bit number, in 1x2 32bit array
438  unsigned long den[] //!< denominator: 64 bit number, in 1x2 32bit array
439  );
440 
441 
442 /* ------------------------------------------------------------------------- */
443 //! 64 bit multiply, an=an*ann
444 //! @return void
445 void mul64(unsigned long an[], //!< 64 bit number, in 1x2 32bit array
446  unsigned long ann[] //!< 64 bit number, in 1x2 32bit array
447  );
448 
449 /* ------------------------------------------------------------------------- */
450 //! Prints HEX representation of 64 bit an
451 //! @return void
452 void prt(unsigned long an[] //!< 64 bit number, in 1x2 32bit array
453  );
454 
455 #endif // LTC6946_H
uint8_t LTC6946_read(uint8_t cs, int8_t address)
LTC6946 Read Single Address reads 8 bit Data field to LTC6946.
Definition: LTC6946.cpp:98
void set_LTC6946_global_fref(unsigned long fref_MHz, unsigned long fref_Hz)
sets globals LTC6946_Fref_MHz and LTC6946_Fref_Hz
Definition: LTC6946.cpp:472
uint8_t get_LTC6946_SPI_FIELD_NUMBITS(uint8_t f)
returns the number of bits for a given field name in the SPI map
Definition: LTC6946.cpp:242
void sub64(unsigned long an[], unsigned long ann[])
64 bit Subtract ann from an (an[] = an[] - ann[])
Definition: LTC6945.cpp:823
void set_LTC6946_global_frf(unsigned long frf_MHz, unsigned long frf_Hz)
sets globals LTC6946_Frf_MHz and LTC6946_Frf_Hz
Definition: LTC6946.cpp:478
long LTC6946_read_field(uint8_t cs, uint8_t address, uint8_t MSB_loc, uint8_t numbits)
LTC6946 Read Single Field For SPI FIELDS located in 1 or multiple address locations reads specific ad...
Definition: LTC6946.cpp:118
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
void add64(unsigned long an[], unsigned long ann[])
64 bit Add ann to an (an[] = an[] + ann[])
Definition: LTC6945.cpp:810
void set_LTC6946_SPI_FIELD(uint8_t cs, uint8_t f, long field_data)
Sets the LTC6946 SPI field value calls function LTC6946_read_field, which reads specific address/fiel...
Definition: LTC6946.cpp:265
void LTC6946_init()
Initializes the SPI MAP arrays The values set in initialization are used all the LTC6946 SPI/WRITE an...
Definition: LTC6946.cpp:299
static uint8_t address
Definition: DC2091A.ino:83
unsigned long get_LTC6946_global_fref_Hz()
returns global LTC6946_Fref_Hz
Definition: LTC6946.cpp:489
unsigned long get_LTC6946_global_fref_MHz()
returns global LTC6946_Fref_MHz
Definition: LTC6946.cpp:484
void mul64(unsigned long an[], unsigned long ann[])
64 bit multiply, an=an*ann
Definition: LTC6945.cpp:906
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 set_LTC6946_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 LTC6946 RW address.
Definition: LTC6946.cpp:275
void LTC6946_write(uint8_t cs, uint8_t address, uint8_t Data)
LTC6946 Write Single Address writes 8 bit Data field to LTC6946.
Definition: LTC6946.cpp:165
uint8_t LTC6946_write_field(uint8_t cs, long field_data, uint8_t address, uint8_t MSB_loc, uint8_t numbits)
LTC6946 Write Single Field For SPI FIELDS in 1 or multiple address locations reads specific address/f...
Definition: LTC6946.cpp:181
boolean lt64(unsigned long an[], unsigned long ann[])
64 bit, if an < ann, then true
Definition: LTC6945.cpp:848
void shl64by(unsigned long an[], uint8_t shiftnum)
Multi Bit shift left of equivalent 64 bit number (an[] = an[]<<shiftnum)
Definition: LTC6945.cpp:774
boolean eq64(unsigned long an[], unsigned long ann[])
64 bit, if an == ann, then true
Definition: LTC6945.cpp:838
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 shl64(unsigned long an[])
Single Bit shift left of equivalent 64 bit number (an[] = an[]<<1)
Definition: LTC6945.cpp:748
void prt(unsigned long an[])
Prints HEX representation of 64 bit an.
Definition: LTC6945.cpp:698
unsigned long get_LTC6946_global_frf_Hz()
returns global LTC6946_Frf_Hz
Definition: LTC6946.cpp:499
void shr64(unsigned long an[])
Single Bit shift right of equivalent 64 bit number (an[] = an[]<<1)
Definition: LTC6945.cpp:761
long get_LTC6946_SPI_FIELD(uint8_t cs, uint8_t f)
Gets the LTC6946 SPI field value calls function LTC6946_read_field, which reads specific address loca...
Definition: LTC6946.cpp:154
unsigned long get_LTC6946_global_frf_MHz()
returns global LTC6946_Frf_MHz
Definition: LTC6946.cpp:494
uint8_t get_LTC6946_REGSIZE()
returns # of addresses in parts register map (array size)
Definition: LTC6946.cpp:232
void div64(unsigned long num[], unsigned long den[])
64 bit Divide, num=num/div
Definition: LTC6945.cpp:859
uint8_t get_LTC6946_SPI_FIELD_RW(uint8_t f)
returns if the given field name is (0)read/write or (1)read_only field
Definition: LTC6946.cpp:252
void LTC6946_set_frf(char part_version[])
FUNCTION: LTC6946_set_frf Calculates the integer (N), fractional (NUM) and output divider (OD) SPI va...
Definition: LTC6946.cpp:609
unsigned long LTC6946_calc_odiv(char part_version[], unsigned long frf[2])
calculates the output divider setting based on the frf and version of LTC6946
Definition: LTC6946.cpp:510