100 char *power_prompt =
"Enter a command: ";
106 char *tune_prompt =
"\nDesired RF Input Tune setting: ";
112 char *att_prompt =
"\nDesired IF Attenuation (dB): ";
148 char *power_1_prompt =
"Enter a command for Channel 1: ";
154 char *power_2_prompt =
"Enter a command for Channel 2: ";
160 char *tune_1_prompt =
"\nDesired Channel 1 RF Input Tune setting: ";
166 char *tune_2_prompt =
"\nDesired Channel 2 RF Input Tune setting: ";
172 char *att_1_prompt =
"\nDesired Channel 1 IF Attenuation (dB): ";
178 char *att_2_prompt =
"\nDesired Channel 2 IF Attenuation (dB): ";
223 int keep_looping = 0;
226 int8_t power_command;
232 Serial.println(F(
"\n\n1. Full Power Mode"));
233 Serial.println(F(
"2. Low Power Mode\n"));
234 Serial.print(prompt);
240 Serial.println(power_command);
241 switch (power_command) {
253 Serial.println(F(
"\n\nIncorrect Option\n"));
257 if (keep_looping == 0) {
267 int keep_looping = 0;
276 Serial.println(F(
"\n1. RF Tune 00 (3.1GHz - 5.1GHz)"));
277 Serial.println(F(
"2. RF Tune 01 (1.8GHz - 4.4GHz)"));
278 Serial.println(F(
"3. RF Tune 10 (1.3GHz - 3.9GHz)"));
279 Serial.println(F(
"4. RF Tune 11 (Less than 1.3GHz)"));
280 Serial.print(prompt);
286 Serial.println(tune_command);
287 switch (tune_command) {
307 Serial.println(F(
"\n\nIncorrect Option\n"));
311 if (keep_looping == 0) {
321 int keep_looping = 0;
330 Serial.print(prompt);
334 Serial.println(att_command, 1);
337 if (fmod(att_command, 0.5) != 0) {
338 Serial.println(F(
"\n\nIncorrect Option - Choose a number " 339 "between 0 and 15.5dB in 0.5dB increments\n"));
343 else if (att_command < 0) {
344 Serial.println(F(
"\n\nIncorrect Option - Choose a number " 345 "between 0 and 15.5dB in 0.5dB increments\n"));
349 else if (att_command > 31) {
350 Serial.println(F(
"\n\nIncorrect Option - Choose a number " 351 "between 0 and 15.5dB in 0.5dB increments\n"));
358 att_command = att_command * 2.;
361 att_bits =
static_cast<int>(att_command);
364 if (keep_looping == 0) {
374 uint8_t power_bit_read;
377 String power_setting_read;
380 uint8_t tune_bits_read;
383 String tune_setting_read;
386 uint8_t att_bits_read;
389 float att_setting_read;
392 power_bit_read = (output_register & 0x90) >> 7;
393 switch (power_bit_read) {
396 power_setting_read =
"Full Power";
400 power_setting_read =
"Low Power";
405 Serial.println(
"Power Setting: " + power_setting_read);
408 tune_bits_read = (output_register & 0x60) >> 5;
409 switch (tune_bits_read) {
411 tune_setting_read =
"RF Tune 00 (3.1GHz - 5.1GHz)";
414 tune_setting_read =
"RF Tune 01 (1.8GHz - 4.4GHz)";
417 tune_setting_read =
"RF Tune 10 (1.3GHz - 3.9GHz)";
420 tune_setting_read =
"RF Tune 11 (Less than 1.3GHz)";
425 Serial.println(
"RF Input Setting: " + tune_setting_read);
428 att_bits_read = output_register & 0x1F;
431 att_setting_read = (att_bits_read / 2.);
434 Serial.println(
"Attenuation Setting: " + String(att_setting_read, 1) +
" dB");
#define LTC5566_RF_TUNE_01
#define LTC5566_CS
Define the SPI CS pin.
uint8_t LTC5566_dupl_settings()
Function to duplicate settings for both LTC5566 channels.
Header File for Linduino Libraries and Demo Code.
#define LTC5566_FULL_POWER
#define LTC5566_RF_TUNE_11
#define LTC5566_REDUCED_POWER
#define LTC5566_RF_TUNE_10
uint8_t LTC5566_get_tune_mode(char *prompt)
Function to get data from user for RF input tune mode.
uint8_t LTC5566_get_power_mode(char *prompt)
Function to get data from user for power mode.
uint8_t LTC5566_get_att(char *prompt)
Function to get data from user for IF attenuation.
Copyright 2018(c) Analog Devices, Inc.
void spi_transfer_word(uint8_t cs_pin, uint16_t tx, uint16_t *rx)
Reads and sends a word.
#define LTC5566_RF_TUNE_00
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...
LT_SPI: Routines to communicate with ATmega328P's hardware SPI port.
prompt
Used to keep track to print voltage or print code.
uint16_t LTC5566_diff_settings()
Function to apply unique settings for each LTC5566 channel.
void LTC5566_decode_output(uint8_t output_register)
Decode the register value read from the LTC5555.