| Linduino 1.3.0 Linear Technology Arduino-Compatible Demonstration Board

LTC5556.h
Go to the documentation of this file.
1 /*!
2 Copyright 2018(c) Analog Devices, Inc.
3
4 LTC5556: Dual Programmable Downconverting Mixer with IF DVGA
5
6 @verbatim
7
8 The LTC5556 dual programmable gain downconverting mixer
9 is ideal for diversity and MIMO receivers that require
10 precise gain setting. Each channel incorporates an active
11 mixer and a digital IF VGA with 15.5dB gain control range.
12 The IF gain of each channel is programmed in 0.5dB steps
13 through the SPI. A reduced power mode is also available
14 for each channel.
15
16 SPI DATA FORMAT (MSB First):
17
18 Data In : RP2[0] X X IF2[4] IF2[3] IF2[2] IF2[1] IF2[0] RP1[0] X X IF1[4] IF1[3] IF1[2] IF1[1] IF1[0]
19 |-------- CONTROL BITS FOR LTC5556 CH2 --------| |-------- CONTROL BITS FOR LTC5556 CH1 --------|
20
21 RP : Reduced Power Mode Control Bit
22 IF : IF Attenuation Control Bits
23
24 @endverbatim
25
26 http://www.analog.com/en/products/rf-microwave/mixers/single-double-triple-balanced-mixers/ltc5556.html
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 LTC5556
62 Header File for LTC5556: Dual Programmable Downconverting Mixer with IF DVGAs
63 */
64
65 #ifndef LTC5556_H
66 #define LTC5556_H
67
68 #include <SPI.h>
69
70 //! Define the SPI CS pin
71 #ifndef LTC5556_CS
72 #define LTC5556_CS QUIKEVAL_CS
73 #endif
74
75 //! @name LTC5556 Reduced power mode configuration bits.
76 //! @{
77 #define LTC5556_FULL_POWER 0x00
78 #define LTC5556_REDUCED_POWER 0x80
79 //! @}
80
81 //! Writes to the LTC5556 twice and reads back the last byte to make sure the
82 //! LTC5556 was loaded properly
83 //! @return void
84 void LTC5556_write(
85 uint8_t cs, //! Chip Select pin
86 uint16_t tx, //! Word to be transmitted
87 uint16_t *rx //! Output pointer
88 );
89
90 //! Function to duplicate settings for both LTC5556 channels
91 //! @return Readback after writing duplicate settings to both channels
92 uint8_t LTC5556_dupl_settings();
93
94 //! Function to apply unique settings for each LTC5556 channel
95 //! @return Readback after writing different settings for each channel
96 uint16_t LTC5556_diff_settings();
97
98 //! Take inputs and apply the settings to the mixer
99 //! @return uint8_t
100 uint8_t LTC5556_settings();
101
102 //! Function to get data from user for power mode
103 //! @return uint8_t
104 uint8_t LTC5556_get_power_mode(
105 char *prompt //! Prompt to ask for the desired power mode
106 );
107
108 //! Get attenuation value from user
109 //! @return uint8_t
110 uint8_t LTC5556_get_att(
111 char *prompt //! Prompt to ask for the desired attenuation
112 );
113
114 //! Decode the register value read from the LTC5556
115 //! @return void
116 void LTC5556_decode_output(
117 uint8_t output //! Raw output from the LTC5556 to decode
118 );
119
120 #endif // LTC5556_H
121
LTC5556_decode_output
void LTC5556_decode_output(uint8_t output)
Decode the register value read from the LTC5556.
Definition: LTC5556.cpp:293
LTC5556_dupl_settings
uint8_t LTC5556_dupl_settings()
Function to duplicate settings for both LTC5556 channels.
Definition: LTC5556.cpp:97
LTC5556_write
void LTC5556_write(uint8_t cs, uint16_t tx, uint16_t *rx)
Writes to the LTC5556 twice and reads back the last byte to make sure the LTC5556 was loaded properly...
Definition: LTC5556.cpp:90
LTC5556_get_att
uint8_t LTC5556_get_att(char *prompt)
Get attenuation value from user.
Definition: LTC5556.cpp:240
prompt
prompt
Used to keep track to print voltage or print code.
Definition: DC934A.ino:113
LTC5556_diff_settings
uint16_t LTC5556_diff_settings()
Function to apply unique settings for each LTC5556 channel.
Definition: LTC5556.cpp:136
LTC5556_get_power_mode
uint8_t LTC5556_get_power_mode(char *prompt)
Function to get data from user for power mode.
Definition: LTC5556.cpp:196
LTC5556_settings
uint8_t LTC5556_settings()
Take inputs and apply the settings to the mixer.