Linduino  1.3.0
Linear Technology Arduino-Compatible Demonstration Board
LTC6950.cpp
Go to the documentation of this file.
1 /*!
2  LTC6950: 1.4GHz Low Phase Noise, Low Jitter PLL with Clock Distribution
3 
4 @verbatim
5 
6 The LTC®6950 is a low phase noise integer-N frequency
7 synthesizer core with clock distribution. The LTC6950
8 delivers the low phase noise clock signals demanded in
9 high frequency, high resolution data acquisition systems.
10 
11 The frequency synthesizer contains a full low noise PLL core
12 with a programmable reference divider (R), a programmable
13 feedback divider (N), a phase/frequency detector (PFD)
14 and a low noise charge pump (CP). The clock distribution
15 section of the LTC6950 delivers up to five outputs based on
16 the VCO input. Each output is individually programmed to
17 divide the VCO input frequency by any integer from 1 to 63
18 and to delay the output by 0 to 63 VCO clock cycles. Four
19 of the outputs feature very low noise, low skew LVPECL
20 logic signals capable of operation up to 1.4GHz. The fifth
21 output is selectable as either an LVDS (800MHz) or CMOS
22 (250MHz) logic type. This output is also programmed to
23 produce an output signal based on either the VCO input
24 or the reference divider output.
25 
26 @endverbatim
27 
28 
29 http://www.linear.com/product/LTC6950
30 
31 http://www.linear.com/product/LTC6950#demoboards
32 
33 
34 Copyright 2018(c) Analog Devices, Inc.
35 
36 All rights reserved.
37 
38 Redistribution and use in source and binary forms, with or without
39 modification, are permitted provided that the following conditions are met:
40  - Redistributions of source code must retain the above copyright
41  notice, this list of conditions and the following disclaimer.
42  - Redistributions in binary form must reproduce the above copyright
43  notice, this list of conditions and the following disclaimer in
44  the documentation and/or other materials provided with the
45  distribution.
46  - Neither the name of Analog Devices, Inc. nor the names of its
47  contributors may be used to endorse or promote products derived
48  from this software without specific prior written permission.
49  - The use of this software may or may not infringe the patent rights
50  of one or more patent holders. This license does not release you
51  from the requirement that you obtain separate licenses from these
52  patent holders to use this software.
53  - Use of the software either in source or binary form, must be run
54  on or directly connected to an Analog Devices Inc. component.
55 
56 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
57 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
58 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
59 IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
60 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
61 LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
62 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
63 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
64 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
65 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
66 */
67 
68 //! @ingroup RF_Timing
69 //! @{
70 //! @defgroup LTC6950 LTC6950: 1.4GHz Low Phase Noise, Low Jitter PLL with Clock Distribution
71 //! @}
72 
73 /*! @file
74  @ingroup LTC6950
75  Library for LTC6950: 1.4GHz Low Phase Noise, Low Jitter PLL with Clock Distribution
76 */
77 
78 #include <stdint.h>
79 #include <Arduino.h>
80 #include "Linduino.h"
81 #include "UserInterface.h"
82 #include "LT_SPI.h"
83 #include "LTC6950.h"
84 #include <SPI.h>
85 
86 uint8_t LTC6950_reg[LTC6950_NUM_REGADDR]; //!< number of LTC6950 spi addresses
87 uint8_t LTC6950_spi_map[(LTC6950_NUM_REGFIELD+1)][4]; //!< LTC6950 spi map, stores MSB address location, MSB bit location, field length in bits, and R or RW capability
88 
89 unsigned long LTC6950_Fref_MHz = 100; //!< Default Fref frequency - MHz portion (xxx); Fref = xxx, yyy,yyy
90 unsigned long LTC6950_Fref_Hz = 0; //!< Default Fref frequency - Hz portion (yyy,yyy); Fref = x,xxx, yyy,yyy
91 unsigned long LTC6950_Frf_MHz = 250; //!< Default Frf frequency - MHz portion (xxxx); Frf = x,xxx, yyy,yyy
92 unsigned long LTC6950_Frf_Hz = 0; //!< Default Frf frequency - Hz portion (yyy,yyy); Frf = x,xxx, yyy,yyy
93 unsigned long LTC6950_VCO_Max_Freq_MHz = 1002; //!< Max Vco frequency for default on board VCO - MHz portion (xxxx); Fvco max = xxx, yyy,yyy
94 unsigned long LTC6950_VCO_Min_Freq_MHz = 998; //!< Min Vco frequency for default on board VCO - MHz portion (xxxx); Fvco min = x,xxx, yyy,yyy
95 unsigned long LTC6950_VCO_Max_Freq_Hz = 0; //!< Max Vco frequency for default on board VCO - Hz portion (yyy,yyy); Fvco max = x,xxx, yyy,yyy
96 unsigned long LTC6950_VCO_Min_Freq_Hz = 0; //!< Min Vco frequency for default on board VCO - Hz portion (yyy,yyy); Fvco min= x,xxx, yyy,yyy
97 
98 unsigned long zero64[]= {0,0}; //!< for 64bit math functions
99 
100 /* -------------------------------------------------------------------------
101  FUNCTION: LTC6950_read
102  - reads 8 bit Data field to LTC6950.
103  - has to shift data by one bit to account for RW bit
104  -------------------------------------------------------------------------- */
105 uint8_t LTC6950_read(uint8_t cs, int8_t address)
106 {
107  int8_t address_shift;
109 
110  address_shift =(address << 1) | 0x01; // shift to left to account for R/W bit, set bit high for read
111  spi_transfer_word(cs, address_shift<<8 , &rx.LT_uint16);
112 
113  LTC6950_reg[address]=rx.LT_byte[0];
114  return(rx.LT_byte[0]);
115 }
116 
117 
118 /* -------------------------------------------------------------------------
119  FUNCTION: LTC6950_read_field
120  For SPI FIELDS located in 1 or multiple address location
121  - reads specific address locations
122  - identifies and returns specific field in question
123  - can handle SPI fields in multiple addresses, if MSB bit is in the lower number address
124 --------------------------------------------------------------------------- */
125 long LTC6950_read_field(uint8_t cs, uint8_t address, uint8_t MSB_loc, uint8_t numbits)
126 {
127  int bit_shift, i, num_reg;
128  long field_val, maskbits, pow2;
129 
130  num_reg=0;
131  field_val=0;
132 // determines how many register are used
133  do
134  {
135  bit_shift = (MSB_loc+1)- (numbits-num_reg*8); // determines bit_shift for last register location
136  field_val=LTC6950_read(cs, (address+num_reg))+(field_val<<8); // reads current address locations, shifts previous address location 8 bits
137  num_reg++;
138  }
139  while ((bit_shift<0) && (num_reg<4));
140 
141 // creates a bit mask for complete word,
142  maskbits = 1;
143  pow2=1;
144  for (i=1, maskbits=1; i<numbits; i++)
145  {
146  pow2=pow2*2;
147  maskbits = maskbits+pow2;
148  }
149 
150  field_val=(field_val >>bit_shift) &maskbits;
151  return field_val;
152 }
153 
154 /* -------------------------------------------------------------------------
155  FUNCTION: get_LTC6950_SPI_FIELD
156  For SPI FIELDS
157  - reads specific address locations
158  - identifies and returns specific field in question
159  - can handle SPI fields in multiple addresses, if MSB bit is in the lower number address
160 --------------------------------------------------------------------------- */
161 long get_LTC6950_SPI_FIELD(uint8_t cs, uint8_t f)
162 {
163 
165 }
166 
167 /* -------------------------------------------------------------------------
168  FUNCTION: LTC6950_write
169  - writes 8 bit Data field to LTC6950.
170  - has to shift data by one bit to account for RW bit
171 --------------------------------------------------------------------------- */
172 void LTC6950_write(uint8_t cs, uint8_t address, uint8_t Data)
173 {
175 
176  address=address << 1; // shift to left to account for R/W bit
177  spi_transfer_word(cs, (address<<8) | Data, &rx.LT_uint16);
178 }
179 
180 
181 /* -------------------------------------------------------------------------
182  FUNCTION: LTC6950_write_field
183  For SPI FIELDS
184  - reads specific address location
185  - identifies and returns specific field in question
186  - can handle SPI fields in multiple addresses, if MSB bit is in the lower number address
187 ---------------------------------------------------------------------------- */
188 uint8_t LTC6950_write_field(uint8_t cs, long field_data, uint8_t address, uint8_t MSB_loc, uint8_t numbits)
189 {
190  long current_content, desired_content, reg_val;
191  int LSB_loc, i, j, num_reg, bit_shift;
192  long temp_arr[32];
193 
194  for (i=0; i<32 ; i++) temp_arr[i]=0; // init temp_arr
195 
196 // read data in current address location and put in a bit array
197  num_reg=0;
198  current_content=0;
199  do
200  {
201  bit_shift=(MSB_loc+1)-(numbits-num_reg*8);
202  current_content=LTC6950_read(cs, (address+num_reg)) + (current_content<<8);
203 
204  num_reg++;
205  }
206  while ((bit_shift<0) && (num_reg<4));
207  for (i=0; i<(8*num_reg); i++)
208  {
209  temp_arr[i]=(current_content>>i) & 1;
210  }
211 
212 // exchange current bits with desired bits
213  LSB_loc = 8*(num_reg-1)+MSB_loc-numbits+1;
214  for (i=LSB_loc, j=0; i<=(MSB_loc+(num_reg-1)*8); i++, j++)
215  {
216  temp_arr[i] = (field_data>>j) &1;
217  } // end of for loop
218 
219 // reconstruct bits into an integer
220  desired_content = 0;
221  for (i=0; i<(8*num_reg); i++)
222  {
223  desired_content = desired_content | (temp_arr[i]<<i);
224  } // end of for loop
225 
226 // write new field value to part
227  for (i=0; i<num_reg; i++)
228  {
229  reg_val = (desired_content >> 8*(num_reg-1-i)) & 0xff;
230  LTC6950_write(cs, (address+i), reg_val);
231  } // end of for loop
232 } // end of LTC6950_write_field
233 
234 
235 /* -------------------------------------------------------------------------
236  FUNCTION: get_LTC6950_REGSIZE
237  - returns # of addresses in parts register map (array size)
238 ---------------------------------------------------------------------------- */
240 {
241  return sizeof(LTC6950_reg);
242 }
243 
244 
245 /* -------------------------------------------------------------------------
246  FUNCTION: get_LTC6950_SPI_FIELD_NUMBITS
247  - returns the number of bits for a given field name in the SPI map
248 ---------------------------------------------------------------------------- */
250 {
251  return LTC6950_spi_map[f][NUMBITS];
252 }
253 
254 
255 /* -------------------------------------------------------------------------
256  FUNCTION: get_LTC6950_SPI_FIELD_RW
257  - returns if the given field name is (0)read/write or (1)read_only field
258 ---------------------------------------------------------------------------- */
259 uint8_t get_LTC6950_SPI_FIELD_RW(uint8_t f)
260 {
261  return LTC6950_spi_map[f][R_ONLY];
262 }
263 
264 
265 /* -------------------------------------------------------------------------
266  FUNCTION: set_LTC6950_SPI_FIELD
267  For SPI FIELDS
268  - reads specific address location
269  - identifies and returns specific field in question
270  - can handle SPI fields in multiple addresses, if MSB bit is in the lower number address
271 ---------------------------------------------------------------------------- */
272 void set_LTC6950_SPI_FIELD(uint8_t cs, uint8_t f, long field_data)
273 {
275 }
276 
277 
278 /* -------------------------------------------------------------------------
279  FUNCTION: set_LTC6950_ALLREGS
280  - writes data to all registers at once
281 --------------------------------------------------------------------------- */
282 void set_LTC6950_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,
283  uint8_t reg08, uint8_t reg09, uint8_t reg0A, uint8_t reg0B, uint8_t reg0C, uint8_t reg0D, uint8_t reg0E, uint8_t reg0F,
284  uint8_t reg10, uint8_t reg11, uint8_t reg12, uint8_t reg13, uint8_t reg14, uint8_t reg15)
285 {
286  uint8_t i;
287 
288  LTC6950_reg[1] = reg01;
289  LTC6950_reg[2] = reg02;
290  LTC6950_reg[3] = reg03;
291  LTC6950_reg[4] = reg04;
292  LTC6950_reg[5] = reg05;
293  LTC6950_reg[6] = reg06;
294  LTC6950_reg[7] = reg07;
295  LTC6950_reg[8] = reg08;
296  LTC6950_reg[9] = reg09;
297  LTC6950_reg[10] = reg0A;
298  LTC6950_reg[11] = reg0B;
299  LTC6950_reg[12] = reg0C;
300  LTC6950_reg[13] = reg0D;
301  LTC6950_reg[14] = reg0E;
302  LTC6950_reg[15] = reg0F;
303  LTC6950_reg[16] = reg10;
304  LTC6950_reg[17] = reg11;
305  LTC6950_reg[18] = reg12;
306  LTC6950_reg[19] = reg13;
307  LTC6950_reg[20] = reg14;
308  LTC6950_reg[21] = reg15;
309 
310  for (i=1; i<22; i++) LTC6950_write(cs, i, LTC6950_reg[i]);
311 } // end of set_LTC6950_ALLREGS
312 
313 
314 /* -------------------------------------------------------------------------
315  FUNCTION: LTC6950_init
316  - initializes the SPI MAP
317  - for ease of programming there is spreadsheet that automates this some.
318 ----------------------------------------------------------------------------*/
320 {
321 
322 // spi map
542 
543 
617 } // end of LTC6950_init
618 
619 void set_LTC6950_global_fref(unsigned long fref_MHz, unsigned long fref_Hz)
620 {
621  LTC6950_Fref_MHz=fref_MHz;
622  LTC6950_Fref_Hz=fref_Hz;
623 }
624 
625 void set_LTC6950_global_frf(unsigned long frf_MHz, unsigned long frf_Hz)
626 {
627  LTC6950_Frf_MHz=frf_MHz;
628  LTC6950_Frf_Hz=frf_Hz;
629 }
630 
631 void set_LTC6950_global_vcolim(unsigned long fvco_max_MHz, unsigned long fvco_max_Hz, unsigned long fvco_min_MHz, unsigned long fvco_min_Hz)
632 {
633  LTC6950_VCO_Max_Freq_MHz=fvco_max_MHz;
634  LTC6950_VCO_Max_Freq_Hz=fvco_max_Hz;
635  LTC6950_VCO_Min_Freq_MHz=fvco_min_MHz;
636  LTC6950_VCO_Min_Freq_Hz=fvco_min_Hz;
637 }
638 
639 
640 
642 {
643  return LTC6950_Fref_MHz;
644 }
645 
647 {
648  return LTC6950_Fref_Hz;
649 }
650 
652 {
653  return LTC6950_Frf_MHz;
654 }
655 
657 {
658  return LTC6950_Frf_Hz;
659 }
660 
662 {
664 }
665 
667 {
669 }
670 
672 {
674 }
675 
677 {
679 }
680 
681 /* -------------------------------------------------------------------------
682  FUNCTION: calc_odiv
683  - calculates the output divider setting based on the frf and on board
684  VCO frequencies of LTC6950
685  - @return odiv = 1-63 for valid setting, 999 as invalid odiv
686 ---------------------------------------------------------------------------- */
687 unsigned long LTC6950_calc_odiv(unsigned long frf[2])
688 {
689  unsigned long odiv, i;
690  unsigned long max_fout64[2];
691  unsigned long min_fout64[2];
692  unsigned long temp_fout[2];
693  unsigned long temp_i[2];
694  boolean valid_input=false;
695 
696 
699 
700 // verify desired frequency falls within a divider range (1-6)
701  valid_input=false;
702  for (i=1; i<=63; i++)
703  {
704  init64(temp_i,0L,i);
705  temp_fout[0] = frf[0];
706  temp_fout[1] = frf[1];
707  mul64(temp_fout,temp_i);
708  if (lt64(temp_fout,max_fout64) || eq64(temp_fout, max_fout64)) // same as frf*i <= max_fout
709  {
710  if (lt64(min_fout64,temp_fout) || eq64(temp_fout, min_fout64)) // same as frf*i >= min_fout
711  {
712  valid_input=true;
713  odiv=i;
714  }
715  }
716  } // end of for loop
717 
718  if (valid_input == false) odiv= 999L;
719  return odiv;
720 
721 } // end of LTC6950_calc_odiv
722 
723 /* -------------------------------------------------------------------------
724  FUNCTION: LTC6950_set_frf
725  Calculates the integer (N) and output divider (OD) SPI values
726  using self created 64bit math functions. For Out0 only. Use menu 3 to set dividers to
727  achieve desired frequencies on other outputs.
728 
729  Datasheet equations
730  - fvco = fpfd*(N + F)
731  - frf = fvco/O
732  - fpfd = fref/R
733 
734  can be modified to the following equations
735  - N = (int) (fvco/fpfd) = (int) frf*O*R/fref
736 
737  where
738  - N = ndiv, O= M0div in the code below
739 
740  Linduino One (Arduino Uno) is limited to 32 bit floats/double/long.
741  32 bit math functions will create rounding errors with the above equations,
742  tha can result in frequency errors.
743  Therefore, the following code uses self created 64bit functions for 64bit integer math.
744 
745  - frf (33 bits) LTC6950 max frf/fvco = 1.4GHZ, which is 23 bit number (2^31 = 2.147G)
746  - fref (23 bits) LTC6950 min fref = 2MHz, which is a 20 bit number (2^20 = 1.05M)
747  - O (6 bits)
748  - R (10 bits)
749 
750  step 1: create 64 bit frf and fref numbers
751 
752  step 2: calculate O (output divider)
753 
754  step 3: get current R-divider setting
755 
756  step 4: calculate frf*O*R
757  - max bit count/resolution: 31b+6b+10b= 47b
758 
759  step 5: calculate N(11b), using value from step 1
760  - N = (int) frf*O*R/fref
761  - max bit count/resolution: 47b-20b = 27b
762 
763  step 6: find N for closest frequency - accounts for rounding with integer math
764  - 64b-47b=17b (using 16b instead of 17b)
765 ---------------------------------------------------------------------------- */
767 {
768  unsigned long frf_MHz, frf_Hz, fref_MHz, fref_Hz, M0div, rdiv, ndiv, N_remainder;
769  unsigned long N64[2], R64[2], MO64[2], temp_long[2];
770  char buffer[100];
771  unsigned long frf[2], frf_act[2];
772  unsigned long fref[2];
773  unsigned long temp_math[2];
774  unsigned long frf_rdiv_M0div[2];
775  unsigned long frf_rdiv_M0div_int[2];
776  unsigned long roundup[2];
777 
778  /* step 1: create 64 bit frf and fref numbers
779  32 bit xxxx MHz number and 32 bit yyy yyy Hz number. */
780  frf_MHz=LTC6950_Frf_MHz;
781  frf_Hz=LTC6950_Frf_Hz;
782  HZto64(frf, frf_MHz, frf_Hz);
783 
784  fref_MHz=LTC6950_Fref_MHz;
785  fref_Hz=LTC6950_Fref_Hz;
786  HZto64(fref,fref_MHz,fref_Hz);
787 
788 // step 2: calculate O (output divider)
789  M0div=LTC6950_calc_odiv(frf);
790 
791 // step 3: get current R-divider setting
792  rdiv=get_LTC6950_SPI_FIELD(LTC6950_CS,LTC6950_R); // reads selected field
793 
794 // step 3: calculate frf*O*R
795  frf_rdiv_M0div[0]=0;
796  frf_rdiv_M0div[1]=M0div*rdiv;
797  mul64(frf_rdiv_M0div, frf); // odiv*rdiv*frf
798  frf_rdiv_M0div_int[0]=frf_rdiv_M0div[0]; // copy odiv*rdiv*frf to another variable
799  frf_rdiv_M0div_int[1]=frf_rdiv_M0div[1];
800 
801 // step 4: calculate N(10b), using value from step 3; N = (int) frf*O*R/fref
802  temp_math[0]=fref[0]; // copy fref to temp variable for math operation
803  temp_math[1]=fref[1];
804  div64(frf_rdiv_M0div_int, temp_math); // frf_rdiv_odiv_int= [(frf*odiv*rdiv)]/fref --> int(fvco/fpfd)
805  ndiv=frf_rdiv_M0div_int[1];
806 
807 // step 6: find N for closest frequency - accounts for rounding with integer math
808 // 64b-47b=17b (use 16b)
809  temp_math[0]=fref[0]; // copy fref to temp variable for math operation
810  temp_math[1]=fref[1];
811  shl64by(frf_rdiv_M0div,16); // frf_rdiv_M0div --> [(frf*M0div*rdiv)<<16]/fref = N(double) <<16
812  div64(frf_rdiv_M0div,temp_math);
813  shl64by(frf_rdiv_M0div_int,16); // frf_rdiv_M0div_int --> [(int)((frf*M0div*rdiv)/fref)] <<13 = N(int) <<16
814  sub64(frf_rdiv_M0div,frf_rdiv_M0div_int); // N(double) <<16 - N(int)<<16
815 
816 // at this point frf_rdiv_Modiv is the delta between N(double) and N(int) shifted by 16 bits.
817 // if this remainder is < 32768, N(int) will give the closest frequency
818 // if this remainder is >=32768, N(int)+1 will give the closest frequency
819 // 32768 is mid point of the 16 bit number range
820  N_remainder = (frf_rdiv_M0div[1] & 65535L); // 16 bits max code = 65535
821  if (N_remainder >= 32768)
822  {
823  ndiv=ndiv+1;
824  }
825 
826 // program part and print out results to screen
827  set_LTC6950_SPI_FIELD(LTC6950_CS,LTC6950_M0,M0div); // programs output divider - OUT0
828  Serial.print("M0 = ");
829  Serial.println(M0div);
830 
831  Serial.print("RD = ");
832  Serial.println(rdiv);
833 
834  set_LTC6950_SPI_FIELD(LTC6950_CS,LTC6950_N,ndiv); // programs N-divider
835  Serial.print(F("ND = "));
836  Serial.println(ndiv);
837 
838 
839 
840 ///// calculate actual fout here and print out
841  frf_act[0]=fref[0];
842  frf_act[1]=fref[1];
843  N64[0]=0;
844  R64[0]=0;
845  MO64[0]=0;
846  N64[1]=ndiv;
847  R64[1]=rdiv;
848  MO64[1]=M0div;
849 
850  mul64(frf_act,N64); // N*fref
851  div64(frf_act,R64); // N*fref/rdiv (or N*fpfd)
852  div64(frf_act,MO64); // (N*fpdf)/odiv
853  if (frf_act[0]==0) // no 32 bit overflow case
854  {
855  Serial.print(F("Actual Output Frequency (closest available) is "));
856  Serial.print(frf_act[1]);
857  Serial.println("Hz");
858  }
859  else // overflow case
860  {
861  temp_math[0]=frf_act[0];
862  temp_math[1]=frf_act[1];
863  temp_long[0]=0;
864  temp_long[1]=OneMHz;
865  div64(temp_math,temp_long); // frf/1e6
866  Serial.print(F("Actual Output Frequency (closest available) is "));
867  Serial.print(temp_math[1]);
868  Serial.print("MHz + ");
869  temp_long[0]=0;
870  temp_long[1]=OneMHz;
871  mul64(temp_math,temp_long); // int(frf/1e6)*1e6
872  sub64(frf_act,temp_math); // frf-int(frf/1e6)*1e6
873  Serial.print(frf_act[1]);
874  Serial.println("Hz");
875  }
876 }
877 
878 
879 /* -------------------------------------------------------------------------
880  FUNCTION: prt
881  Prints HEX representation of 64 bit an
882 ---------------------------------------------------------------------------- */
883 void prt(unsigned long an[])
884 {
885  Serial.print(an[0],HEX);
886  Serial.print(" ");
887  Serial.println(an[1],HEX);
888 }
889 
890 
891 /* -------------------------------------------------------------------------
892  FUNCTION: init64
893  Creates a equivalent 64 bit number from 2 32 bit numbers
894  an[0]=bigPart //upper 32 bits
895  an[1]=littlePart //lower 32 bits
896 ---------------------------------------------------------------------------- */
897 void init64(unsigned long an[], unsigned long bigPart, unsigned long littlePart )
898 {
899  an[0]=bigPart;
900  an[1]=littlePart;
901 }
902 
903 /* -------------------------------------------------------------------------
904  FUNCTION: HZto64
905  create a 64 bit Hz number from
906  32 bit xxxx MHz number and 32 bit yyy yyy Hz number.
907  A) if an < 2^32 bits
908  an(upper 32b) = 0
909  an(lower 32b) = MHzPart(32b)*1MHz + HzPart (32b)
910  B) if an > 2^32 bits (4,294,967,296)
911  an(upper 32b) = 1
912  an(lower 32b) = ((MHzPart-4294)*1MHz+HzPart)-967296
913 ---------------------------------------------------------------------------- */
914 void HZto64(unsigned long an[], unsigned long MHzPart, unsigned long HzPart )
915 {
916 
917  if ((MHzPart>4295) || ((MHzPart==4294) && (HzPart>=967296)))
918  {
919  an[0]=1L; // upper 32 bits
920  an[1] =(MHzPart-4294L)*OneMHz + HzPart-967296L; // lower 32 bits
921  }
922  else
923  {
924  an[0] = 0; // upper 32 bits
925  an[1] = MHzPart*OneMHz+HzPart; // lower 32 bits
926  }
927 }
928 
929 /* -------------------------------------------------------------------------
930  FUNCTION: shl64
931  Single Bit shift left of equivalent 64 bit number (an[] = an[]<<1)
932 ---------------------------------------------------------------------------- */
933 void shl64(unsigned long an[])
934 {
935  an[0] <<= 1;
936  if (an[1] & 0x80000000)
937  an[0]++;
938  an[1] <<= 1;
939 }
940 
941 
942 /* -------------------------------------------------------------------------
943  FUNCTION: shr64
944  Single Bit shift right of equivalent 64 bit number (an[] = an[]>>1)
945 ---------------------------------------------------------------------------- */
946 void shr64(unsigned long an[])
947 {
948  an[1] >>= 1;
949  if (an[0] & 0x1)
950  an[1]+=0x80000000;
951  an[0] >>= 1;
952 }
953 
954 
955 /* -------------------------------------------------------------------------
956  FUNCTION: shl64by
957  Multi Bit shift left of equivalent 64 bit number (an[] = an[]<<shiftnum)
958 ---------------------------------------------------------------------------- */
959 void shl64by(unsigned long an[], uint8_t shiftnum)
960 {
961  uint8_t i;
962 
963  for (i=0; i<shiftnum; i++)
964  {
965  an[0] <<= 1;
966  if (an[1] & 0x80000000)
967  an[0]++;
968  an[1] <<= 1;
969  }
970 }
971 
972 
973 /* -------------------------------------------------------------------------
974  FUNCTION: shr64by
975  Multi Bit shift right of equivalent 64 bit number (an[] = an[]>>shiftnum)
976 ---------------------------------------------------------------------------- */
977 void shr64by(unsigned long an[], uint8_t shiftnum)
978 {
979  uint8_t i;
980 
981  for (i=0; i<shiftnum; i++)
982  {
983  an[1] >>= 1;
984  if (an[0] & 0x1)
985  an[1]+=0x80000000;
986  an[0] >>= 1;
987  }
988 }
989 
990 
991 /* -------------------------------------------------------------------------
992  FUNCTION: add64
993  64 bit Add ann to an (an[] = an[] + ann[])
994 ---------------------------------------------------------------------------- */
995 void add64(unsigned long an[], unsigned long ann[])
996 {
997  an[0]+=ann[0];
998  if (an[1] + ann[1] < ann[1])
999  an[0]++;
1000  an[1]+=ann[1];
1001 }
1002 
1003 
1004 /* -------------------------------------------------------------------------
1005  FUNCTION: sub64
1006  64 bit Subtract ann from an (an[] = an[] - ann[])
1007 ---------------------------------------------------------------------------- */
1008 void sub64(unsigned long an[], unsigned long ann[])
1009 {
1010  an[0]-=ann[0];
1011  if (an[1] < ann[1])
1012  {
1013  an[0]--;
1014  }
1015  an[1]-= ann[1];
1016 }
1017 
1018 
1019 /* -------------------------------------------------------------------------
1020  FUNCTION: eq64
1021  64 bit, if an == ann, then true
1022 ---------------------------------------------------------------------------- */
1023 boolean eq64(unsigned long an[], unsigned long ann[])
1024 {
1025  return (an[0]==ann[0]) && (an[1]==ann[1]);
1026 }
1027 
1028 
1029 /* -------------------------------------------------------------------------
1030  FUNCTION: lt64
1031  64 bit, if an < ann, then true
1032 ---------------------------------------------------------------------------- */
1033 boolean lt64(unsigned long an[], unsigned long ann[])
1034 {
1035  if (an[0]>ann[0]) return false;
1036  return (an[0]<ann[0]) || (an[1]<ann[1]);
1037 }
1038 
1039 
1040 /* -------------------------------------------------------------------------
1041  FUNCTION: div64
1042  64 bit Divide, num=num/div
1043 ---------------------------------------------------------------------------- */
1044 void div64(unsigned long num[], unsigned long den[])
1045 {
1046  unsigned long quot[2];
1047  unsigned long qbit[2];
1048  unsigned long tmp[2];
1049  init64(quot,0,0);
1050  init64(qbit,0,1);
1051 
1052  if (eq64(num, zero64)) //numerator 0, call it 0
1053  {
1054  init64(num,0,0);
1055  return;
1056  }
1057 
1058  if (eq64(den, zero64)) //numerator not zero, denominator 0, infinity in my book.
1059  {
1060  init64(num,0xffffffff,0xffffffff);
1061  return;
1062  }
1063 
1064  init64(tmp,0x80000000,0);
1065  while (lt64(den,tmp))
1066  {
1067  shl64(den);
1068  shl64(qbit);
1069  }
1070 
1071  while (!eq64(qbit,zero64))
1072  {
1073  if (lt64(den,num) || eq64(den,num))
1074  {
1075  sub64(num,den);
1076  add64(quot,qbit);
1077  }
1078  shr64(den);
1079  shr64(qbit);
1080  }
1081 
1082  //remainder now in num, but using it to return quotient for now
1083  init64(num,quot[0],quot[1]);
1084 }
1085 
1086 
1087 /* -------------------------------------------------------------------------
1088  FUNCTION: mul64
1089  64 bit multiply, an=an*ann
1090 ---------------------------------------------------------------------------- */
1091 void mul64(unsigned long an[], unsigned long ann[])
1092 {
1093  unsigned long p[2] = {0,0};
1094  unsigned long y[2] = {ann[0], ann[1]};
1095  while (!eq64(y,zero64))
1096  {
1097  if (y[1] & 1)
1098  add64(p,an);
1099  shl64(an);
1100  shr64(y);
1101  }
1102  init64(an,p[0],p[1]);
1103 }
#define LTC6950_RES6950
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:139
#define LTC6950_CPWIDE
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:90
unsigned long get_LTC6950_global_frf_MHz()
returns global LTC6950_Frf_MHz
Definition: LTC6950.cpp:651
#define LTC6950_DEL4
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:95
uint8_t get_LTC6950_SPI_FIELD_NUMBITS(uint8_t f)
returns the number of bits for a given field name in the SPI map
Definition: LTC6950.cpp:249
#define LTC6950_N
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:119
#define LTC6950_NO_REF
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:120
#define LTC6950_M3
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:117
#define LTC6950_PD_OUT2
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:131
#define LTC6950_RESET_N
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:141
#define LTC6950_PD_OUT1
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:130
#define LTC6950_FLDRV2
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:100
#define LTC6950_RESET_R
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:140
#define LTC6950_CS
Define the SPI CS pin.
Definition: LTC6950.h:76
#define LTC6950_LKCT
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:109
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: LTC6950.cpp:914
unsigned long LTC6950_calc_odiv(unsigned long frf[2])
calculates the output divider setting based on the frf and on board VCO frequencies of LTC6950 ...
Definition: LTC6950.cpp:687
#define LTC6950_CPCLO
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:84
#define LTC6950_SYNC_EN4
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:150
#define LTC6950_IBIAS2
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:105
boolean lt64(unsigned long an[], unsigned long ann[])
64 bit, if an < ann, then true
Definition: LTC6950.cpp:1033
#define LTC6950_SYNC_EN0
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:146
Header File for Linduino Libraries and Demo Code.
#define LTC6950_PDALL
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:123
void LTC6950_set_frf()
FUNCTION: LTC6950_set_frf Calculates the integer (N) and output divider (OD) SPI values using self cr...
Definition: LTC6950.cpp:766
#define LTC6950_SYNCMD
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:145
#define LTC6950_CPCHI
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:83
void add64(unsigned long an[], unsigned long ann[])
64 bit Add ann to an (an[] = an[] + ann[])
Definition: LTC6950.cpp:995
#define LTC6950_PDREFAC
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:135
void sub64(unsigned long an[], unsigned long ann[])
64 bit Subtract ann from an (an[] = an[] - ann[])
Definition: LTC6950.cpp:1008
void set_LTC6950_global_frf(unsigned long frf_MHz, unsigned long frf_Hz)
sets globals LTC6950_Frf_MHz and LTC6950_Frf_Hz
Definition: LTC6950.cpp:625
#define OneMHz
1MHz in long format, used in 64 bit math
Definition: LTC6945.h:121
unsigned long LTC6950_Fref_MHz
Default Fref frequency - MHz portion (xxx); Fref = xxx, yyy,yyy.
Definition: LTC6950.cpp:89
#define LTC6950_TLO
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:152
#define LTC6950_INV_ST2
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:108
#define LTC6950_FILTV
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:97
void shr64by(unsigned long an[], uint8_t shiftnum)
Multi Bit shift right of equivalent 64 bit number (an[] = an[]>>shiftnum)
Definition: LTC6950.cpp:977
#define LTC6950_PDPLL
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:134
#define LTC6950_PDVCOAC
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:136
#define LTC6950_PD_DIV3
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:127
#define LTC6950_R
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:137
#define LTC6950_M1
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:115
unsigned long get_LTC6950_global_frf_Hz()
returns global LTC6950_Frf_Hz
Definition: LTC6950.cpp:656
#define LTC6950_SYNC_EN3
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:149
#define LTC6950_LKEN
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:110
#define LTC6950_LKWIN
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:111
#define NUMBITS
Definition: LTC6115.h:69
static uint8_t address
Definition: DC2091A.ino:83
unsigned long LTC6950_Frf_MHz
Default Frf frequency - MHz portion (xxxx); Frf = x,xxx, yyy,yyy.
Definition: LTC6950.cpp:91
void mul64(unsigned long an[], unsigned long ann[])
64 bit multiply, an=an*ann
Definition: LTC6950.cpp:1091
void shl64(unsigned long an[])
Single Bit shift left of equivalent 64 bit number (an[] = an[]<<1)
Definition: LTC6950.cpp:933
#define LTC6950_UNLOCK
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:153
#define LTC6950_SYNC_EN1
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:147
#define LTC6950_DEL0
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:91
unsigned long LTC6950_VCO_Min_Freq_Hz
Min Vco frequency for default on board VCO - Hz portion (yyy,yyy); Fvco min= x,xxx, yyy,yyy.
Definition: LTC6950.cpp:96
#define LTC6950_CPUP
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:89
long get_LTC6950_SPI_FIELD(uint8_t cs, uint8_t f)
Gets the LTC6950 SPI field value calls function LTC6950_read_field, which reads specific address loca...
Definition: LTC6950.cpp:161
void shl64by(unsigned long an[], uint8_t shiftnum)
Multi Bit shift left of equivalent 64 bit number (an[] = an[]<<shiftnum)
Definition: LTC6950.cpp:959
LTC6950: 1.4GHz Low Phase Noise, Low Jitter PLL with Clock Distribution.
void set_LTC6950_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, uint8_t reg0B, uint8_t reg0C, uint8_t reg0D, uint8_t reg0E, uint8_t reg0F, uint8_t reg10, uint8_t reg11, uint8_t reg12, uint8_t reg13, uint8_t reg14, uint8_t reg15)
Writes values to ALL LTC6950 RW addresses.
Definition: LTC6950.cpp:282
void div64(unsigned long num[], unsigned long den[])
64 bit Divide, num=num/div
Definition: LTC6950.cpp:1044
uint16_t LT_uint16
16-bit unsigned integer to be converted to two bytes
Definition: Linduino.h:102
void set_LTC6950_global_fref(unsigned long fref_MHz, unsigned long fref_Hz)
sets globals LTC6950_Fref_MHz and LTC6950_Fref_Hz
Definition: LTC6950.cpp:619
boolean eq64(unsigned long an[], unsigned long ann[])
64 bit, if an == ann, then true
Definition: LTC6950.cpp:1023
#define R_ONLY
used for 2nd dim of 2d spi_map array
Definition: LTC6945.h:119
void spi_transfer_word(uint8_t cs_pin, uint16_t tx, uint16_t *rx)
Reads and sends a word.
Definition: LT_SPI.cpp:98
#define LTC6950_M0
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:114
uint8_t LTC6950_spi_map[(LTC6950_NUM_REGFIELD+1)][4]
LTC6950 spi map, stores MSB address location, MSB bit location, field length in bits, and R or RW capability.
Definition: LTC6950.cpp:87
unsigned long get_LTC6950_global_VCO_MAX_MHz()
returns global LTC6950_VCO_Max_Freq_MHz
Definition: LTC6950.cpp:661
#define LTC6950_DEL3
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:94
uint8_t LTC6950_reg[LTC6950_NUM_REGADDR]
number of LTC6950 spi addresses
Definition: LTC6950.cpp:86
#define LTC6950_DEL1
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:92
#define LTC6950_FLDRV4
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:102
#define LTC6950_M4
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:118
#define LTC6950_PD_DIV2
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:126
unsigned long get_LTC6950_global_VCO_MIN_MHz()
returns global LTC6950_VCO_Min_Freq_MHz
Definition: LTC6950.cpp:666
#define LTC6950_FLDRV0
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:98
#define LTC6950_REV
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:142
#define LTC6950_SM2
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:144
#define LTC6950_CPMID
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:87
void LTC6950_write(uint8_t cs, uint8_t address, uint8_t Data)
LTC6950 Write Single Address writes 8 bit Data field to LTC6950.
Definition: LTC6950.cpp:172
LT_SPI: Routines to communicate with ATmega328P&#39;s hardware SPI port.
uint8_t get_LTC6950_SPI_FIELD_RW(uint8_t f)
returns if the given field name is (0)read/write or (1)read_only field
Definition: LTC6950.cpp:259
#define LTC6950_PD_OUT3
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:132
uint8_t LTC6950_write_field(uint8_t cs, long field_data, uint8_t address, uint8_t MSB_loc, uint8_t numbits)
LTC6950 Write Single Field For SPI FIELDS in 1 or multiple address locations reads specific address/f...
Definition: LTC6950.cpp:188
#define LTC6950_NUM_REGADDR
Defines number of LTC6950 SPI registers, used in spi_map array.
Definition: LTC6950.h:156
void shr64(unsigned long an[])
Single Bit shift right of equivalent 64 bit number (an[] = an[]<<1)
Definition: LTC6950.cpp:946
#define LTC6950_M2
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:116
#define LTC6950_RDIVOUT
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:138
#define ADDRx
used for 2nd dim of 2d spi_map array
Definition: LTC6945.h:116
uint8_t LTC6950_read(uint8_t cs, int8_t address)
LTC6950 Read Single Address reads 8 bit Data field to LTC6950.
Definition: LTC6950.cpp:105
#define LTC6950_NUM_REGFIELD
Defines number of LTC6950 SPI fields, used in spi_map array.
Definition: LTC6950.h:157
#define LTC6950_IBIAS0
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:103
unsigned long get_LTC6950_global_fref_MHz()
returns global LTC6950_Fref_MHz
Definition: LTC6950.cpp:641
void set_LTC6950_global_vcolim(unsigned long fvco_max_MHz, unsigned long fvco_max_Hz, unsigned long fvco_min_MHz, unsigned long fvco_min_Hz)
sets globals LTC6950_VCO_Max_Freq_MHz, LTC6950_VCO_Max_Freq_Hz, LTC6950_VCO_Min_Freq_MHz and LTC6950_...
Definition: LTC6950.cpp:631
void set_LTC6950_SPI_FIELD(uint8_t cs, uint8_t f, long field_data)
Sets the LTC6950 SPI field value calls function LTC6950_read_field, which reads specific address/fiel...
Definition: LTC6950.cpp:272
void LTC6950_init()
Initializes the SPI MAP arrays The values set in initialization are used for all the LTC6950 SPI/WRIT...
Definition: LTC6950.cpp:319
#define LTC6950_CPRST
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:88
#define LTC6950_PART
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:122
#define LTC6950_INV_ST1
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:107
#define LTC6950_SYNC_EN2
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:148
unsigned long LTC6950_Fref_Hz
Default Fref frequency - Hz portion (yyy,yyy); Fref = x,xxx, yyy,yyy.
Definition: LTC6950.cpp:90
unsigned long get_LTC6950_global_VCO_MIN_Hz()
returns global LTC6950_VCO_Min_Freq_Hz
Definition: LTC6950.cpp:676
#define LTC6950_NO_VCO
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:121
This union splits one int16_t (16-bit signed integer) or uint16_t (16-bit unsigned integer) into two ...
Definition: Linduino.h:99
void init64(unsigned long an[], unsigned long bigPart, unsigned long littlePart)
Creates a equivalent 64 bit number from 2 32 bit numbers.
Definition: LTC6950.cpp:897
unsigned long LTC6950_Frf_Hz
Default Frf frequency - Hz portion (yyy,yyy); Frf = x,xxx, yyy,yyy.
Definition: LTC6950.cpp:92
#define LTC6950_IBIAS1
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:104
#define LTC6950_FLDRV3
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:101
unsigned long get_LTC6950_global_fref_Hz()
returns global LTC6950_Fref_Hz
Definition: LTC6950.cpp:646
#define LTC6950_CPDN
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:85
unsigned long LTC6950_VCO_Max_Freq_Hz
Max Vco frequency for default on board VCO - Hz portion (yyy,yyy); Fvco max = x,xxx, yyy,yyy.
Definition: LTC6950.cpp:95
uint8_t get_LTC6950_REGSIZE()
returns # of addresses in parts register map (array size)
Definition: LTC6950.cpp:239
unsigned long get_LTC6950_global_VCO_MAX_Hz()
returns global LTC6950_VCO_Max_Freq_Hz
Definition: LTC6950.cpp:671
#define LTC6950_LOCK
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:112
#define LTC6950_SM1
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:143
#define LTC6950_PD_OUT0
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:129
long LTC6950_read_field(uint8_t cs, uint8_t address, uint8_t MSB_loc, uint8_t numbits)
LTC6950 Read Single Field For SPI FIELDS located in 1 or multiple address location reads specific add...
Definition: LTC6950.cpp:125
static int i
Definition: DC2430A.ino:184
#define LTC6950_CP
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:82
#define LTC6950_FLDRV1
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:99
#define LTC6950_PD_DIV1
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:125
#define LTC6950_CMSINV
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:81
#define LTC6950_PD_OUT4
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:133
#define LTC6950_PD_DIV0
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:124
#define LTC6950_LVCMS
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:113
unsigned long LTC6950_VCO_Max_Freq_MHz
Max Vco frequency for default on board VCO - MHz portion (xxxx); Fvco max = xxx, yyy,yyy.
Definition: LTC6950.cpp:93
uint8_t LT_byte[2]
2 bytes (unsigned 8-bit integers) to be converted to a 16-bit signed or unsigned integer ...
Definition: Linduino.h:103
#define LTC6950_DEL2
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:93
#define LTC6950_PD_DIV4
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:128
void prt(unsigned long an[])
Prints HEX representation of 64 bit an.
Definition: LTC6950.cpp:883
#define LTC6950_IBIAS3
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:106
#define LTC6950_THI
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:151
unsigned long LTC6950_VCO_Min_Freq_MHz
Min Vco frequency for default on board VCO - MHz portion (xxxx); Fvco min = x,xxx, yyy,yyy.
Definition: LTC6950.cpp:94
#define LTC6950_CPINV
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:86
#define LTC6950_FILTR
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6950.h:96
unsigned long zero64[]
for 64bit math functions
Definition: LTC6950.cpp:98
#define DxMSB
used for 2nd dim of 2d spi_map array
Definition: LTC6945.h:117