Linduino  1.3.0
Linear Technology Arduino-Compatible Demonstration Board
LTC6953.cpp
Go to the documentation of this file.
1 /*!
2  LTC6953: Ultra-Low Jitter, JESD204B Clock Distributor with Eleven Programmable Outputs
3 
4 @verbatim
5 
6 The LTC®6953 is a high performance, ultralow jitter,
7 JESD204B clock distribution IC. The LTC6953’s eleven
8 outputs can be configured as up to five JESD204B subclass
9 1 device clock/SYSREF pairs plus one general
10 purpose output or simply eleven general purpose clock
11 outputs for non-JESD204B applications. Each output has
12 its own individually programmable frequency divider and
13 output driver. All outputs can also be synchronized and
14 set to precise phase alignment using individual coarse half
15 cycle digital delays and fine analog time delays.
16 
17 For applications requiring more than eleven total outputs,
18 multiple LTC6953s can be connected together with
19 LTC6952s and LTC6955s using the EZSync or ParallelSync
20 synchronization protocols.
21 
22 @endverbatim
23 
24 
25 http://www.linear.com/product/LTC6953
26 
27 http://www.linear.com/product/LTC6953#demoboards
28 
29 
30 Copyright 2018(c) Analog Devices, Inc.
31 
32 All rights reserved.
33 
34 Redistribution and use in source and binary forms, with or without
35 modification, are permitted provided that the following conditions are met:
36  - Redistributions of source code must retain the above copyright
37  notice, this list of conditions and the following disclaimer.
38  - Redistributions in binary form must reproduce the above copyright
39  notice, this list of conditions and the following disclaimer in
40  the documentation and/or other materials provided with the
41  distribution.
42  - Neither the name of Analog Devices, Inc. nor the names of its
43  contributors may be used to endorse or promote products derived
44  from this software without specific prior written permission.
45  - The use of this software may or may not infringe the patent rights
46  of one or more patent holders. This license does not release you
47  from the requirement that you obtain separate licenses from these
48  patent holders to use this software.
49  - Use of the software either in source or binary form, must be run
50  on or directly connected to an Analog Devices Inc. component.
51 
52 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
53 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
54 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
55 IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
56 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
57 LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
58 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
59 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
60 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
61 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
62 */
63 
64 //! @ingroup RF_Timing
65 //! @{
66 //! @defgroup LTC6953 LTC6953: Ultra-Low Jitter, JESD204B Clock Distributor with Eleven Programmable Outputs
67 //! @}
68 
69 /*! @file
70  @ingroup LTC6953
71  Library for LTC6953: Ultra-Low Jitter, JESD204B Clock Distributor with Eleven Programmable Outputs
72 */
73 
74 #include <stdint.h>
75 #include <Arduino.h>
76 #include "Linduino.h"
77 #include "UserInterface.h"
78 #include "LT_SPI.h"
79 #include "LTC6953.h"
80 #include "QuikEval_EEPROM.h"
81 #include <SPI.h>
82 
83 uint8_t LTC6953_reg[LTC6953_NUM_REGADDR]; //!< number of LTC6953 spi addresses
84 uint16_t LTC6953_spi_map[(LTC6953_NUM_REGFIELD+1)]; //!< LTC6953 spi map, AAAA AAAA RMMM NNNN; A= ADDR LOC, R=R or RW, M = MSB bit location, N = field length
85 
86 uint8_t LTC6953_lkup_tbl[2][LTC6953_NUM_REGADDR] = //!< created with the LTC6952Wizard tool
87 {
88  {0x25, 0x04, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x8c, 0xe0, 0x1b, 0x00, 0x40, 0x80, 0x24, 0x00, 0x8c, 0xe0, 0x1b, 0x00, 0x40, 0x80, 0x24, 0x00, 0x8c, 0xe0, 0x00, 0x00, 0x89, 0x80, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8c, 0xe0, 0x23, 0x00, 0x00, 0x80, 0x24, 0x00, 0x8c, 0xe0, 0x23, 0x00, 0x00, 0x80, 0x24, 0x00, 0x13}, //!< xxxx
89  {0x25, 0x04, 0x00, 0xf0, 0xf0, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13}, //!< xxxx
90 }; //!< LTC6953 Configuration look-up table
91 
92 
93 /* -------------------------------------------------------------------------
94  FUNCTION: LTC6953_read
95  - reads 8 bit Data field to LTC6953.
96  - has to shift data by one bit to account for RW bit
97  -------------------------------------------------------------------------- */
98 uint8_t LTC6953_read(uint8_t cs, int8_t address)
99 {
100  int8_t address_shift;
102 
103  address_shift =(address << 1) | 0x01; // shift to left to account for R/W bit, set bit high for read
104  spi_transfer_word(cs, address_shift<<8 , &rx.LT_uint16);
105 
106  LTC6953_reg[address]=rx.LT_byte[0];
107  return(rx.LT_byte[0]);
108 }
109 
110 
111 /* -------------------------------------------------------------------------
112  FUNCTION: LTC6953_read_field
113  For SPI FIELDS located in 1 or multiple address location
114  - reads specific address locations
115  - identifies and returns specific field in question
116  - can handle SPI fields in multiple addresses, if MSB bit is in the lower number address
117 --------------------------------------------------------------------------- */
118 long LTC6953_read_field(uint8_t cs, uint8_t address, uint8_t MSB_loc, uint8_t numbits)
119 {
120  int bit_shift, i, num_reg;
121  long field_val, maskbits, pow2;
122 
123  num_reg=0;
124  field_val=0;
125 // determines how many register are used
126  do
127  {
128  bit_shift = (MSB_loc+1)- (numbits-num_reg*8); // determines bit_shift for last register location
129  field_val=LTC6953_read(cs, (address+num_reg))+(field_val<<8); // reads current address locations, shifts previous address location 8 bits
130  num_reg++;
131  }
132  while ((bit_shift<0) && (num_reg<4));
133 
134 // creates a bit mask for complete word,
135  maskbits = 1;
136  pow2=1;
137  for (i=1, maskbits=1; i<numbits; i++)
138  {
139  pow2=pow2*2;
140  maskbits = maskbits+pow2;
141  }
142 
143  field_val=(field_val >>bit_shift) &maskbits;
144  return field_val;
145 }
146 
147 /* -------------------------------------------------------------------------
148  FUNCTION: get_LTC6953_SPI_FIELD
149  For SPI FIELDS
150  - reads specific address locations
151  - identifies and returns specific field in question
152  - can handle SPI fields in multiple addresses, if MSB bit is in the lower number address
153 --------------------------------------------------------------------------- */
154 long get_LTC6953_SPI_FIELD(uint8_t cs, uint8_t f)
155 {
156  uint8_t addrx;
157  uint8_t dxmsb;
158  uint8_t numbits;
159 
160  addrx = (LTC6953_spi_map[f] & 0xff00) >> 8;
161  dxmsb = (LTC6953_spi_map[f] & 0x0070) >> 4;
162  numbits = (LTC6953_spi_map[f] & 0x000f) + 1;
163  return LTC6953_read_field(cs, addrx, dxmsb, numbits);
164 
165 #if INCLUDE_REGMAP
167 #endif
168 }
169 
170 /* -------------------------------------------------------------------------
171  FUNCTION: LTC6953_write
172  - writes 8 bit Data field to LTC6953.
173  - has to shift data by one bit to account for RW bit
174 --------------------------------------------------------------------------- */
175 void LTC6953_write(uint8_t cs, uint8_t address, uint8_t Data)
176 {
178 
179  address=address << 1; // shift to left to account for R/W bit
180  spi_transfer_word(cs, (address<<8) | Data, &rx.LT_uint16);
181 }
182 
183 
184 /* -------------------------------------------------------------------------
185  FUNCTION: LTC6953_write_field
186  For SPI FIELDS
187  - reads specific address location
188  - identifies and returns specific field in question
189  - can handle SPI fields in multiple addresses, if MSB bit is in the lower number address
190 ---------------------------------------------------------------------------- */
191 uint8_t LTC6953_write_field(uint8_t cs, long field_data, uint8_t address, uint8_t MSB_loc, uint8_t numbits)
192 {
193  long current_content, desired_content, reg_val;
194  int LSB_loc, i, j, num_reg, bit_shift;
195  long temp_arr[32];
196 
197  for (i=0; i<32 ; i++) temp_arr[i]=0; // init temp_arr
198 
199 // read data in current address location and put in a bit array
200  num_reg=0;
201  current_content=0;
202  do
203  {
204  bit_shift=(MSB_loc+1)-(numbits-num_reg*8);
205  current_content=LTC6953_read(cs, (address+num_reg)) + (current_content<<8);
206 
207  num_reg++;
208  }
209  while ((bit_shift<0) && (num_reg<4));
210  for (i=0; i<(8*num_reg); i++)
211  {
212  temp_arr[i]=(current_content>>i) & 1;
213  }
214 
215 // exchange current bits with desired bits
216  LSB_loc = 8*(num_reg-1)+MSB_loc-numbits+1;
217  for (i=LSB_loc, j=0; i<=(MSB_loc+(num_reg-1)*8); i++, j++)
218  {
219  temp_arr[i] = (field_data>>j) &1;
220  } // end of for loop
221 
222 // reconstruct bits into an integer
223  desired_content = 0;
224  for (i=0; i<(8*num_reg); i++)
225  {
226  desired_content = desired_content | (temp_arr[i]<<i);
227  } // end of for loop
228 
229 // write new field value to part
230  for (i=0; i<num_reg; i++)
231  {
232  reg_val = (desired_content >> 8*(num_reg-1-i)) & 0xff;
233  LTC6953_write(cs, (address+i), reg_val);
234  } // end of for loop
235 } // end of LTC6953_write_field
236 
237 
238 /* -------------------------------------------------------------------------
239  FUNCTION: get_LTC6953_REGSIZE
240  - returns # of addresses in parts register map (array size)
241 ---------------------------------------------------------------------------- */
243 {
244  return sizeof(LTC6953_reg);
245 }
246 
247 
248 /* -------------------------------------------------------------------------
249  FUNCTION: get_LTC6953_SPI_FIELD_NUMBITS
250  - returns the number of bits for a given field name in the SPI map
251 ---------------------------------------------------------------------------- */
253 {
254  uint8_t numbits;
255 
256  numbits = (LTC6953_spi_map[f] & 0x000f) + 1;
257  return numbits;
258 }
259 
260 
261 /* -------------------------------------------------------------------------
262  FUNCTION: get_LTC6953_SPI_FIELD_RW
263  - returns if the given field name is (0)read/write or (1)read_only field
264 ---------------------------------------------------------------------------- */
265 uint8_t get_LTC6953_SPI_FIELD_RW(uint8_t f)
266 {
267  uint8_t rw_stat;
268 
269  rw_stat = (LTC6953_spi_map[f] & 0x0080) >> 7;
270  return rw_stat;
271 }
272 
273 
274 /* -------------------------------------------------------------------------
275  FUNCTION: set_LTC6953_SPI_FIELD
276  For SPI FIELDS
277  - reads specific address location
278  - identifies and returns specific field in question
279  - can handle SPI fields in multiple addresses, if MSB bit is in the lower number address
280 ---------------------------------------------------------------------------- */
281 void set_LTC6953_SPI_FIELD(uint8_t cs, uint8_t f, long field_data)
282 {
283  uint8_t addrx;
284  uint8_t dxmsb;
285  uint8_t numbits;
286 
287  addrx = (LTC6953_spi_map[f] & 0xff00) >> 8;
288  dxmsb = (LTC6953_spi_map[f] & 0x0070) >> 4;
289  numbits = (LTC6953_spi_map[f] & 0x000f) + 1;
290  LTC6953_write_field(cs, field_data, addrx, dxmsb, numbits);
291 
292 #if INCLUDE_REGMAP
294 #endif
295 }
296 
297 /* -------------------------------------------------------------------------
298  FUNCTION: set_LTC6953_REGS_lkup_tbl
299  - writes LTC6953 registers from a look up table
300  - uses the Multi-byte write option for more efficient data transfer
301  - Either SPI Syncs or recommends the use to SYNC pin based on RAO value
302 --------------------------------------------------------------------------- */
303 void set_LTC6953_REGS_lkup_tbl(uint8_t lkup_tbl_row)
304 {
305  uint8_t val_temp, i;
306  uint8_t val_reg2, val_reg3, val_regA;
307  uint8_t *rx;
308 
309 //! ************** SPI REGISTER WRITE SECTION ************
310  output_low(QUIKEVAL_CS); //! 1) CS low, enable SPI
311  val_temp = 1<<1; //! 2) addr 1, shift 1 bit to account for RW bit (W=0)
312  *rx = SPI.transfer(val_temp); //! 3) send ADDR1 byte
313  for (i=1; i<LTC6953_NUM_REGADDR; i++)
314  {
315  val_temp=LTC6953_lkup_tbl[lkup_tbl_row][i];
316  *rx = SPI.transfer(val_temp); //! 4) send REG byte
317  }
318  output_high(QUIKEVAL_CS); //! 5) CS high, disable SPI
319 
320 
321 //! **************** OUTPUT SYNC SECTION ******************
322 //! toggle SSRQ to SYNC outputs
324  delay(1); // min 1ms delay for SSRQ HIGH pulse
326  delay(1); // min 1ms delay for SSRQ LOW pulse
327 
328 //! FOR JESD204B subclass 1: SET SRQMD=1, then toggle SSRQ to start SYSREF
331  delay(1); // min 1ms delay for SSRQ HIGH pulse
333  delay(1); // min 1ms delay for SSRQ LOW pulse
334 
335 //! FOR JESD204B subclass 1: SET SRQMD=0, reduce power
337 
338 //! OPTIONAL FOR JESD204B subclass 1: power down SYSREF outputs when complete(PDx=2), reduces power.
339 //! keep SYSREF dividers running to maintain synchronization.
340 
341 //! **************** INFO SECTION ******************
342 //! INFO ONLY: Print Register Map written to part
343 
344 
345 } // end of set_LTC6953_REGS_lkup_tbl
346 
347 
348 /* -------------------------------------------------------------------------
349  FUNCTION: LTC6953_init
350  - initializes the SPI MAP
351  - for ease of programming there is spreadsheet that automates this some.
352 ----------------------------------------------------------------------------*/
354 {
355 // look up table
356 
357 
358 // spi map
462 
463 
464 } // end of LTC6953_init
465 
466 
467 
468 // Read the ID string from the EEPROM and determine if the correct board is connected.
469 // Returns 1 if successful, 0 if not successful
471 {
472  int8_t connected;
473  connected = 1;
474  // read the ID from the serial EEPROM on the board
475  // reuse the buffer declared in UserInterface
476  if (read_quikeval_id_string(&ui_buffer[0]) == 0) connected = 0;
477 
478  return(connected);
479 }
480 
481 
482 
#define LTC6953_PD2
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:159
#define LTC6953_ADEL5
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:84
#define LTC6953_SRQEN2
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:169
#define LTC6953_ADEL8
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:87
#define LTC6953_DDEL4
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:94
#define LTC6953_SRQMD
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:165
#define LTC6953_OINV9
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:146
#define LTC6953_OINV10
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:147
#define LTC6953_DDEL0
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:90
#define LTC6953_PD3
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:158
#define LTC6953_FILTV
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:102
#define LTC6953_SSRQ
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:166
#define LTC6953_PD1
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:160
#define LTC6953_SRQEN4
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:171
#define LTC6953_MP4
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:130
#define LTC6953_ADEL9
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:88
LTC6953: Ultra-Low Jitter, JESD204B Clock Distributor with Eleven Programmable Outputs.
#define LTC6953_MD8
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:112
uint8_t get_LTC6953_SPI_FIELD_RW(uint8_t f)
returns if the given field name is (0)read/write or (1)read_only field
Definition: LTC6953.cpp:265
#define LTC6953_DDEL2
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:92
#define LTC6953_SRQEN5
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:172
#define output_high(pin)
Set "pin" high.
Definition: Linduino.h:75
#define LTC6953_MD5
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:109
#define LTC6953_POR
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:162
#define LTC6953_MODE3
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:118
#define LTC6953_SRQEN7
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:174
Header File for Linduino Libraries and Demo Code.
uint8_t LTC6953_reg[LTC6953_NUM_REGADDR]
number of LTC6953 spi addresses
Definition: LTC6953.cpp:83
#define LTC6953_PD8
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:153
#define LTC6953_MD3
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:107
uint16_t LTC6953_spi_map[(LTC6953_NUM_REGFIELD+1)]
LTC6953 spi map, AAAA AAAA RMMM NNNN; A= ADDR LOC, R=R or RW, M = MSB bit location, N = field length.
Definition: LTC6953.cpp:84
#define LTC6953_DDEL3
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:93
void set_LTC6953_SPI_FIELD(uint8_t cs, uint8_t f, long field_data)
Sets the LTC6953 SPI field value calls function LTC6953_read_field, which reads specific address/fiel...
Definition: LTC6953.cpp:281
#define LTC6953_OINV0
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:137
#define LTC6953_DDEL9
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:99
static int32_t connected
Definition: CN-0413.ino:69
long get_LTC6953_SPI_FIELD(uint8_t cs, uint8_t f)
Gets the LTC6953 SPI field value calls function LTC6953_read_field, which reads specific address loca...
Definition: LTC6953.cpp:154
#define LTC6953_PDVCOPK
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:150
#define LTC6953_ADEL6
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:85
#define LTC6953_MD9
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:113
#define LTC6953_TEMPO
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:178
#define LTC6953_DDEL8
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:98
#define LTC6953_nVCOOK
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:179
void LTC6953_write(uint8_t cs, uint8_t address, uint8_t Data)
LTC6953 Write Single Address writes 8 bit Data field to LTC6953.
Definition: LTC6953.cpp:175
#define LTC6953_EZMD
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:101
#define LTC6953_MD7
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:111
#define LTC6953_ADEL3
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:82
#define LTC6953_MD2
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:106
#define LTC6953_DDEL10
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:100
#define NUMBITS
Definition: LTC6115.h:69
#define LTC6953_MD10
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:114
#define LTC6953_ADEL0
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:79
static uint8_t address
Definition: DC2091A.ino:83
#define LTC6953_OINV2
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:139
#define LTC6953_OINV7
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:144
#define LTC6953_SRQEN9
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:176
#define LTC6953_MD6
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:110
#define LTC6953_PDALL
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:149
#define LTC6953_DDEL6
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:96
#define LTC6953_SRQEN6
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:173
void set_LTC6953_REGS_lkup_tbl(uint8_t lkup_tbl_row)
Writes values to ALL LTC6953 RW addresses from a look-up table.
Definition: LTC6953.cpp:303
uint16_t LT_uint16
16-bit unsigned integer to be converted to two bytes
Definition: Linduino.h:102
#define LTC6953_MP10
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:136
#define LTC6953_MP6
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:132
#define output_low(pin)
Set "pin" low.
Definition: Linduino.h:72
QuikEval EEPROM Library.
#define LTC6953_OINV5
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:142
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 LTC6953_ADEL4
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:83
#define LTC6953_OINV3
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:140
#define LTC6953_NUM_REGADDR
Defines number of LTC6953 SPI registers, used in spi_map array.
Definition: LTC6953.h:183
#define LTC6953_MODE4
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:119
uint8_t LTC6953_write_field(uint8_t cs, long field_data, uint8_t address, uint8_t MSB_loc, uint8_t numbits)
LTC6953 Write Single Field For SPI FIELDS in 1 or multiple address locations reads specific address/f...
Definition: LTC6953.cpp:191
#define LTC6953_MODE7
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:122
#define LTC6953_PD5
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:156
#define LTC6953_SRQEN0
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:167
#define LTC6953_x
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:181
#define LTC6953_NUM_REGFIELD
Defines number of LTC6953 SPI fields, used in spi_map array.
Definition: LTC6953.h:184
#define LTC6953_OINV1
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:138
LT_SPI: Routines to communicate with ATmega328P&#39;s hardware SPI port.
#define LTC6953_MD0
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:104
#define LTC6953_PD0
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:161
uint8_t get_LTC6953_SPI_FIELD_NUMBITS(uint8_t f)
returns the number of bits for a given field name in the SPI map
Definition: LTC6953.cpp:252
#define LTC6953_OINV8
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:145
#define LTC6953_MP1
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:127
#define ADDRx
used for 2nd dim of 2d spi_map array
Definition: LTC6945.h:116
void LTC6953_init()
Initializes the SPI MAP arrays The values set in initialization are used for all the LTC6953 SPI/WRIT...
Definition: LTC6953.cpp:353
#define LTC6953_MP2
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:128
#define LTC6953_MP3
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:129
#define LTC6953_DDEL7
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:97
uint8_t LTC6953_lkup_tbl[2][LTC6953_NUM_REGADDR]
created with the LTC6952Wizard tool
Definition: LTC6953.cpp:86
#define LTC6953_INVSTAT
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:103
#define LTC6953_PD4
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:157
long LTC6953_read_field(uint8_t cs, uint8_t address, uint8_t MSB_loc, uint8_t numbits)
LTC6953 Read Single Field For SPI FIELDS located in 1 or multiple address location reads specific add...
Definition: LTC6953.cpp:118
#define LTC6953_PD6
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:155
char demo_name[]
Demo Board Name stored in QuikEval EEPROM.
Definition: DC1880A.ino:97
#define LTC6953_MD1
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:105
#define LTC6953_SRQEN8
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:175
#define LTC6953_ADEL10
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:89
#define LTC6953_ADEL1
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:80
#define LTC6953_MP5
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:131
#define LTC6953_MODE6
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.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
#define LTC6953_MP7
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:133
#define LTC6953_MODE8
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:123
#define LTC6953_MD4
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:108
#define LTC6953_SRQEN3
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:170
#define LTC6953_MP0
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:126
#define LTC6953_PD10
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:151
#define LTC6953_VCOOK
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:180
#define LTC6953_PD7
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:154
#define LTC6953_MP8
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:134
#define LTC6953_REV
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:163
#define LTC6953_PART
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:148
static int i
Definition: DC2430A.ino:184
#define LTC6953_MODE1
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:116
#define LTC6953_SRQEN10
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:177
#define LTC6953_MODE10
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:125
#define LTC6953_CS
Define the SPI CS pin.
Definition: LTC6953.h:76
uint8_t get_LTC6953_REGSIZE()
returns # of addresses in parts register map (array size)
Definition: LTC6953.cpp:242
#define LTC6953_ADEL7
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:86
#define LTC6953_OINV4
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:141
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 LTC6953_MODE9
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:124
#define QUIKEVAL_CS
QuikEval CS pin (SPI chip select on QuikEval connector pin 6) connects to Arduino SS pin...
Definition: Linduino.h:57
#define LTC6953_MODE0
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:115
#define LTC6953_OINV6
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:143
#define LTC6953_SRQEN1
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:168
#define LTC6953_MP9
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:135
uint8_t read_quikeval_id_string(char *buffer)
Read the id string from the EEPROM, then parse the product name, demo board name, and demo board opti...
char ui_buffer[UI_BUFFER_SIZE]
#define LTC6953_ADEL2
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:81
int8_t discover_demo_board_local(char *demo_name)
Read the ID string from the EEPROM and determine if any demo board is connected.
Definition: LTC6953.cpp:470
#define LTC6953_DDEL5
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:95
#define LTC6953_DDEL1
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:91
#define LTC6953_MODE2
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:117
#define LTC6953_MODE5
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:120
uint8_t LTC6953_read(uint8_t cs, int8_t address)
LTC6953 Read Single Address reads 8 bit Data field to LTC6953.
Definition: LTC6953.cpp:98
#define LTC6953_SYSCT
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:164
#define LTC6953_PD9
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6953.h:152
#define DxMSB
used for 2nd dim of 2d spi_map array
Definition: LTC6945.h:117