Linduino  1.3.0
Linear Technology Arduino-Compatible Demonstration Board
LTC5566.h
Go to the documentation of this file.
1 /*!
2 Copyright 2018(c) Analog Devices, Inc.
3 
4 LTC5566: Dual Programmable Gain Downconverting Mixer
5 
6 @verbatim
7 
8 The LTC5566 dual programmable gain downconverting mixer
9 is ideal for diversity and MIMO receivers that require precise
10 gain setting. Each channel incorporates an active mixer and a
11 digital IF VGA with 15.5dB gain control range. The IF gain of
12 each channel is programmed in 0.5dB steps through the SPI.
13 
14 SPI DATA FORMAT (MSB First):
15 
16  Byte #1 Byte #2
17 Data In : RP2 RT2[1] RT2[0] IF2[4] IF2[3] IF2[2] IF2[1] IF2[0] RP1 RT1[1] RT1[0] IF1[4] IF1[3] IF1[2] IF1[1] IF1[0]
18  |---- ATT, TUNE, POWER CONTROL WORD FOR MIXER 2 ---| |---- ATT, TUNE, POWER CONTROL WORD FOR MIXER 1 ---|
19 
20 RPx : Reduced Power Mode Bit
21 RTx : RF Input Tune Control Bits
22 IFx : IF Attenuation Control Bits
23 
24 @endverbatim
25 
26 http://www.linear.com/product/LTC5566
27 
28 All rights reserved.
29 
30 Redistribution and use in source and binary forms, with or without
31 modification, are permitted provided that the following conditions are met:
32  - Redistributions of source code must retain the above copyright
33  notice, this list of conditions and the following disclaimer.
34  - Redistributions in binary form must reproduce the above copyright
35  notice, this list of conditions and the following disclaimer in
36  the documentation and/or other materials provided with the
37  distribution.
38  - Neither the name of Analog Devices, Inc. nor the names of its
39  contributors may be used to endorse or promote products derived
40  from this software without specific prior written permission.
41  - The use of this software may or may not infringe the patent rights
42  of one or more patent holders. This license does not release you
43  from the requirement that you obtain separate licenses from these
44  patent holders to use this software.
45  - Use of the software either in source or binary form, must be run
46  on or directly connected to an Analog Devices Inc. component.
47 
48 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
49 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
50 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
51 IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
52 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
53 LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
54 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
55 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
56 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
57 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
58 */
59 
60 /*! @file
61  @ingroup LTC5566
62  Header for LTC5566: Dual Programmable Gain Downconverting Mixer
63 */
64 
65 #ifndef LTC5566_H
66 #define LTC5566_H
67 
68 #include <SPI.h>
69 
70 //! Define the SPI CS pin
71 #ifndef LTC5566_CS
72 #define LTC5566_CS QUIKEVAL_CS
73 #endif
74 
75 //! @name LTC5566 reduced power mode configuration bit.
76 //! @{
77 // reduced power mode configuration bit.
78 #define LTC5566_FULL_POWER 0x00
79 #define LTC5566_REDUCED_POWER 0x80
80 //! @}
81 
82 //! @name LTC5566 shutdown/powerup and GPO configuration bits.
83 //! @{
84 // shutdown/powerup and GPO configuration bits.
85 #define LTC5566_RF_TUNE_00 0x00
86 #define LTC5566_RF_TUNE_01 0x20
87 #define LTC5566_RF_TUNE_10 0x40
88 #define LTC5566_RF_TUNE_11 0x60
89 //! @}
90 
91 //! Writes to the LTC5566 twice and reads back the last two bytes to make sure
92 //! the LTC5566 was loaded properly
93 //! @return void
94 void LTC5566_write(uint8_t cs, //! Chip Select pin
95  uint16_t tx, //! Word to be transmitted
96  uint16_t *rx //! Output pointer
97  );
98 
99 //! Function to duplicate settings for both LTC5566 channels
100 //! @return Readback after writing duplicate settings to both channels
101 uint8_t LTC5566_dupl_settings();
102 
103 //! Function to apply unique settings for each LTC5566 channel
104 //! @return Readback after writing different settings for each channel
105 uint16_t LTC5566_diff_settings();
106 
107 //! Function to get data from user for power mode
108 //! @return uint8_t
109 uint8_t LTC5566_get_power_mode(
110  char *prompt //! Prompt to ask for the desired power mode
111  );
112 
113 //! Function to get data from user for RF input tune mode
114 //! @return uint8_t
115 uint8_t LTC5566_get_tune_mode(
116  char *prompt //! Prompt to ask for the desired RF tune mode
117  );
118 
119 //! Function to get data from user for IF attenuation
120 //! @return uint8_t
121 uint8_t LTC5566_get_att(
122  char *prompt //! Prompt to ask for the desired attenuation
123  );
124 
125 //! Decode the register value read from the LTC5555
126 //! @return void
128  uint8_t output //! Raw output from the LTC5566 to decode
129  );
130 
131 #endif // LTC5566_H
void LTC5566_write(uint8_t cs, uint16_t tx, uint16_t *rx)
Writes to the LTC5566 twice and reads back the last two bytes to make sure the LTC5566 was loaded pro...
Definition: LTC5566.cpp:88
uint8_t LTC5566_get_power_mode(char *prompt)
Function to get data from user for power mode.
Definition: LTC5566.cpp:221
uint8_t LTC5566_get_att(char *prompt)
Function to get data from user for IF attenuation.
Definition: LTC5566.cpp:319
uint8_t LTC5566_dupl_settings()
Function to duplicate settings for both LTC5566 channels.
Definition: LTC5566.cpp:95
uint16_t LTC5566_diff_settings()
Function to apply unique settings for each LTC5566 channel.
Definition: LTC5566.cpp:143
void LTC5566_decode_output(uint8_t output)
Decode the register value read from the LTC5555.
Definition: LTC5566.cpp:372
prompt
Used to keep track to print voltage or print code.
Definition: DC934A.ino:113
uint8_t LTC5566_get_tune_mode(char *prompt)
Function to get data from user for RF input tune mode.
Definition: LTC5566.cpp:265