// ANAN-100 boards PS will not work, you have to use EXT1.
//
//
-#define ALEX_RX_ANTENNA_NONE 0x00000000 // route Ant1,2,2 to RX1
-#define ALEX_RX_ANTENNA_XVTR 0x00000100 // route XVTR-in to RX1 (bit 8)
-#define ALEX_RX_ANTENNA_EXT1 0x00000200 // route EXT1 to RX1 (bit 9)
-#define ALEX_RX_ANTENNA_EXT2 0x00000400 // route EXT2 to RX1 (bit 10)
-#define ALEX_RX_ANTENNA_BYPASS 0x00000800 // activate BYPASS (bit 11)
+#define ALEX_RX_ANTENNA_NONE 0x00000000 // route Ant1,2,2 to RX1
+#define ALEX_RX_ANTENNA_XVTR 0x00000100 // route XVTR-in to RX1 (bit 8)
+#define ALEX_RX_ANTENNA_EXT1 0x00000200 // route EXT1 to RX1 (bit 9)
+#define ALEX_RX_ANTENNA_EXT2 0x00000400 // route EXT2 to RX1 (bit 10)
+#define ALEX_RX_ANTENNA_BYPASS 0x00000800 // activate BYPASS (bit 11)
#define ANAN7000_RX_SELECT 0x00004000 // Master RX select (bit 14)
-#define ALEX_TX_ANTENNA_1 0x01000000 // route TX to ANT1
-#define ALEX_TX_ANTENNA_2 0x02000000 // route TX to ANT2
-#define ALEX_TX_ANTENNA_3 0x04000000 // route TX to ANT3
+#define ALEX_TX_ANTENNA_1 0x01000000 // route TX to ANT1 (bit 24)
+#define ALEX_TX_ANTENNA_2 0x02000000 // route TX to ANT2 (bit 25)
+#define ALEX_TX_ANTENNA_3 0x04000000 // route TX to ANT3 (bit 26)
//
-// Note: DO NOT SET attenuator bits on ANAN-7000/8000
+// Note: DO NOT SET attenuator bits (13 and 14) on ANAN-7000/8000
// since ALEX0(14) is used for a different purpose!
//
#define ALEX_ATTENUATION_0dB 0x00000000
-#define ALEX_ATTENUATION_10dB 0x00004000 // activate 10 dB attenuator for RX1
-#define ALEX_ATTENUATION_20dB 0x00002000 // activate 20 dB attenuator for RX1
-#define ALEX_ATTENUATION_30dB 0x00006000 // activate both attenuators for RX1
+#define ALEX_ATTENUATION_10dB 0x00004000 // activate 10 dB attenuator for first ADC
+#define ALEX_ATTENUATION_20dB 0x00002000 // activate 20 dB attenuator for first ADC
+#define ALEX_ATTENUATION_30dB 0x00006000 // activate both attenuators for first ADC
//
// Note: Anan 100/200: If RX signal comes from Ant1,2,3 it also goes
// through the TX LPFs
//
-#define ALEX_30_20_LPF 0x00100000 // activate 30/20m TX LPF
-#define ALEX_60_40_LPF 0x00200000 // activate 60/20m TX LPF
-#define ALEX_80_LPF 0x00400000 // activate 80m TX LPF
-#define ALEX_160_LPF 0x00800000 // activate 160m TX LPF
-#define ALEX_6_BYPASS_LPF 0x20000000 // activate 6m TX LPF
-#define ALEX_12_10_LPF 0x40000000 // activate 12/10m TX LPF
-#define ALEX_17_15_LPF 0x80000000 // activate 17/15m TX LPF
+#define ALEX_30_20_LPF 0x00100000 // activate 30/20m TX LPF (bit 20)
+#define ALEX_60_40_LPF 0x00200000 // activate 60/40m TX LPF (bit 21)
+#define ALEX_80_LPF 0x00400000 // activate 80m TX LPF (bit 22)
+#define ALEX_160_LPF 0x00800000 // activate 160m TX LPF (bit 23)
+#define ALEX_6_BYPASS_LPF 0x20000000 // activate 6m TX LPF (bit 30)
+#define ALEX_12_10_LPF 0x40000000 // activate 12/10m TX LPF (bit 31)
+#define ALEX_17_15_LPF 0x80000000 // activate 17/15m TX LPF (bit 32)
//
-// ALEX RX high-pass filters (Valid for ANAN-100/200)
+// ALEX RX high-pass filters (Valid for ANAN-100/200 first ADC)
+// NOTE: Anan-7000/8000 use band-pass filters here
//
-#define ALEX_13MHZ_HPF 0x00000002
-#define ALEX_20MHZ_HPF 0x00000004
-#define ALEX_6M_PREAMP 0x00000008 // 35 MHz HPF + low-noise amplifier
-#define ALEX_9_5MHZ_HPF 0x00000010
-#define ALEX_6_5MHZ_HPF 0x00000020
-#define ALEX_1_5MHZ_HPF 0x00000040
-#define ALEX_BYPASS_HPF 0x00001000
+#define ALEX_13MHZ_HPF 0x00000002 // (bit 1)
+#define ALEX_20MHZ_HPF 0x00000004 // (bit 2)
+#define ALEX_6M_PREAMP 0x00000008 // (bit 3) 35 MHz HPF + low-noise amplifier
+#define ALEX_9_5MHZ_HPF 0x00000010 // (bit 4)
+#define ALEX_6_5MHZ_HPF 0x00000020 // (bit 5)
+#define ALEX_1_5MHZ_HPF 0x00000040 // (bit 6)
+#define ALEX_BYPASS_HPF 0x00001000 // (bit 12)
//
// Bit that controls the RX/TX relay
//
-#define ALEX_TX_RELAY 0x08000000
+#define ALEX_TX_RELAY 0x08000000 // (bit 27)
//
// Bit used for PURESIGNAL
//
-#define ALEX_PS_BIT 0x00040000
+#define ALEX_PS_BIT 0x00040000 // (bit 18)
//
// From this point on, we define bits that have a slightly
// The TX bits are just as for the "generic" case.
//
-// These bits only have a function on ANAN-7000
+// These bits are valid both for ALEX0 and ALEX1 in the Anan-7000/8000
-#define ALEX_ANAN7000_RX_20_15_BPF 0x00000002 // bit 1, 11.0 - 22.0 MHz
-#define ALEX_ANAN7000_RX_12_10_BPF 0x00000004 // bit 2, 22.0 - 35.6 MHz
-#define ALEX_ANAN7000_RX_6_PRE_BPF 0x00000008 // bit 3, > 35.6 MHz with preamp
-#define ALEX_ANAN7000_RX_40_30_BPF 0x00000010 // bit 4, 5.5 - 10.9 MHz
-#define ALEX_ANAN7000_RX_80_60_BPF 0x00000020 // bit 5, 2.1 - 5.4 MHz
-#define ALEX_ANAN7000_RX_160_BPF 0x00000040 // bit 6, 1.5 - 2.0 MHz
-#define ALEX_ANAN7000_RX_BYPASS_BPF 0x00001000 // bit 12
+#define ALEX_ANAN7000_RX_20_15_BPF 0x00000002 // (bit 1), 11.0 - 22.0 MHz
+#define ALEX_ANAN7000_RX_12_10_BPF 0x00000004 // (bit 2), 22.0 - 35.6 MHz
+#define ALEX_ANAN7000_RX_6_PRE_BPF 0x00000008 // (bit 3), > 35.6 MHz with preamp
+#define ALEX_ANAN7000_RX_40_30_BPF 0x00000010 // (bit 4), 5.5 - 10.9 MHz
+#define ALEX_ANAN7000_RX_80_60_BPF 0x00000020 // (bit 5), 2.1 - 5.4 MHz
+#define ALEX_ANAN7000_RX_160_BPF 0x00000040 // (bit 6), 1.5 - 2.0 MHz
+#define ALEX_ANAN7000_RX_BYPASS_BPF 0x00001000 // (bit 12)
-#define ALEX1_ANAN7000_RX_GNDonTX 0x00000100 // bit 8
+#define ALEX1_ANAN7000_RX_GNDonTX 0x00000100 // (bit 8), ground second ADC input during TX
//
-// For ANAN7000,8000 there also is byte 1400 in the high-priority packet
-// which directs the output of the DUC directly to the "XVTR OUT" jack
-// (bit0) and which we should set when using "XVRT IN"
+// ANAN7000,8000 specific bits in byte 1400 of the high-priority packet
//
-#define ANAN7000_XVTR_OUT 0x00000001 //
+#define ANAN7000_XVTR_OUT 0x00000001 // if PTT is set, Orion-II RF output is routed to the
+ // "XVTR Port" jack
#endif
//
// ALEX bits
//
- long alex0=0x00000000;
- long alex1=0x00000000;
+ unsigned long alex0=0x00000000;
+ unsigned long alex1=0x00000000;
if (device != NEW_DEVICE_ORION2) {
//
//g_print("ALEX0 bits: %02X %02X %02X %02X for rx=%lld tx=%lld\n",high_priority_buffer_to_radio[1432],high_priority_buffer_to_radio[1433],high_priority_buffer_to_radio[1434],high_priority_buffer_to_radio[1435],rxFrequency,txFrequency);
//
-// Orion2 boards: set RX2 filters according ro VFOB frequency
+// Orion2 boards: set RX2 filters according to VFOB frequency
//
if (device == NEW_DEVICE_ORION2) {
//
rxFrequency=vfo[VFO_B].frequency-vfo[VFO_B].lo;
}
//
-// new ANAN-7000/8000 band-pass RX filters
+// new ANAN-7000/8000 "Alex1" band-pass RX filters
//
if(rxFrequency<1500000L) {
alex1|=ALEX_ANAN7000_RX_BYPASS_BPF;
pthread_mutex_unlock(&hi_prio_mutex);
}
-static unsigned char last_50=0;
static void new_protocol_transmit_specific() {
int txmode=get_tx_mode();
transmit_specific_buffer[50]|=0x10;
}
- if(last_50!=transmit_specific_buffer[50]) {
- last_50=transmit_specific_buffer[50];
-//g_print("tx_specific: 50=%02X\n",transmit_specific_buffer[50]);
- }
-
// 0..31
transmit_specific_buffer[51]=linein_gain;
receive_specific_buffer[19]=192; // sample rate LSB
receive_specific_buffer[22]=24; // bits per sample
- receive_specific_buffer[23]=n_adc; // TX-DAC associated with DDC1
+ receive_specific_buffer[23]=n_adc; // TX-DAC (last ADC + 1) associated with DDC1
receive_specific_buffer[24]=0; // sample rate MSB
receive_specific_buffer[25]=192; // sample rate LSB
receive_specific_buffer[26]=24; // bits per sample