From: dttsp Date: Sun, 12 Jun 2005 13:47:05 +0000 (+0000) Subject: New hardware control code X-Git-Url: https://git.rkrishnan.org/pf/content/en/seg/COPYING.TGPPL.html?a=commitdiff_plain;h=fbb52cfd6d55ce2c2ffaec73b2633b1c2cad51f2;p=dttsp.git New hardware control code --- diff --git a/pyhw2/Makefile b/pyhw2/Makefile new file mode 100644 index 0000000..f8e1fc7 --- /dev/null +++ b/pyhw2/Makefile @@ -0,0 +1,13 @@ +CFLAGS = -g -I. -I/usr/local/include +LDFLAGS = +LIBS = -lm + + +python: + swig -python hardware.i + gcc -fPIC -I. -O3 -I/usr/include/python -c hardware_wrap.c + gcc -fPIC -I. -O3 -c hardware.c + ld -shared hardware.o hardware_wrap.o -o _sdr1khw.so + +demo: demo.o hardware.o + $(CC) $(LDFLAGS) -o demo demo.o hardware.o $(LIBS) diff --git a/pyhw2/README b/pyhw2/README new file mode 100644 index 0000000..28307a7 --- /dev/null +++ b/pyhw2/README @@ -0,0 +1,37 @@ +======================================================================== +Simple stuff. + +To use, run python interactively. Then + +>>> execfile("sdr1k-setup.py") + +to get the interface started. + +To set the frequency, do + +>>> setDDSFreq(14.077) + +To toggle the mute relay, + +>>> setMuteRelay(not getMuteRelay()) + +etc. + +To shut down, + +>>> closeRig() + +and exit python. (The startup script, which is crude and will be +replaced shortly, does an openRig("/dev/parport0") +======================================================================== + +To build: + +There is a simple Makefile that does just the following -- + +swig -python hardware.i +gcc -fPIC -I. -I/usr/include/python -c hardware_wrap.c +gcc -fPIC -I. -c hardware.c +ld -shared hardware.o hardware_wrap.o -o _sdr1khw.so + +Ready to go. diff --git a/pyhw2/demo.c b/pyhw2/demo.c new file mode 100644 index 0000000..873e4a8 --- /dev/null +++ b/pyhw2/demo.c @@ -0,0 +1,44 @@ +// demo.c + +#include + +#define FALSE 0 +#define TRUE 1 + +int +main(int argc, char **argv) { +#if 0 + if (!openPort("/dev/parport0")) + perror("/dev/parport0"), exit(1); +#endif + if (!openPort("/dev/null")) + perror("/dev/null"), exit(1); + + setRFE_Enabled(TRUE); + ResetRFE(); + setXVTR_Enabled(FALSE); + setExtended(FALSE); + setXVTR_TR_Relay(FALSE); + setBandRelay(bs0); + Init(); + setVFOOffset(0.0); + setATTN_Relay(TRUE); + setTransmitRelay(FALSE); + setGainRelay(TRUE); + setSpurReduction(FALSE); + setExternalOutput(FALSE); + setDDSClockCorrection(0.0); + setDDSFreq(13.845); + setMuteRelay(FALSE); + + fprintf(stderr, "Ready\n"); + { + int i; + for (i = 0; i < 100; i++) + setDDSFreq(14.060); + } + fprintf(stderr, "Done\n"); + + closePort(); + exit(0); +} diff --git a/pyhw2/hardware.c b/pyhw2/hardware.c new file mode 100644 index 0000000..0cdfca9 --- /dev/null +++ b/pyhw2/hardware.c @@ -0,0 +1,1011 @@ +// hardware.c +// version 2 + +#include + +// Register memory for IC11 +int ic11_memory; + +// Register memory for IC7 +int ic7_memory; + +BOOL rfe_enabled; // True if RFE board is enabled +BOOL xvtr_enabled; // Transverter is enabled +BOOL pa_enabled; // Transverter is enabled + +// Latch Memories +BandSetting band_relay = bs0; +int external_output = 0; +int mute_relay = 0; +int transmit_relay = 0; +int gain_relay = 0; +int latch_delay = 0; // measured in 100ns steps (10 = 1us) + +// DDS Clock properties +double dds_clock = 0.0; // DDS Clock oscillator in MHz +int pll_mult = 0; // DDS PLL multiplier +double dds_clock_correction = 0.0; // Oscillator dds_clock_correction in MHz +double sysClock = 0.0; // DDS Internal System Clock in MHz +int ioud_clock = 0; // IO Update clock period +ushort dac_mult = 0; // DAC Multiplier setting + +// DDS Frequency Control properties +double dds_freq = 0.0; // Last VFO Setting in MHz +double if_freq = 0.0; // IF Frequency Offset in MHz +BOOL if_shift = FALSE;// Turns Offset Baseband IF Shift On +BOOL spur_reduction = FALSE;// Eliminates Phase Truncation Spurs +double dds_step_size = 0.0; // DDS Step in MHz for spur removal +int sample_rate = 0; // ADC Sampling Rate in Hz +int fft_length = 0; // Length of FFT in bins +double FFT_Bin_Size = 0.0; // Bandwidth of FFT bin +int tune_fft = 0; // Offset tuning of FFT bins +double tune_frac_rel = 0.0; // In relative frequency (frequency/m_Sample_Rate) +double vfo_offset = 0.0; +//double last_VFO = 0.0; // temp store for last VFO frequency + +double min_freq = 0.012; // minimum allowable tuning frequency +double max_freq = 65.0; // maximum allowable tuning frequency + +// PIO register base address +u_short baseAdr = 0x378; + +// Current Bandplan +BandPlan curBandPlan = IARU1; + +double TWO_TO_THE_48_DIVIDED_BY_200 = 1407374883553.28; +long last_tuning_word = 0; +// private Mutex parallel_mutex = new Mutex(); +// private Mutex dataline_mutex = new Mutex(); + +BOOL usb_enabled = FALSE; + +//------------------------------------------------------------------------ + +PRIVATE int parportfd = -1; + +PUBLIC BOOL openPort(char *port) { + int mode = IEEE1284_MODE_COMPAT; + if (!port) port = "/dev/parport0"; + if ((parportfd = open(port, O_RDWR)) < 0) { + perror("open parallel port"); + return FALSE; + } + ioctl(parportfd, PPCLAIM); + ioctl(parportfd, PPSETMODE, &mode); + return TRUE; +} + +PUBLIC void closePort(void) { + ioctl(parportfd, PPRELEASE); + close(parportfd); +} + +double DttSP_SampleRate = 48000.0; + +PUBLIC void USB_Sdr1kLatch(int l, BYTE b) {} +PUBLIC BYTE USB_Sdr1kGetStatusPort(void) { return 0; } +PUBLIC int USB_Sdr1kGetADC(void) { return 0; } +PUBLIC void USB_Sdr1kDDSReset(void) {} +PUBLIC void USB_Sdr1kDDSWrite(BYTE addr, BYTE data) {} +PUBLIC void USB_Sdr1kSRLoad(BYTE reg, BYTE data) {} +PUBLIC void DttSP_ChangeOsc(double val) {} + +PRIVATE void Delay(void) { + usleep(1000 * latch_delay); +} + +PRIVATE void Sleep(int ms) { + usleep(1000 * ms); +} + +PRIVATE void PWrite(BYTE data) { + //Write data Byte to parallel port + ioctl(parportfd, PPWDATA, &data); + //Delay to allow data line setup + Delay(); +} + +PRIVATE void Latch(CtrlPin vCtrlPin) { + //Strobe the specified pin to latch data + unsigned char mask; + switch (vCtrlPin) { + case EXT: + mask = 0xA, ioctl(parportfd, PPWCONTROL, &mask); + Delay(); + mask = 0xB, ioctl(parportfd, PPWCONTROL, &mask); + break; + case BPF: + mask = 0x9, ioctl(parportfd, PPWCONTROL, &mask); + Delay(); + mask = 0xB, ioctl(parportfd, PPWCONTROL, &mask); + break; + case DAT: + mask = 0xF, ioctl(parportfd, PPWCONTROL, &mask); + Delay(); + mask = 0xB, ioctl(parportfd, PPWCONTROL, &mask); + break; + case ADR: + mask = 0x3, ioctl(parportfd, PPWCONTROL, &mask); + Delay(); + mask = 0xB, ioctl(parportfd, PPWCONTROL, &mask); + break; + } +} + +PRIVATE void ResetLatches(void) { + //Set all latch outputs to logic zero (relays off) + if (usb_enabled) { + gain_relay = GAIN; + external_output = 0; + USB_Sdr1kLatch(SDR1K_LATCH_EXT, (BYTE) (external_output + gain_relay)); + setBandRelay(bsnone); + transmit_relay = 0; + mute_relay = MUTE; + USB_Sdr1kLatch(SDR1K_LATCH_BPF, (BYTE) (band_relay + transmit_relay + mute_relay)); + } else { + PWrite(0); + Latch(ADR); + Latch(DAT); + gain_relay = GAIN; + external_output = 0; + PWrite((BYTE) (external_output + gain_relay)); + Latch(EXT); + setBandRelay(bsnone); + transmit_relay = 0; + mute_relay = MUTE; + PWrite((BYTE) (band_relay + transmit_relay + mute_relay)); + Latch(BPF); + } +} + +PRIVATE void DDSWrite(BYTE data, BYTE addr) { + if (usb_enabled) + USB_Sdr1kDDSWrite(addr, data); + else { + PWrite(data); + Latch(DAT); + PWrite((BYTE) (addr + WRB)); + Latch(ADR); + PWrite(addr); + Latch(ADR); + PWrite(WRB); + Latch(ADR); + } +} + +PRIVATE void ResetDDS(void) { + if(usb_enabled) + USB_Sdr1kDDSReset(); + else { + PWrite(RESET + WRB); + Latch(ADR); + PWrite(WRB); + Latch(ADR); + } + DDSWrite(COMP_PD, 29); //Power down comparator + if(pll_mult == 1) + DDSWrite(BYPASS_PLL, 30); + else + DDSWrite((BYTE) pll_mult, 30); + DDSWrite(BYPASS_SINC, 32); +} + + +PRIVATE void CalcClock(void) { + sysClock = 200.0 + dds_clock_correction; + dds_step_size = sysClock / pow(2.0, 48.0); +} + +PRIVATE void SetRadioFreq(double f) { + double vfoFreq = f; + long tuning_word; + + // calculate software frequency to program + if(xvtr_enabled && f >= 144 && f <= 146) + f -= 116; //Subtract 116MHz (144-28) from VFO display frequency + + if (if_shift) + f -= if_freq; // adjust for IF shift + + f += vfo_offset; // adjust for vfo offset + + tuning_word = (long) (f / sysClock * pow(2.0, 48.0)); + + if (spur_reduction) { + // start with current tuning word + // clear first bit, low 31 bits; set bit 31 + unsigned long long + sr_tuning_word = (tuning_word & ~(0x80007fffffffLL)) | 0x000080000000LL; + double software_offset = (sr_tuning_word - tuning_word) * dds_step_size; + + if (if_shift) //Convert the tuning fraction to rel frq + tune_frac_rel = 1000000.0 * (software_offset) - 11025.0; + else + tune_frac_rel = 1000000.0 * (software_offset); + DttSP_ChangeOsc(tune_frac_rel); + + tuning_word = sr_tuning_word; + } + + // program hardware + SetBPF(vfoFreq); + + if (tuning_word != last_tuning_word) { + int i; + last_tuning_word = tuning_word; //save new tuning word + + //parallel_mutex.WaitOne(); + for(i = 0; i < 6; i++) { + BYTE b = (BYTE) (tuning_word >> (40 - i * 8)); + DDSWrite(b, (BYTE) (4 + i)); + } + //parallel_mutex.ReleaseMutex(); + } +} + +PUBLIC BOOL IsHamBand(BandPlan b) { + if (getExtended()) return TRUE; + switch (b) { + case IARU1: + if (dds_freq >= 1.8 && dds_freq <= 2.0) return TRUE; + else if (dds_freq >= 3.5 && dds_freq <= 4.0) return TRUE; + else if (dds_freq == 5.3305) return TRUE; + else if (dds_freq == 5.3465) return TRUE; + else if (dds_freq == 5.3665) return TRUE; + else if (dds_freq == 5.3715) return TRUE; + else if (dds_freq == 5.4035) return TRUE; + else if (dds_freq >= 7.0 && dds_freq <= 7.3) return TRUE; + else if (dds_freq >= 10.1 && dds_freq <= 10.15) return TRUE; + else if (dds_freq >= 14.0 && dds_freq <= 14.35) return TRUE; + else if (dds_freq >= 18.068 && dds_freq <= 18.168) return TRUE; + else if (dds_freq >= 21.0 && dds_freq <= 21.45) return TRUE; + else if (dds_freq >= 24.89 && dds_freq <= 24.99) return TRUE; + else if (dds_freq >= 21.0 && dds_freq <= 21.45) return TRUE; + else if (dds_freq >= 28.0 && dds_freq <= 29.7) return TRUE; + else if (dds_freq >= 50.0 && dds_freq <= 54.0) return TRUE; + else if (dds_freq >= 144.0 && dds_freq <= 146.0) { + if (rfe_enabled && xvtr_enabled) return TRUE; + else return FALSE; + } else return FALSE; + default: + return FALSE; + // TODO: Implement other bandplans here + } +} + +//------------------------------------------------------------------------ +// Properties +// + +PRIVATE BOOL enable_LPF0 = FALSE; +PUBLIC BOOL getEnableLPF0 (void) { return enable_LPF0; } +PUBLIC void setEnableLPF0 (BOOL value) { enable_LPF0 = value; }; + +PRIVATE BOOL extended = FALSE; +PUBLIC BOOL getExtended (void) { return extended; } +PUBLIC void setExtended (BOOL value) { extended = value; } + +PRIVATE BOOL x2_enabled = FALSE; +PUBLIC BOOL getX2Enabled (void) { return x2_enabled; } +PUBLIC void setX2Enabled (BOOL value) { x2_enabled = value; } + +PRIVATE int x2_delay = 500; +PUBLIC int getX2Delay (void) { return x2_delay; } +PUBLIC void setX2Delay (int value) { x2_delay = value; } + +PUBLIC BOOL getRFE_Enabled (void) { return rfe_enabled; } +PUBLIC void setRFE_Enabled (BOOL value) { + rfe_enabled = value; + SetRadioFreq(dds_freq); +} + +PUBLIC BOOL getPA_Enabled (void) { return pa_enabled; } +PUBLIC void setPA_Enabled (BOOL value) { pa_enabled = value; } + +PUBLIC BOOL getXVTR_Enabled (void) { return xvtr_enabled; } +PUBLIC BOOL setXVTR_Enabled (BOOL value) { + xvtr_enabled = value; + if (xvtr_enabled) max_freq = 146.0; + else max_freq = 65.0; +} + +PUBLIC BOOL getUSB_Enabled (void) { return usb_enabled; } +PUBLIC void setUSB_Enabled (BOOL value) { usb_enabled = value; } + +PRIVATE XVTRTRMode current_xvtr_tr_mode = NEGATIVE; +PUBLIC XVTRTRMode getCurrentXVTRTRMode (void) { return current_xvtr_tr_mode; } +PUBLIC void setCurrentXVTRTRMode (XVTRTRMode value) { + current_xvtr_tr_mode = value; + switch (current_xvtr_tr_mode) { + case NEGATIVE: setXVTR_TR_Relay(TRUE); break; // Set to receive + case POSITIVE: setXVTR_TR_Relay(FALSE); break; // Set to receive + case NONE: break; + } +} + +PUBLIC int getLatchDelay (void) { return latch_delay; } +PUBLIC void setLatchDelay (int value) { latch_delay = value; } + +PUBLIC double getMinFreq (void) { return min_freq; } +PUBLIC double getMaxFreq (void) { return max_freq; } + +PUBLIC u_short getBaseAddr (void) { return baseAdr; } +PUBLIC u_short setBaseAddr (u_short value) { baseAdr = value; } + +PUBLIC BandSetting getBandRelay (void) { return band_relay; } +PUBLIC void setBandRelay (BandSetting value) { + band_relay = value; + if (usb_enabled) + USB_Sdr1kLatch(SDR1K_LATCH_BPF, + (BYTE) (band_relay + transmit_relay + mute_relay)); + else { + PWrite((BYTE) (band_relay + transmit_relay + mute_relay)); + Latch(BPF); + } +} + +PUBLIC BOOL getTransmitRelay (void) { + //Get state of TR relay on BPF board + if (transmit_relay == TR) return TRUE; + else return FALSE; +} +PUBLIC void setTransmitRelay (BOOL value) { + BYTE tmpLatch = 0; + BOOL tmpATTN = FALSE; + //If in valid Amateur BandRelay Save and output new TR Relay setting + if (value == TRUE) { + //if (IsHamBand(curBandPlan) == TRUE) + { + if (x2_enabled) { + SetExt(P7); // set X2-7 + Sleep(x2_delay); // pause for ext. relays + } + transmit_relay = TR; // Set to TX + if (rfe_enabled == TRUE) { + tmpATTN = getATTN_Relay(); + if (xvtr_enabled && dds_freq >= 144) { + switch (current_xvtr_tr_mode) { + case NEGATIVE: setXVTR_TR_Relay(FALSE); break; + case POSITIVE: setXVTR_TR_Relay(TRUE); break; + case NONE: break; + } + } else setAMP_Relay(TRUE); //Switch RFE to transmit + tmpLatch = (BYTE) (transmit_relay + mute_relay + DCDR_NE);// DCDR_NE for 2-4 Decoder to stay high + } else + tmpLatch = (BYTE) (band_relay + transmit_relay + mute_relay); + } + } else { + transmit_relay = 0; // Set to RX + if (rfe_enabled) { + setAMP_Relay(FALSE); + tmpLatch = (BYTE) (transmit_relay + mute_relay + DCDR_NE); + if (xvtr_enabled) { + switch(current_xvtr_tr_mode) { + case NEGATIVE: setXVTR_TR_Relay(TRUE); break; + case POSITIVE: setXVTR_TR_Relay(FALSE); break; + case NONE: break; + } + } + setATTN_Relay(tmpATTN); + } else + tmpLatch = (BYTE) (band_relay + transmit_relay + mute_relay); + } + if (usb_enabled) + USB_Sdr1kLatch(SDR1K_LATCH_BPF, tmpLatch); + else { + PWrite(tmpLatch); + Latch(BPF); + } + if (!value && x2_enabled) { + Sleep(x2_delay); // pause for ext. relays + ResExt(P7); // clear X2-7 + } + if (pa_enabled) { // set PA transmit/bias + if (dds_freq >= 1.8 && dds_freq <= 29.7) { + if (value) { // TX + setPA_TransmitRelay(TRUE); + setPA_BiasOn(TRUE); + } else { // RX + setPA_BiasOn(FALSE); + setPA_TransmitRelay(FALSE); + } + } + } +} + +PUBLIC BOOL getMuteRelay (void) { + // Get state of MUTE relay on TRX board + if (mute_relay == MUTE) return FALSE; + else return TRUE; +} +PUBLIC void setMuteRelay (BOOL value) { + BYTE data = 0; + // Mute the speaker relay if TRUE + if (value == TRUE) mute_relay = 0; + else mute_relay = MUTE; + if (rfe_enabled) + data = (BYTE) (transmit_relay + mute_relay + DCDR_NE); + else + data = (BYTE) (band_relay + transmit_relay + mute_relay); + if (usb_enabled) { + USB_Sdr1kLatch(SDR1K_LATCH_BPF, data); + } else { + PWrite(data); + Latch(BPF); + } +} + +PUBLIC BOOL getGainRelay (void) { + // Get state of GAIN relay on TRX board + if (gain_relay == GAIN) return FALSE; + else return TRUE; +} +PUBLIC void setGainRelay (BOOL value) { + // Save and output state of GAIN relay on TRX board + if (value == TRUE) gain_relay = 0; // 40dB or 0dB w/RFE + else gain_relay = GAIN; // 26dB + if (usb_enabled) + USB_Sdr1kLatch(SDR1K_LATCH_EXT, (BYTE) (external_output + gain_relay)); + else { + PWrite((BYTE) (external_output + gain_relay)); + Latch(EXT); + } +} + +PUBLIC int getExternalOutput (void) { return external_output; } +PUBLIC void setExternalOutput (int value) { + //Save and output state of External Control outputs on PIO board + external_output = value; + if (usb_enabled) + USB_Sdr1kLatch(SDR1K_LATCH_EXT, (BYTE) (external_output + gain_relay)); + else { + PWrite((BYTE) (external_output + gain_relay)); + Latch(EXT); + } +} + +PUBLIC double getDDSClockCorrection (void) { return dds_clock_correction; } +PUBLIC void setDDSClockCorrection (double value) { + dds_clock_correction = value; + CalcClock(); + SetRadioFreq(dds_freq); +} + +PUBLIC int getPLLMult (void) { return pll_mult; } +PUBLIC void setPLLMult (int value) { + pll_mult = value; + if (pll_mult == 1) DDSWrite(BYPASS_PLL, 30); // Bypass PLL if multiplier value is 1 + else DDSWrite((BYTE) pll_mult, 30); // Set for External Clock + CalcClock(); +} + +PUBLIC double getDDSClock (void) { return dds_clock; } +PUBLIC void setDDSClock (double value) { + //Compute internal DDS System Clock and Phase Truncation Elimination Step + dds_clock = value; + CalcClock(); +} + +PUBLIC BOOL getIFShift (void) { return if_shift; } +PUBLIC void setIFShift (BOOL value) { + // Turns IF shift on and off + if_shift = value; + if (!spur_reduction) { + if (if_shift) DttSP_ChangeOsc(-11025.0); + else DttSP_ChangeOsc(0.0); + } + SetRadioFreq(dds_freq); +} + +PUBLIC BOOL getSpurReduction (void) { return spur_reduction; } +PUBLIC BOOL setSpurReduction (BOOL value) { + // Turns DDS Phase Truncation Spur reduction on and off + spur_reduction = value; + if (!spur_reduction) { + if (if_shift) DttSP_ChangeOsc(-11025.0); + else DttSP_ChangeOsc(0.0); + } + SetRadioFreq(dds_freq); +} + +PUBLIC double getIFFreq (void) { return if_freq; } +PUBLIC void setIFFreq (double value) { if_freq = value; } + +PUBLIC double getDDSFreq (void) { return dds_freq; } +PUBLIC void setDDSFreq (double value) { + dds_freq = value; + SetRadioFreq(dds_freq); +} + +PUBLIC int getSampleRate (void) { return sample_rate; } +PUBLIC void setSampleRate (int value) { + sample_rate = value; + if (fft_length > 0) + FFT_Bin_Size = (sample_rate / fft_length) * 1e-6; +} + +PUBLIC int getFFTLength (void) { return fft_length; } +PUBLIC void setFFTLength (int value) { + fft_length = value; + //Compute bandwidth of FFT bin + if (fft_length > 0) + FFT_Bin_Size = (sample_rate / fft_length) * 1e-6; +} + +PUBLIC int getTuneFFT (void) { return tune_fft; } + +PUBLIC double getTuneFracRel (void) { return tune_frac_rel; } + +PUBLIC double getVFOOffset (void) { return vfo_offset; } +PUBLIC void setVFOOffset (double value) { + vfo_offset = value; + SetRadioFreq(dds_freq); +} + +PUBLIC int getIOUDClock (void) { return ioud_clock; } +PUBLIC void setIOUDClock (int value) { + double bitVal, bytVal; + BYTE lWord; + int i; + ioud_clock = value; //Save value + bitVal = value; //Compute Numeric Value + for (i = 24; i >= 0; i -= 8) { //Convert to binary strings + bytVal = bitVal / (01 << i); //Compute binary byte Value + lWord = (BYTE) bytVal; //Truncate fractional portion + bitVal -= lWord * (01 << i); //Reduce value + switch (i) { //Write to byte position + case 32: DDSWrite(lWord, 22); break; + case 16: DDSWrite(lWord, 23); break; + case 8: DDSWrite(lWord, 24); break; + case 0: DDSWrite(lWord, 25); break; + } + } +} + +PUBLIC u_short getDACMult (void) { return dac_mult; } +PUBLIC void setDACMult (u_short value) { + double bitVal, bytVal; + BYTE lWord; + int i; + dac_mult = value; + bitVal = value; //Compute Numeric Value + for (i = 8; i >= 0; i -= 8) { //Convert to binary strings + bytVal = bitVal / (01 << i); //Compute binary byte Value + BYTE lWord = (BYTE) bytVal; //Truncate fractional portion + bitVal -= lWord * (01 << i); //Reduce value + switch (i) { + case 8: DDSWrite(lWord, 33); break; + case 0: DDSWrite(lWord, 34); break; + } + } + //Send new I DAC Multiplier value to DDS + bitVal = value; //Compute Numeric Value + for (i = 8; i >= 0; i -= 8) { //Convert to binary strings. + bytVal = bitVal / (01 << i); //Compute binary byte Value + lWord = (BYTE) bytVal; //Truncate fractional portion + bitVal -= lWord * (01 << i); //Reduce value + switch (i) { //Write to byte position + case 8: DDSWrite(lWord, 35); break; + case 0: DDSWrite(lWord, 36); break; + } + } +} + +PUBLIC BYTE StatusPort(void) { + if (usb_enabled) + return (BYTE) USB_Sdr1kGetStatusPort(); + else { + BYTE status; + ioctl(parportfd, PPRSTATUS, (char *) &status); + return status; + } +} + +PUBLIC void Init(void) { + setIFShift(TRUE); + // user setable through the setup form + // DDSClockCorrection = 0.000; + setPLLMult(1); + setDDSClock(200); + setIFFreq(0.011025); + setSampleRate((int) DttSP_SampleRate); + setFFTLength(4096); + //setDACMult(4095); +} + +PUBLIC void PowerOn(void) { + if (rfe_enabled) { + // set mute/gain relays based on console + if (xvtr_enabled && current_xvtr_tr_mode == NEGATIVE) + setXVTR_TR_Relay(TRUE); + else + setXVTR_TR_Relay(FALSE); + //DDSFreq = dds_freq; + ic11_memory |= ADC_CS_NOT; // set CS_NOT high + ic11_memory |= ATUCTL; + ic7_memory |= PA_BIAS_NOT; + SRLoad(IC11, ic11_memory); + SRLoad(IC7, ic7_memory); + } +} + +PUBLIC void StandBy(void) { + ResetLatches(); + if (rfe_enabled) ResetRFE(); + if (xvtr_enabled) setXVTR_TR_Relay(FALSE); + // TODO: Fix bias glitch on reset w/hardware rewrite + if (rfe_enabled) { + SRLoad(IC7, PA_BIAS_NOT); + SRLoad(IC11, ADC_CS_NOT); + } + ResetDDS(); +} + +PUBLIC void SetExt(ExtPin pin) { + //Set the designated external pin high + external_output |= (BYTE) pin; + if (usb_enabled) + USB_Sdr1kLatch(SDR1K_LATCH_EXT, (BYTE) (external_output + gain_relay)); + else { + PWrite((BYTE) (external_output + gain_relay)); + Latch(EXT); + } +} + +PUBLIC void ResExt(ExtPin pin) { + //Reset the designated external pin high + external_output &= ~(BYTE) pin; + if (usb_enabled) + USB_Sdr1kLatch(SDR1K_LATCH_EXT, (BYTE) (external_output + gain_relay)); + else { + PWrite((BYTE) (external_output + gain_relay)); + Latch(EXT); + } +} + +PUBLIC BOOL PinValue(ExtPin pin) { + //Return TRUE if Pin is set + if ((external_output & (int) pin) != 0) + return TRUE; + else + return FALSE; +} + +PUBLIC void SetBPF(double vfo_value) { + if (rfe_enabled) { + if (vfo_value <= 2.5) { + if (pa_enabled) PA_SetLPF(PA_LPF_160); + if (vfo_value <= 0.3 && enable_LPF0) { + SRLoad(IC10, BPF0); + SRLoad(IC9, LPF0); + } else { + SRLoad(IC10, LPF9 + BPF0); + SRLoad(IC9, 0); + } + } else if (vfo_value <= 4) { + if (pa_enabled) PA_SetLPF(PA_LPF_80); + SRLoad(IC10, BPF1); + SRLoad(IC9, LPF7); + } else if (vfo_value <= 6) { + if (pa_enabled) PA_SetLPF(PA_LPF_60_40); + SRLoad(IC10, BPF1); + SRLoad(IC9, LPF2); + } else if (vfo_value <= 7.3) { + if (pa_enabled) PA_SetLPF(PA_LPF_60_40); + SRLoad(IC10, BPF2); + SRLoad(IC9, LPF5); + } else if (vfo_value <= 10.2) { + if (pa_enabled) PA_SetLPF(PA_LPF_30_20); + SRLoad(IC10, BPF2); + SRLoad(IC9, LPF4); + } else if (vfo_value <= 12) { + if (pa_enabled) PA_SetLPF(PA_LPF_OFF); + SRLoad(IC10, BPF2); + SRLoad(IC9, LPF3); + } else if (vfo_value <= 14.5) { + if (pa_enabled) PA_SetLPF(PA_LPF_30_20); + SRLoad(IC10, BPF3); + SRLoad(IC9, LPF3); + } else if (vfo_value <= 21.5) { + if (pa_enabled) PA_SetLPF(PA_LPF_17_15); + SRLoad(IC10, BPF3 + LPF8); + SRLoad(IC9, 0); + } else if (vfo_value <= 24) { + if (pa_enabled) PA_SetLPF(PA_LPF_12_10); + SRLoad(IC10, BPF3); + SRLoad(IC9, LPF6); + } else if (vfo_value <= 30) { + if (pa_enabled) PA_SetLPF(PA_LPF_12_10); + SRLoad(IC10, BPF4); + SRLoad(IC9, LPF6); + } else if (vfo_value <= 36) { + if (pa_enabled) PA_SetLPF(PA_LPF_OFF); + SRLoad(IC10, BPF4); + SRLoad(IC9, LPF1); + } else if (vfo_value <= 65) { + if (pa_enabled) PA_SetLPF(PA_LPF_OFF); + SRLoad(IC10, BPF5); + SRLoad(IC9, LPF1); + } else if (xvtr_enabled && vfo_value >= 144 && vfo_value <= 146) { + if (pa_enabled) PA_SetLPF(PA_LPF_OFF); + SRLoad(IC10, BPF4); + SRLoad(IC9, LPF6); + setXVTR_Relay(TRUE); + } + if (xvtr_enabled && vfo_value < 144) + setXVTR_Relay(FALSE); + } else { + if (vfo_value < 2.5) setBandRelay(bs0); + else if (vfo_value < 6) setBandRelay(bs1); + else if (vfo_value < 12) setBandRelay(bs2); + else if (vfo_value < 24) setBandRelay(bs3); + else if (vfo_value < 36) setBandRelay(bs4); + else setBandRelay(bs5); + } +} + +PUBLIC void TestPort(void) { + //Toggle 1 and 0 to each of the four parallel port latches + if (usb_enabled) { + USB_Sdr1kLatch(SDR1K_LATCH_BPF, 0); + USB_Sdr1kLatch(SDR1K_LATCH_EXT, 0); + USB_Sdr1kLatch(SDR1K_LATCH_BPF, 255); + USB_Sdr1kLatch(SDR1K_LATCH_EXT, 255); + } else { + PWrite(0); + Latch(BPF); + Latch(ADR); + Latch(DAT); + Latch(EXT); + PWrite(255); + Latch(BPF); + Latch(ADR); + Latch(DAT); + Latch(EXT); + } +} + +PUBLIC void RCKStrobe(BOOL ClearReg, RFE_RCK Reg) { + // Strobe the RFE 1:4 decoder output to transfer contents + // of shift register to output latches + BYTE data = 0; + if (ClearReg) data = (BYTE) (Reg); + else data = (BYTE) (SCLR_NOT + Reg + transmit_relay + mute_relay); + if (usb_enabled) { + USB_Sdr1kLatch(SDR1K_LATCH_BPF, data); + USB_Sdr1kLatch(SDR1K_LATCH_BPF, (BYTE) (SCLR_NOT + DCDR_NE + transmit_relay + mute_relay)); + } else { + PWrite(data); + Latch(BPF); + PWrite((BYTE) (SCLR_NOT + DCDR_NE + transmit_relay + mute_relay)); + Latch(BPF); + } +} + +PUBLIC void SRLoad(RFE_RCK Reg, int Data) { + if (usb_enabled) + USB_Sdr1kSRLoad((BYTE) Reg, (BYTE) Data); + else { + static int choose[8] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01}; + int i; + //Shift data into registers on RFE + //parallel_mutex.WaitOne(); + for (i = 0; i < 8; i++) { + int mask = choose[i]; // Mask the current bit + if ((mask & Data) == 0) { + PWrite((BYTE) (SCLR_NOT + DCDR_NE + transmit_relay + mute_relay)); + Latch(BPF); + PWrite((BYTE) (SCLR_NOT + DCDR_NE + SCK + transmit_relay + mute_relay)); + } else { // Current bit = 1 { + PWrite((BYTE) (SCLR_NOT + DCDR_NE + SER + transmit_relay + mute_relay)); + Latch(BPF); + PWrite((BYTE) (SCLR_NOT + DCDR_NE + SER + SCK + transmit_relay + mute_relay)); + } + Latch(BPF); + PWrite((BYTE) (SCLR_NOT + DCDR_NE + transmit_relay + mute_relay)); + Latch(BPF); + } + RCKStrobe(FALSE, Reg); // Strobe Register Clock + //parallel_mutex.ReleaseMutex(); + } +} + +PUBLIC void ResetRFE(void) { + //Reset all RFE shift registers to zero output + //parallel_mutex.WaitOne(); + RCKStrobe(TRUE, IC11); + RCKStrobe(TRUE, IC7); + RCKStrobe(TRUE, IC10); + RCKStrobe(TRUE, IC9); + //parallel_mutex.ReleaseMutex(); +} + +PUBLIC BOOL getAMP_Relay (void) { return (ic7_memory & AMP_RLYS) != 0; } +PUBLIC BOOL setAMP_Relay (BOOL value) { + //Set or reset LNA relay + if (value) ic7_memory |= AMP_RLYS; + else ic7_memory &= ~(AMP_RLYS); + SRLoad(IC7, ic7_memory); +} + +PUBLIC BOOL getATTN_Relay (void) { return (ic7_memory & ATTN_RLY) != 0; } +PUBLIC void setATTN_Relay (BOOL value) { + if (value) ic7_memory |= ATTN_RLY; + else ic7_memory &= ~(ATTN_RLY); + SRLoad(IC7, ic7_memory); +} + +PUBLIC BOOL getXVTR_TR_Relay (void) { return (ic7_memory & XVTR_TR_RLY) != 0; } +PUBLIC BOOL setXVTR_TR_Relay (BOOL value) { + if (value) ic7_memory |= XVTR_TR_RLY; + else ic7_memory &= ~(XVTR_TR_RLY); + SRLoad(IC7, ic7_memory); +} + +PUBLIC BOOL getXVTR_Relay (void) { return (ic7_memory & XVTR_RLY) != 0; } +PUBLIC BOOL setXVTR_Relay (BOOL value) { + if (value) ic7_memory |= XVTR_RLY; + else ic7_memory &= ~(XVTR_RLY); + SRLoad(IC7, ic7_memory); +} + +PUBLIC BOOL getIMPULSE_Relay (void) { return (ic7_memory & IMPULSE_RLY) != 0; } +PUBLIC BOOL setIMPULSE_Relay (BOOL value) { + if (value) ic7_memory |= IMPULSE_RLY; + else ic7_memory &= ~(IMPULSE_RLY); + SRLoad(IC7, ic7_memory); +} + +PUBLIC void Impulse(void) { + //Send a single impulse to the QSD + SRLoad(IC7, (ic7_memory | IMPULSE)); + SRLoad(IC7, ic7_memory); +} + +PUBLIC void PA_SetLPF(int i) { + int temp = ic11_memory; + switch(i) { + case PA_LPF_OFF: // 0 + ic11_memory &= ~(0x07); // clear bits 0, 1 and 2 + break; + case PA_LPF_12_10: // 1 + ic11_memory = (ic11_memory | 0x01) & ~(0x06); // set bit 0, clear bits 1,2 + break; + case PA_LPF_17_15: // 2 + ic11_memory = (ic11_memory | 0x02) & ~(0x05); // set bit 1, clear bits 0,2 + break; + case PA_LPF_30_20: // 3 + ic11_memory = (ic11_memory | 0x03) & ~(0x04); // set bits 0,1, clear bit 2 + break; + case PA_LPF_60_40: // 4 + ic11_memory = (ic11_memory | 0x04) & ~(0x03); // set bit 2, clear bits 0,1 + break; + case PA_LPF_80: // 5 + ic11_memory = (ic11_memory | 0x05) & ~(0x02); // set bits 0,2, clear bit 1 + break; + case PA_LPF_160: // 6 + ic11_memory = (ic11_memory | 0x06) & ~(0x01); // set bits 1,2, clear bit 0 + break; + } + if (temp != ic11_memory) + SRLoad(IC11, ic11_memory); +} + +PUBLIC BOOL getPA_TransmitRelay (void) { return ((ic11_memory & PATR) != 0); } +PUBLIC BOOL setPA_TransmitRelay (BOOL value) { + int temp = ic11_memory; + if (value) ic11_memory |= PATR; + else ic11_memory &= ~(PATR); + if (temp != ic11_memory) + SRLoad(IC11, ic11_memory); +} + +PUBLIC BOOL getPA_BiasOn (void) { return ((ic7_memory & PA_BIAS_NOT) != 0); } +PUBLIC BOOL setPA_BiasOn (BOOL value) { + int temp = ic7_memory; + if (value) ic7_memory &= ~(PA_BIAS_NOT); + else ic7_memory |= PA_BIAS_NOT; + if (temp != ic7_memory) + SRLoad(IC7, ic7_memory); +} + +PUBLIC BYTE PA_GetADC(int chan) { + short num = 0; + int i; + // get ADC on amplifier + // 0 for forward power, 1 for reverse + + if (usb_enabled) { + int data = USB_Sdr1kGetADC(); + if (chan == 0) return (BYTE) (data & 255); + else return (BYTE) (data >> 8); + } + + //dataline_mutex.WaitOne(); + //parallel_mutex.WaitOne(); + + ic11_memory &= ~(ADC_CS_NOT); // CS not goes low + SRLoad(IC11, ic11_memory); + + ic11_memory |= ADC_DI; // set DI bit high for start bit + SRLoad(IC11, ic11_memory); + + ic11_memory |= ADC_CLK; // clock it into shift register + SRLoad(IC11, ic11_memory); + ic11_memory &= ~(ADC_CLK); + SRLoad(IC11, ic11_memory); + + // set DI bit high for single ended -- done since DI is already high + ic11_memory |= ADC_CLK; // clock it into shift register + SRLoad(IC11, ic11_memory); + ic11_memory &= ~(ADC_CLK); + SRLoad(IC11, ic11_memory); + + if (chan == PA_FORWARD_PWR) { + ic11_memory &= ~(ADC_DI); // set DI bit low for Channel 0 + SRLoad(IC11, ic11_memory); + } else { + // set DI bit high for Channel 1 -- done since DI is already high + } + + ic11_memory |= ADC_CLK; // clock it into shift register + SRLoad(IC11, ic11_memory); + ic11_memory &= ~(ADC_CLK); + SRLoad(IC11, ic11_memory); + + for(i = 0; i < 8; i++) { // read 15 bits out of DO + ic11_memory |= ADC_CLK; // clock high + SRLoad(IC11, ic11_memory); + ic11_memory &= ~(ADC_CLK); // clock low + SRLoad(IC11, ic11_memory); + + if ((StatusPort() & (BYTE) PA_DATA) != 0) // read DO + num++; // add bit + + if (i != 7) num <<= 1; + } + + ic11_memory |= ADC_CS_NOT; // CS not goes high + SRLoad(IC11, ic11_memory); + + //dataline_mutex.ReleaseMutex(); + //parallel_mutex.ReleaseMutex(); + + return (BYTE) (num); +} + +PUBLIC BOOL PA_ATUTune(ATUTuneMode mode) { + int count = 0, delay = 0; + + //dataline_mutex.WaitOne(); + + ic11_memory &= ~(ATUCTL); + + SRLoad(IC11, ic11_memory); + switch (mode) { + case BYPASS: delay = 250; break; + case MEMORY: delay = 2000; break; + case FULL: delay = 3250; break; + } + + Sleep(delay); + ic11_memory |= ATUCTL; + SRLoad(IC11, ic11_memory); + + if (mode == MEMORY || mode == FULL) { + while ((StatusPort() & (BYTE) PA_DATA) != 0) { // wait for low output from ATU + Sleep(50); + if (count++ > 100) return FALSE; + } + count = 0; + while ((StatusPort() & (BYTE) PA_DATA) == 0) { // wait for high output from ATU + Sleep(50); + if (count++ > 100) return FALSE; + } + Sleep(1000); + } + + //dataline_mutex.ReleaseMutex(); + + return TRUE; +} diff --git a/pyhw2/hardware.i b/pyhw2/hardware.i new file mode 100644 index 0000000..99a24ff --- /dev/null +++ b/pyhw2/hardware.i @@ -0,0 +1,5 @@ +%module sdr1khw +%{ +#include "hardware.h" +%} +%include "hardware.h" diff --git a/pyhw2/hardware_wrap.c b/pyhw2/hardware_wrap.c new file mode 100644 index 0000000..b169522 --- /dev/null +++ b/pyhw2/hardware_wrap.c @@ -0,0 +1,3927 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 1.3.22 + * + * This file is not intended to be easily readable and contains a number of + * coding conventions designed to improve portability and efficiency. Do not make + * changes to this file unless you know what you are doing--modify the SWIG + * interface file instead. + * ----------------------------------------------------------------------------- */ + +#define SWIGPYTHON + +#include "Python.h" + +/*************************************************************** -*- c -*- + * python/precommon.swg + * + * Rename all exported symbols from common.swg, to avoid symbol + * clashes if multiple interpreters are included + * + ************************************************************************/ + +#define SWIG_TypeRegister SWIG_Python_TypeRegister +#define SWIG_TypeCheck SWIG_Python_TypeCheck +#define SWIG_TypeCast SWIG_Python_TypeCast +#define SWIG_TypeDynamicCast SWIG_Python_TypeDynamicCast +#define SWIG_TypeName SWIG_Python_TypeName +#define SWIG_TypePrettyName SWIG_Python_TypePrettyName +#define SWIG_TypeQuery SWIG_Python_TypeQuery +#define SWIG_TypeClientData SWIG_Python_TypeClientData +#define SWIG_PackData SWIG_Python_PackData +#define SWIG_UnpackData SWIG_Python_UnpackData + + +/*********************************************************************** + * common.swg + * + * This file contains generic SWIG runtime support for pointer + * type checking as well as a few commonly used macros to control + * external linkage. + * + * Author : David Beazley (beazley@cs.uchicago.edu) + * + * Copyright (c) 1999-2000, The University of Chicago + * + * This file may be freely redistributed without license or fee provided + * this copyright message remains intact. + ************************************************************************/ + +#include + +#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# if defined(_MSC_VER) || defined(__GNUC__) +# if defined(STATIC_LINKED) +# define SWIGEXPORT(a) a +# define SWIGIMPORT(a) extern a +# else +# define SWIGEXPORT(a) __declspec(dllexport) a +# define SWIGIMPORT(a) extern a +# endif +# else +# if defined(__BORLANDC__) +# define SWIGEXPORT(a) a _export +# define SWIGIMPORT(a) a _export +# else +# define SWIGEXPORT(a) a +# define SWIGIMPORT(a) a +# endif +# endif +#else +# define SWIGEXPORT(a) a +# define SWIGIMPORT(a) a +#endif + +#ifdef SWIG_GLOBAL +# define SWIGRUNTIME(a) SWIGEXPORT(a) +#else +# define SWIGRUNTIME(a) static a +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void *(*swig_converter_func)(void *); +typedef struct swig_type_info *(*swig_dycast_func)(void **); + +typedef struct swig_type_info { + const char *name; + swig_converter_func converter; + const char *str; + void *clientdata; + swig_dycast_func dcast; + struct swig_type_info *next; + struct swig_type_info *prev; +} swig_type_info; + +#ifdef SWIG_NOINCLUDE + +SWIGIMPORT(swig_type_info *) SWIG_TypeRegister(swig_type_info *); +SWIGIMPORT(swig_type_info *) SWIG_TypeCheck(char *c, swig_type_info *); +SWIGIMPORT(void *) SWIG_TypeCast(swig_type_info *, void *); +SWIGIMPORT(swig_type_info *) SWIG_TypeDynamicCast(swig_type_info *, void **); +SWIGIMPORT(const char *) SWIG_TypeName(const swig_type_info *); +SWIGIMPORT(const char *) SWIG_TypePrettyName(const swig_type_info *); +SWIGIMPORT(swig_type_info *) SWIG_TypeQuery(const char *); +SWIGIMPORT(void) SWIG_TypeClientData(swig_type_info *, void *); +SWIGIMPORT(char *) SWIG_PackData(char *, void *, int); +SWIGIMPORT(char *) SWIG_UnpackData(char *, void *, int); + +#else + +static swig_type_info *swig_type_list = 0; +static swig_type_info **swig_type_list_handle = &swig_type_list; + +/* Register a type mapping with the type-checking */ +SWIGRUNTIME(swig_type_info *) +SWIG_TypeRegister(swig_type_info *ti) { + swig_type_info *tc, *head, *ret, *next; + /* Check to see if this type has already been registered */ + tc = *swig_type_list_handle; + while (tc) { + if (strcmp(tc->name, ti->name) == 0) { + /* Already exists in the table. Just add additional types to the list */ + if (tc->clientdata) ti->clientdata = tc->clientdata; + head = tc; + next = tc->next; + goto l1; + } + tc = tc->prev; + } + head = ti; + next = 0; + + /* Place in list */ + ti->prev = *swig_type_list_handle; + *swig_type_list_handle = ti; + + /* Build linked lists */ + l1: + ret = head; + tc = ti + 1; + /* Patch up the rest of the links */ + while (tc->name) { + head->next = tc; + tc->prev = head; + head = tc; + tc++; + } + if (next) next->prev = head; + head->next = next; + return ret; +} + +/* Check the typename */ +SWIGRUNTIME(swig_type_info *) +SWIG_TypeCheck(char *c, swig_type_info *ty) { + swig_type_info *s; + if (!ty) return 0; /* Void pointer */ + s = ty->next; /* First element always just a name */ + do { + if (strcmp(s->name,c) == 0) { + if (s == ty->next) return s; + /* Move s to the top of the linked list */ + s->prev->next = s->next; + if (s->next) { + s->next->prev = s->prev; + } + /* Insert s as second element in the list */ + s->next = ty->next; + if (ty->next) ty->next->prev = s; + ty->next = s; + s->prev = ty; + return s; + } + s = s->next; + } while (s && (s != ty->next)); + return 0; +} + +/* Cast a pointer up an inheritance hierarchy */ +SWIGRUNTIME(void *) +SWIG_TypeCast(swig_type_info *ty, void *ptr) { + if ((!ty) || (!ty->converter)) return ptr; + return (*ty->converter)(ptr); +} + +/* Dynamic pointer casting. Down an inheritance hierarchy */ +SWIGRUNTIME(swig_type_info *) +SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { + swig_type_info *lastty = ty; + if (!ty || !ty->dcast) return ty; + while (ty && (ty->dcast)) { + ty = (*ty->dcast)(ptr); + if (ty) lastty = ty; + } + return lastty; +} + +/* Return the name associated with this type */ +SWIGRUNTIME(const char *) +SWIG_TypeName(const swig_type_info *ty) { + return ty->name; +} + +/* Return the pretty name associated with this type, + that is an unmangled type name in a form presentable to the user. +*/ +SWIGRUNTIME(const char *) +SWIG_TypePrettyName(const swig_type_info *type) { + /* The "str" field contains the equivalent pretty names of the + type, separated by vertical-bar characters. We choose + to print the last name, as it is often (?) the most + specific. */ + if (type->str != NULL) { + const char *last_name = type->str; + const char *s; + for (s = type->str; *s; s++) + if (*s == '|') last_name = s+1; + return last_name; + } + else + return type->name; +} + +/* + Compare two type names skipping the space characters, therefore + "char*" == "char *" and "Class" == "Class", etc. + + Return 0 when the two name types are equivalent, as in + strncmp, but skipping ' '. +*/ +static int +SWIG_TypeNameComp(const char *f1, const char *l1, + const char *f2, const char *l2) { + for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { + while ((*f1 == ' ') && (f1 != l1)) ++f1; + while ((*f2 == ' ') && (f2 != l2)) ++f2; + if (*f1 != *f2) return *f1 - *f2; + } + return (l1 - f1) - (l2 - f2); +} + +/* + Check type equivalence in a name list like ||... +*/ +static int +SWIG_TypeEquiv(const char *nb, const char *tb) { + int equiv = 0; + const char* te = tb + strlen(tb); + const char* ne = nb; + while (!equiv && *ne) { + for (nb = ne; *ne; ++ne) { + if (*ne == '|') break; + } + equiv = SWIG_TypeNameComp(nb, ne, tb, te) == 0; + if (*ne) ++ne; + } + return equiv; +} + + +/* Search for a swig_type_info structure */ +SWIGRUNTIME(swig_type_info *) +SWIG_TypeQuery(const char *name) { + swig_type_info *ty = *swig_type_list_handle; + while (ty) { + if (ty->str && (SWIG_TypeEquiv(ty->str,name))) return ty; + if (ty->name && (strcmp(name,ty->name) == 0)) return ty; + ty = ty->prev; + } + return 0; +} + +/* Set the clientdata field for a type */ +SWIGRUNTIME(void) +SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { + swig_type_info *tc, *equiv; + if (ti->clientdata == clientdata) return; + ti->clientdata = clientdata; + equiv = ti->next; + while (equiv) { + if (!equiv->converter) { + tc = *swig_type_list_handle; + while (tc) { + if ((strcmp(tc->name, equiv->name) == 0)) + SWIG_TypeClientData(tc,clientdata); + tc = tc->prev; + } + } + equiv = equiv->next; + } +} + +/* Pack binary data into a string */ +SWIGRUNTIME(char *) +SWIG_PackData(char *c, void *ptr, int sz) { + static char hex[17] = "0123456789abcdef"; + unsigned char *u = (unsigned char *) ptr; + const unsigned char *eu = u + sz; + register unsigned char uu; + for (; u != eu; ++u) { + uu = *u; + *(c++) = hex[(uu & 0xf0) >> 4]; + *(c++) = hex[uu & 0xf]; + } + return c; +} + +/* Unpack binary data from a string */ +SWIGRUNTIME(char *) +SWIG_UnpackData(char *c, void *ptr, int sz) { + register unsigned char uu = 0; + register int d; + unsigned char *u = (unsigned char *) ptr; + const unsigned char *eu = u + sz; + for (; u != eu; ++u) { + d = *(c++); + if ((d >= '0') && (d <= '9')) + uu = ((d - '0') << 4); + else if ((d >= 'a') && (d <= 'f')) + uu = ((d - ('a'-10)) << 4); + d = *(c++); + if ((d >= '0') && (d <= '9')) + uu |= (d - '0'); + else if ((d >= 'a') && (d <= 'f')) + uu |= (d - ('a'-10)); + *u = uu; + } + return c; +} + +#endif + +#ifdef __cplusplus +} +#endif + +/*********************************************************************** + * pyrun.swg + * + * This file contains the runtime support for Python modules + * and includes code for managing global variables and pointer + * type checking. + * + * Author : David Beazley (beazley@cs.uchicago.edu) + ************************************************************************/ + +#ifdef __cplusplus +extern "C" { +#endif + +#define SWIG_PY_INT 1 +#define SWIG_PY_FLOAT 2 +#define SWIG_PY_STRING 3 +#define SWIG_PY_POINTER 4 +#define SWIG_PY_BINARY 5 + +/* Flags for pointer conversion */ + +#define SWIG_POINTER_EXCEPTION 0x1 +#define SWIG_POINTER_DISOWN 0x2 + +/* Exception handling in wrappers */ +#define SWIG_fail goto fail + +/* Constant information structure */ +typedef struct swig_const_info { + int type; + char *name; + long lvalue; + double dvalue; + void *pvalue; + swig_type_info **ptype; +} swig_const_info; + +/* Common SWIG API */ +#define SWIG_ConvertPtr(obj, pp, type, flags) \ + SWIG_Python_ConvertPtr(obj, pp, type, flags) +#define SWIG_NewPointerObj(p, type, flags) \ + SWIG_Python_NewPointerObj(p, type, flags) +#define SWIG_MustGetPtr(p, type, argnum, flags) \ + SWIG_Python_MustGetPtr(p, type, argnum, flags) + +/* Python-specific SWIG API */ +#define SWIG_newvarlink() \ + SWIG_Python_newvarlink() +#define SWIG_addvarlink(p, name, get_attr, set_attr) \ + SWIG_Python_addvarlink(p, name, get_attr, set_attr) +#define SWIG_ConvertPacked(obj, ptr, sz, ty, flags) \ + SWIG_Python_ConvertPacked(obj, ptr, sz, ty, flags) +#define SWIG_NewPackedObj(ptr, sz, type) \ + SWIG_Python_NewPackedObj(ptr, sz, type) +#define SWIG_InstallConstants(d, constants) \ + SWIG_Python_InstallConstants(d, constants) + +typedef double (*py_objasdbl_conv)(PyObject *obj); + +#ifdef SWIG_NOINCLUDE + +SWIGIMPORT(int) SWIG_Python_ConvertPtr(PyObject *, void **, swig_type_info *, int); +SWIGIMPORT(PyObject *) SWIG_Python_NewPointerObj(void *, swig_type_info *,int own); +SWIGIMPORT(void *) SWIG_Python_MustGetPtr(PyObject *, swig_type_info *, int, int); +SWIGIMPORT(PyObject *) SWIG_Python_newvarlink(void); +SWIGIMPORT(void) SWIG_Python_addvarlink(PyObject *, char *, PyObject *(*)(void), int (*)(PyObject *)); +SWIGIMPORT(int) SWIG_Python_ConvertPacked(PyObject *, void *, int sz, swig_type_info *, int); +SWIGIMPORT(PyObject *) SWIG_Python_NewPackedObj(void *, int sz, swig_type_info *); +SWIGIMPORT(void) SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]); + + +#else + + +/* ----------------------------------------------------------------------------- + * global variable support code. + * ----------------------------------------------------------------------------- */ + +typedef struct swig_globalvar { + char *name; /* Name of global variable */ + PyObject *(*get_attr)(void); /* Return the current value */ + int (*set_attr)(PyObject *); /* Set the value */ + struct swig_globalvar *next; +} swig_globalvar; + +typedef struct swig_varlinkobject { + PyObject_HEAD + swig_globalvar *vars; +} swig_varlinkobject; + +static PyObject * +swig_varlink_repr(swig_varlinkobject *v) { + v = v; + return PyString_FromString(""); +} + +static int +swig_varlink_print(swig_varlinkobject *v, FILE *fp, int flags) { + swig_globalvar *var; + flags = flags; + fprintf(fp,"Global variables { "); + for (var = v->vars; var; var=var->next) { + fprintf(fp,"%s", var->name); + if (var->next) fprintf(fp,", "); + } + fprintf(fp," }\n"); + return 0; +} + +static PyObject * +swig_varlink_getattr(swig_varlinkobject *v, char *n) { + swig_globalvar *var = v->vars; + while (var) { + if (strcmp(var->name,n) == 0) { + return (*var->get_attr)(); + } + var = var->next; + } + PyErr_SetString(PyExc_NameError,"Unknown C global variable"); + return NULL; +} + +static int +swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) { + swig_globalvar *var = v->vars; + while (var) { + if (strcmp(var->name,n) == 0) { + return (*var->set_attr)(p); + } + var = var->next; + } + PyErr_SetString(PyExc_NameError,"Unknown C global variable"); + return 1; +} + +statichere PyTypeObject varlinktype = { + PyObject_HEAD_INIT(0) + 0, /* Number of items in variable part (ob_size) */ + (char *)"swigvarlink", /* Type name (tp_name) */ + sizeof(swig_varlinkobject), /* Basic size (tp_basicsize) */ + 0, /* Itemsize (tp_itemsize) */ + 0, /* Deallocator (tp_dealloc) */ + (printfunc) swig_varlink_print, /* Print (tp_print) */ + (getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */ + (setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */ + 0, /* tp_compare */ + (reprfunc) swig_varlink_repr, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + 0, /* tp_flags */ + 0, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ +#if PY_VERSION_HEX >= 0x02020000 + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + 0, /* tp_free */ + 0, /* tp_is_gc */ + 0, /* tp_bases */ + 0, /* tp_mro */ + 0, /* tp_cache */ + 0, /* tp_subclasses */ + 0, /* tp_weaklist */ +#endif +#if PY_VERSION_HEX >= 0x02030200 + 0, /* tp_del */ +#endif +#ifdef COUNT_ALLOCS + /* these must be last */ + 0, /* tp_alloc */ + 0, /* tp_free */ + 0, /* tp_maxalloc */ + 0, /* tp_next */ +#endif +}; + +/* Create a variable linking object for use later */ +SWIGRUNTIME(PyObject *) +SWIG_Python_newvarlink(void) { + swig_varlinkobject *result = 0; + result = PyMem_NEW(swig_varlinkobject,1); + varlinktype.ob_type = &PyType_Type; /* Patch varlinktype into a PyType */ + result->ob_type = &varlinktype; + result->vars = 0; + result->ob_refcnt = 0; + Py_XINCREF((PyObject *) result); + return ((PyObject*) result); +} + +SWIGRUNTIME(void) +SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) { + swig_varlinkobject *v; + swig_globalvar *gv; + v= (swig_varlinkobject *) p; + gv = (swig_globalvar *) malloc(sizeof(swig_globalvar)); + gv->name = (char *) malloc(strlen(name)+1); + strcpy(gv->name,name); + gv->get_attr = get_attr; + gv->set_attr = set_attr; + gv->next = v->vars; + v->vars = gv; +} + +/* Convert a pointer value */ +SWIGRUNTIME(int) +SWIG_Python_ConvertPtr(PyObject *obj, void **ptr, swig_type_info *ty, int flags) { + swig_type_info *tc; + char *c = 0; + static PyObject *SWIG_this = 0; + int newref = 0; + PyObject *pyobj = 0; + + if (!obj) return 0; + if (obj == Py_None) { + *ptr = 0; + return 0; + } +#ifdef SWIG_COBJECT_TYPES + if (!(PyCObject_Check(obj))) { + if (!SWIG_this) + SWIG_this = PyString_FromString("this"); + pyobj = obj; + obj = PyObject_GetAttr(obj,SWIG_this); + newref = 1; + if (!obj) goto type_error; + if (!PyCObject_Check(obj)) { + Py_DECREF(obj); + goto type_error; + } + } + *ptr = PyCObject_AsVoidPtr(obj); + c = (char *) PyCObject_GetDesc(obj); + if (newref) Py_DECREF(obj); + goto cobject; +#else + if (!(PyString_Check(obj))) { + if (!SWIG_this) + SWIG_this = PyString_FromString("this"); + pyobj = obj; + obj = PyObject_GetAttr(obj,SWIG_this); + newref = 1; + if (!obj) goto type_error; + if (!PyString_Check(obj)) { + Py_DECREF(obj); + goto type_error; + } + } + c = PyString_AS_STRING(obj); + /* Pointer values must start with leading underscore */ + if (*c != '_') { + *ptr = (void *) 0; + if (strcmp(c,"NULL") == 0) { + if (newref) { Py_DECREF(obj); } + return 0; + } else { + if (newref) { Py_DECREF(obj); } + goto type_error; + } + } + c++; + c = SWIG_UnpackData(c,ptr,sizeof(void *)); + if (newref) { Py_DECREF(obj); } +#endif + +#ifdef SWIG_COBJECT_TYPES +cobject: +#endif + + if (ty) { + tc = SWIG_TypeCheck(c,ty); + if (!tc) goto type_error; + *ptr = SWIG_TypeCast(tc,(void*) *ptr); + } + + if ((pyobj) && (flags & SWIG_POINTER_DISOWN)) { + PyObject_SetAttrString(pyobj,(char*)"thisown",Py_False); + } + return 0; + +type_error: + PyErr_Clear(); + if (flags & SWIG_POINTER_EXCEPTION) { + if (ty && c) { + PyErr_Format(PyExc_TypeError, + "Type error. Got %s, expected %s", + c, ty->name); + } else { + PyErr_SetString(PyExc_TypeError,"Expected a pointer"); + } + } + return -1; +} + +/* Convert a pointer value, signal an exception on a type mismatch */ +SWIGRUNTIME(void *) +SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) { + void *result; + SWIG_Python_ConvertPtr(obj, &result, ty, flags | SWIG_POINTER_EXCEPTION); + return result; +} + +/* Convert a packed value value */ +SWIGRUNTIME(int) +SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, int sz, swig_type_info *ty, int flags) { + swig_type_info *tc; + char *c = 0; + + if ((!obj) || (!PyString_Check(obj))) goto type_error; + c = PyString_AS_STRING(obj); + /* Pointer values must start with leading underscore */ + if (*c != '_') goto type_error; + c++; + c = SWIG_UnpackData(c,ptr,sz); + if (ty) { + tc = SWIG_TypeCheck(c,ty); + if (!tc) goto type_error; + } + return 0; + +type_error: + + if (flags) { + if (ty && c) { + PyErr_Format(PyExc_TypeError, + "Type error. Got %s, expected %s", + c, ty->name); + } else { + PyErr_SetString(PyExc_TypeError,"Expected a pointer"); + } + } + return -1; +} + +/* Create a new pointer object */ +SWIGRUNTIME(PyObject *) +SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int own) { + PyObject *robj; + if (!ptr) { + Py_INCREF(Py_None); + return Py_None; + } +#ifdef SWIG_COBJECT_TYPES + robj = PyCObject_FromVoidPtrAndDesc((void *) ptr, (char *) type->name, NULL); +#else + { + char result[1024]; + char *r = result; + *(r++) = '_'; + r = SWIG_PackData(r,&ptr,sizeof(void *)); + strcpy(r,type->name); + robj = PyString_FromString(result); + } +#endif + if (!robj || (robj == Py_None)) return robj; + if (type->clientdata) { + PyObject *inst; + PyObject *args = Py_BuildValue((char*)"(O)", robj); + Py_DECREF(robj); + inst = PyObject_CallObject((PyObject *) type->clientdata, args); + Py_DECREF(args); + if (inst) { + if (own) { + PyObject_SetAttrString(inst,(char*)"thisown",Py_True); + } + robj = inst; + } + } + return robj; +} + +SWIGRUNTIME(PyObject *) +SWIG_Python_NewPackedObj(void *ptr, int sz, swig_type_info *type) { + char result[1024]; + char *r = result; + if ((2*sz + 1 + strlen(type->name)) > 1000) return 0; + *(r++) = '_'; + r = SWIG_PackData(r,ptr,sz); + strcpy(r,type->name); + return PyString_FromString(result); +} + +/* Install Constants */ +SWIGRUNTIME(void) +SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) { + int i; + PyObject *obj; + for (i = 0; constants[i].type; i++) { + switch(constants[i].type) { + case SWIG_PY_INT: + obj = PyInt_FromLong(constants[i].lvalue); + break; + case SWIG_PY_FLOAT: + obj = PyFloat_FromDouble(constants[i].dvalue); + break; + case SWIG_PY_STRING: + if (constants[i].pvalue) { + obj = PyString_FromString((char *) constants[i].pvalue); + } else { + Py_INCREF(Py_None); + obj = Py_None; + } + break; + case SWIG_PY_POINTER: + obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0); + break; + case SWIG_PY_BINARY: + obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype)); + break; + default: + obj = 0; + break; + } + if (obj) { + PyDict_SetItemString(d,constants[i].name,obj); + Py_DECREF(obj); + } + } +} + +#endif + +/* Contract support */ + +#define SWIG_contract_assert(expr, msg) if (!(expr)) { PyErr_SetString(PyExc_RuntimeError, (char *) msg ); goto fail; } else + +#ifdef __cplusplus +} +#endif + + +/* -------- TYPES TABLE (BEGIN) -------- */ + +#define SWIGTYPE_p_ushort swig_types[0] +#define SWIGTYPE_p_char swig_types[1] +#define SWIGTYPE_p_u_short swig_types[2] +static swig_type_info *swig_types[4]; + +/* -------- TYPES TABLE (END) -------- */ + + +/*----------------------------------------------- + @(target):= _sdr1khw.so + ------------------------------------------------*/ +#define SWIG_init init_sdr1khw + +#define SWIG_name "_sdr1khw" + +/* Auxiliar swig macros that appear in the header */ + +#define SWIG_OLDOBJ 1 +#define SWIG_NEWOBJ SWIG_OLDOBJ + 1 +#define SWIG_PYSTR SWIG_NEWOBJ + 1 + +#ifdef __cplusplus +#define SWIGSTATICINLINE(a) static inline a +#define SWIGSTATIC(a) static a +#define swig_new_array(size,Type) (new Type[(size)]) +#define swig_delete(cptr) delete cptr +#define swig_delete_array(cptr) delete[] cptr +#define swig_const_cast(a,Type) const_cast(a) +#define swig_static_cast(a,Type) static_cast(a) +#define swig_reinterpret_cast(a,Type) reinterpret_cast(a) +#define swig_new_copy(ptr,Type) (new Type(*ptr)) +#define swig_numeric_cast(a,Type) static_cast(a) + +#else /* C case */ + +#define SWIGSTATICINLINE(a) static a +#define SWIGSTATIC(a) static a +#define swig_new_array(size,Type) ((Type*) malloc((size)*sizeof(Type))) +#define swig_delete(cptr) free((char*)cptr) +#define swig_delete_array(cptr) free((char*)cptr) +#define swig_const_cast(a,Type) (Type)(a) +#define swig_static_cast(a,Type) (Type)(a) +#define swig_reinterpret_cast(a,Type) (Type)(a) +#define swig_numeric_cast(a,Type) (Type)(a) +#define swig_new_copy(ptr,Type) ((Type*)memcpy(malloc(sizeof(Type)),ptr,sizeof(Type))) + +#endif /* __cplusplus */ + + +/*@/usr/local/share/swig/1.3.22/python/pymacros.swg,63,SWIG_define@*/ +#define SWIG_From_signed_SS_char PyInt_FromLong +/*@@*/ +/*@/usr/local/share/swig/1.3.22/python/pymacros.swg,63,SWIG_define@*/ +#define SWIG_From_unsigned_SS_char PyInt_FromLong +/*@@*/ +/*@/usr/local/share/swig/1.3.22/python/pymacros.swg,63,SWIG_define@*/ +#define SWIG_From_short PyInt_FromLong +/*@@*/ +/*@/usr/local/share/swig/1.3.22/python/pymacros.swg,63,SWIG_define@*/ +#define SWIG_From_unsigned_SS_short PyInt_FromLong +/*@@*/ +/*@/usr/local/share/swig/1.3.22/python/pymacros.swg,63,SWIG_define@*/ +#define SWIG_From_int PyInt_FromLong +/*@@*/ +/*@/usr/local/share/swig/1.3.22/python/pymacros.swg,63,SWIG_define@*/ +#define SWIG_From_long PyInt_FromLong +/*@@*/ +/*@/usr/local/share/swig/1.3.22/python/pymacros.swg,63,SWIG_define@*/ +#define SWIG_From_float PyFloat_FromDouble +/*@@*/ +/*@/usr/local/share/swig/1.3.22/python/pymacros.swg,63,SWIG_define@*/ +#define SWIG_From_double PyFloat_FromDouble +/*@@*/ + + +#include "hardware.h" + +extern double DttSP_SampleRate; + +SWIGSTATICINLINE(int) + SWIG_AsVal_double(PyObject *obj, double *val) +{ + if (PyFloat_Check(obj)) { + if (val) *val = PyFloat_AS_DOUBLE(obj); + return 1; + } + if (PyInt_Check(obj)) { + if (val) *val = PyInt_AS_LONG(obj); + return 1; + } + if (PyLong_Check(obj)) { + double v = PyLong_AsDouble(obj); + if (!PyErr_Occurred()) { + if (val) *val = v; + return 1; + } else { + if (!val) PyErr_Clear(); + return 0; + } + } + if (val) { + PyErr_SetString(PyExc_TypeError, "a double is expected"); + } + return 0; +} + + +SWIGSTATICINLINE(double) +SWIG_As_double(PyObject* obj) +{ + double v; + if (!SWIG_AsVal_double(obj, &v)) { + /* + this is needed to make valgrind/purify happier. the other + solution is throw an exception, but since this code should work + with plain C .... + */ + memset((void*)&v, 0, sizeof(double)); + } + return v; +} + +extern int ic11_memory; + +#include + + +SWIGSTATICINLINE(int) + SWIG_CheckLongInRange(long value, long min_value, long max_value, + const char *errmsg) +{ + if (value < min_value) { + if (errmsg) { + PyErr_Format(PyExc_OverflowError, + "value %ld is less than '%s' minimum %ld", + value, errmsg, min_value); + } + return 0; + } else if (value > max_value) { + if (errmsg) { + PyErr_Format(PyExc_OverflowError, + "value %ld is greater than '%s' maximum %ld", + value, errmsg, max_value); + } + return 0; + } + return 1; +} + + +SWIGSTATICINLINE(int) + SWIG_AsVal_long(PyObject * obj, long* val) +{ + if (PyInt_Check(obj)) { + if (val) *val = PyInt_AS_LONG(obj); + return 1; + } + if (PyLong_Check(obj)) { + long v = PyLong_AsLong(obj); + if (!PyErr_Occurred()) { + if (val) *val = v; + return 1; + } else { + if (!val) PyErr_Clear(); + return 0; + } + } + if (val) { + PyErr_SetString(PyExc_TypeError, "a long is expected"); + } + return 0; + } + + +#if INT_MAX != LONG_MAX +SWIGSTATICINLINE(int) + SWIG_AsVal_int(PyObject *obj, int *val) +{ + const char* errmsg = val ? "int" : 0; + long v; + if (SWIG_AsVal_long(obj, &v)) { + if (SWIG_CheckLongInRange(v, INT_MIN,INT_MAX, errmsg)) { + if (val) *val = swig_numeric_cast(v, int); + return 1; + } else { + return 0; + } + } else { + PyErr_Clear(); + } + if (val) { + PyErr_SetString(PyExc_TypeError, "an int is expected"); + } + return 0; +} +#else +SWIGSTATICINLINE(int) + SWIG_AsVal_int(PyObject *obj, int *val) +{ + return SWIG_AsVal_long(obj,(long*)val); +} +#endif + + +SWIGSTATICINLINE(int) +SWIG_As_int(PyObject* obj) +{ + int v; + if (!SWIG_AsVal_int(obj, &v)) { + /* + this is needed to make valgrind/purify happier. the other + solution is throw an exception, but since this code should work + with plain C .... + */ + memset((void*)&v, 0, sizeof(int)); + } + return v; +} + +extern int ic7_memory; +extern BOOL rfe_enabled; +extern BOOL xvtr_enabled; +extern BOOL pa_enabled; +extern BandSetting band_relay; +extern int external_output; +extern int mute_relay; +extern int transmit_relay; +extern int gain_relay; +extern int latch_delay; +extern double dds_clock; +extern int pll_mult; +extern double dds_clock_correction; +extern double sysClock; +extern int ioud_clock; +extern ushort dac_mult; +extern double dds_freq; +extern double if_freq; +extern BOOL if_shift; +extern BOOL spur_reduction; +extern double dds_step_size; +extern int sample_rate; +extern int fft_length; +extern double FFT_Bin_Size; +extern int tune_fft; +extern double tune_frac_rel; +extern double vfo_offset; +extern double min_freq; +extern double max_freq; +extern u_short baseAdr; +extern BandPlan curBandPlan; +extern double TWO_TO_THE_48_DIVIDED_BY_200; +extern long last_tuning_word; + +SWIGSTATICINLINE(long) +SWIG_As_long(PyObject* obj) +{ + long v; + if (!SWIG_AsVal_long(obj, &v)) { + /* + this is needed to make valgrind/purify happier. the other + solution is throw an exception, but since this code should work + with plain C .... + */ + memset((void*)&v, 0, sizeof(long)); + } + return v; +} + +extern BOOL usb_enabled; +extern BOOL openPort(char *); + +/* returns SWIG_OLDOBJ if the input is a raw char*, SWIG_PYSTR if is a PyString */ +SWIGSTATIC(int) +SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize) +{ + static swig_type_info* pchar_info = 0; + char* vptr = 0; + if (!pchar_info) pchar_info = SWIG_TypeQuery("char *"); + if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_info, 0) != -1) { + if (cptr) *cptr = vptr; + if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0; + return SWIG_OLDOBJ; + } else { + if (PyString_Check(obj)) { + if (cptr) { + *cptr = PyString_AS_STRING(obj); + if (psize) { + *psize = PyString_GET_SIZE(obj) + 1; + } + } + return SWIG_PYSTR; + } + } + if (cptr) { + PyErr_SetString(PyExc_TypeError, "a string is expected"); + } + return 0; +} + + +SWIGSTATICINLINE(int) +SWIG_AsCharPtr(PyObject *obj, char **val) +{ + char* cptr = 0; + if (SWIG_AsCharPtrAndSize(obj, &cptr, (size_t*)(0))) { + if (val) *val = cptr; + return 1; + } + if (val) { + PyErr_SetString(PyExc_TypeError, "a char* is expected"); + } + return 0; +} + +extern void closePort(void); +extern void USB_Sdr1kLatch(int,BYTE); + +SWIGSTATICINLINE(int) + SWIG_AsVal_unsigned_SS_long(PyObject * obj, unsigned long *val) +{ + if (PyInt_Check(obj)) { + long v = PyInt_AS_LONG(obj); + if (v >= 0) { + if (val) *val = v; + return 1; + } + } + if (PyLong_Check(obj)) { + unsigned long v = PyLong_AsUnsignedLong(obj); + if (!PyErr_Occurred()) { + if (val) *val = v; + return 1; + } else { + if (!val) PyErr_Clear(); + return 0; + } + } + if (val) { + PyErr_SetString(PyExc_TypeError, "an unsigned long is expected"); + } + return 0; +} + + +SWIGSTATICINLINE(int) + SWIG_CheckUnsignedLongInRange(unsigned long value, + unsigned long max_value, + const char *errmsg) +{ + if (value > max_value) { + if (errmsg) { + PyErr_Format(PyExc_OverflowError, + "value %ld is greater than '%s' minimum %ld", + value, errmsg, max_value); + } + return 0; + } + return 1; + } + + +SWIGSTATICINLINE(int) + SWIG_AsVal_unsigned_SS_char(PyObject *obj, unsigned char *val) +{ + const char* errmsg = val ? "unsigned char" : 0; + unsigned long v; + if (SWIG_AsVal_unsigned_SS_long(obj, &v)) { + if (SWIG_CheckUnsignedLongInRange(v, UCHAR_MAX,errmsg)) { + if (val) *val = swig_numeric_cast(v, unsigned char); + return 1; + } else { + return 0; + } + } else { + PyErr_Clear(); + } + if (val) { + PyErr_SetString(PyExc_TypeError, "an unsigned char is expected"); + } + return 0; +} + + +SWIGSTATICINLINE(unsigned char) +SWIG_As_unsigned_SS_char(PyObject* obj) +{ + unsigned char v; + if (!SWIG_AsVal_unsigned_SS_char(obj, &v)) { + /* + this is needed to make valgrind/purify happier. the other + solution is throw an exception, but since this code should work + with plain C .... + */ + memset((void*)&v, 0, sizeof(unsigned char)); + } + return v; +} + + +SWIGSTATICINLINE(int) +SWIG_Check_int(PyObject* obj) +{ + return SWIG_AsVal_int(obj, (int*)0); +} + + +SWIGSTATICINLINE(int) +SWIG_Check_unsigned_SS_char(PyObject* obj) +{ + return SWIG_AsVal_unsigned_SS_char(obj, (unsigned char*)0); +} + +extern BYTE USB_Sdr1kGetStatusPort(void); +extern int USB_Sdr1kGetADC(void); +extern void USB_Sdr1kDDSReset(void); +extern void USB_Sdr1kDDSWrite(BYTE,BYTE); +extern void USB_Sdr1kSRLoad(BYTE,BYTE); +extern void DttSP_ChangeOsc(double); + +SWIGSTATICINLINE(int) +SWIG_Check_double(PyObject* obj) +{ + return SWIG_AsVal_double(obj, (double*)0); +} + +extern void Init(void); +extern void PowerOn(void); +extern void StandBy(void); +extern void Impulse(void); +extern BYTE StatusPort(void); +extern void SetExt(ExtPin); +extern void ResExt(ExtPin); +extern BOOL PinValue(ExtPin); +extern void SetBPF(double); +extern void TestPort(void); +extern void RCKStrobe(BOOL,RFE_RCK); +extern void SRLoad(RFE_RCK,int); +extern void ResetRFE(void); +extern void PA_SetLPF(int); +extern BYTE PA_GetADC(int); +extern BOOL PA_ATUTune(ATUTuneMode); +extern BOOL getEnableLPF0(void); +extern void setEnableLPF0(BOOL); +extern BOOL getExtended(void); +extern void setExtended(BOOL); +extern BOOL getX2Enabled(void); +extern void setX2Enabled(BOOL); +extern int getX2Delay(void); +extern void setX2Delay(int); +extern BOOL getRFE_Enabled(void); +extern void setRFE_Enabled(BOOL); +extern BOOL getPA_Enabled(void); +extern void setPA_Enabled(BOOL); +extern BOOL getXVTR_Enabled(void); +extern BOOL setXVTR_Enabled(BOOL); +extern BOOL getUSB_Enabled(void); +extern void setUSB_Enabled(BOOL); +extern XVTRTRMode getCurrentXVTRTRMode(void); +extern void setCurrentXVTRTRMode(XVTRTRMode); +extern int getLatchDelay(void); +extern void setLatchDelay(int); +extern double getMinFreq(void); +extern double getMaxFreq(void); +extern u_short getBaseAddr(void); +extern u_short setBaseAddr(u_short); +extern BandSetting getBandRelay(void); +extern void setBandRelay(BandSetting); +extern BOOL getTransmitRelay(void); +extern void setTransmitRelay(BOOL); +extern BOOL getMuteRelay(void); +extern void setMuteRelay(BOOL); +extern BOOL getGainRelay(void); +extern void setGainRelay(BOOL); +extern int getExternalOutput(void); +extern void setExternalOutput(int); +extern double getDDSClockCorrection(void); +extern void setDDSClockCorrection(double); +extern int getPLLMult(void); +extern void setPLLMult(int); +extern double getDDSClock(void); +extern void setDDSClock(double); +extern BOOL getIFShift(void); +extern void setIFShift(BOOL); +extern BOOL getSpurReduction(void); +extern BOOL setSpurReduction(BOOL); +extern double getIFFreq(void); +extern void setIFFreq(double); +extern double getDDSFreq(void); +extern void setDDSFreq(double); +extern int getSampleRate(void); +extern void setSampleRate(int); +extern int getFFTLength(void); +extern void setFFTLength(int); +extern int getTuneFFT(void); +extern double getTuneFracRel(void); +extern double getVFOOffset(void); +extern void setVFOOffset(double); +extern int getIOUDClock(void); +extern void setIOUDClock(int); +extern u_short getDACMult(void); +extern void setDACMult(u_short); +extern BOOL getAMP_Relay(void); +extern BOOL setAMP_Relay(BOOL); +extern BOOL getATTN_Relay(void); +extern void setATTN_Relay(BOOL); +extern BOOL getXVTR_TR_Relay(void); +extern BOOL setXVTR_TR_Relay(BOOL); +extern BOOL getXVTR_Relay(void); +extern BOOL setXVTR_Relay(BOOL); +extern BOOL getIMPULSE_Relay(void); +extern BOOL setIMPULSE_Relay(BOOL); +extern BOOL getPA_TransmitRelay(void); +extern BOOL setPA_TransmitRelay(BOOL); +extern BOOL getPA_BiasOn(void); +extern BOOL setPA_BiasOn(BOOL); +#ifdef __cplusplus +extern "C" { +#endif +static int _wrap_DttSP_SampleRate_set(PyObject *_val) { + { + double temp = (double) SWIG_As_double(_val); + if (PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "C/C++ variable 'DttSP_SampleRate (double)'"); + return 1; + } + DttSP_SampleRate = temp; + } + return 0; +} + + +static PyObject *_wrap_DttSP_SampleRate_get() { + PyObject *pyobj; + + pyobj = SWIG_From_double((double)DttSP_SampleRate); + return pyobj; +} + + +static int _wrap_ic11_memory_set(PyObject *_val) { + { + int temp = (int) SWIG_As_int(_val); + if (PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "C/C++ variable 'ic11_memory (int)'"); + return 1; + } + ic11_memory = temp; + } + return 0; +} + + +static PyObject *_wrap_ic11_memory_get() { + PyObject *pyobj; + + pyobj = SWIG_From_int((int)ic11_memory); + return pyobj; +} + + +static int _wrap_ic7_memory_set(PyObject *_val) { + { + int temp = (int) SWIG_As_int(_val); + if (PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "C/C++ variable 'ic7_memory (int)'"); + return 1; + } + ic7_memory = temp; + } + return 0; +} + + +static PyObject *_wrap_ic7_memory_get() { + PyObject *pyobj; + + pyobj = SWIG_From_int((int)ic7_memory); + return pyobj; +} + + +static int _wrap_rfe_enabled_set(PyObject *_val) { + { + BOOL temp = (BOOL) SWIG_As_int(_val); + if (PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "C/C++ variable 'rfe_enabled (BOOL)'"); + return 1; + } + rfe_enabled = temp; + } + return 0; +} + + +static PyObject *_wrap_rfe_enabled_get() { + PyObject *pyobj; + + pyobj = SWIG_From_int((int)rfe_enabled); + return pyobj; +} + + +static int _wrap_xvtr_enabled_set(PyObject *_val) { + { + BOOL temp = (BOOL) SWIG_As_int(_val); + if (PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "C/C++ variable 'xvtr_enabled (BOOL)'"); + return 1; + } + xvtr_enabled = temp; + } + return 0; +} + + +static PyObject *_wrap_xvtr_enabled_get() { + PyObject *pyobj; + + pyobj = SWIG_From_int((int)xvtr_enabled); + return pyobj; +} + + +static int _wrap_pa_enabled_set(PyObject *_val) { + { + BOOL temp = (BOOL) SWIG_As_int(_val); + if (PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "C/C++ variable 'pa_enabled (BOOL)'"); + return 1; + } + pa_enabled = temp; + } + return 0; +} + + +static PyObject *_wrap_pa_enabled_get() { + PyObject *pyobj; + + pyobj = SWIG_From_int((int)pa_enabled); + return pyobj; +} + + +static int _wrap_band_relay_set(PyObject *_val) { + { + if (sizeof(int) != sizeof(band_relay)) { + PyErr_SetString(PyExc_TypeError, "enum variable 'band_relay' can not be set"); + return 1; + } + if (!SWIG_AsVal_int(_val, (int*)(void*)&(band_relay))) { + return 1; + } + } + return 0; +} + + +static PyObject *_wrap_band_relay_get() { + PyObject *pyobj; + + pyobj = SWIG_From_int((int)band_relay); + return pyobj; +} + + +static int _wrap_external_output_set(PyObject *_val) { + { + int temp = (int) SWIG_As_int(_val); + if (PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "C/C++ variable 'external_output (int)'"); + return 1; + } + external_output = temp; + } + return 0; +} + + +static PyObject *_wrap_external_output_get() { + PyObject *pyobj; + + pyobj = SWIG_From_int((int)external_output); + return pyobj; +} + + +static int _wrap_mute_relay_set(PyObject *_val) { + { + int temp = (int) SWIG_As_int(_val); + if (PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "C/C++ variable 'mute_relay (int)'"); + return 1; + } + mute_relay = temp; + } + return 0; +} + + +static PyObject *_wrap_mute_relay_get() { + PyObject *pyobj; + + pyobj = SWIG_From_int((int)mute_relay); + return pyobj; +} + + +static int _wrap_transmit_relay_set(PyObject *_val) { + { + int temp = (int) SWIG_As_int(_val); + if (PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "C/C++ variable 'transmit_relay (int)'"); + return 1; + } + transmit_relay = temp; + } + return 0; +} + + +static PyObject *_wrap_transmit_relay_get() { + PyObject *pyobj; + + pyobj = SWIG_From_int((int)transmit_relay); + return pyobj; +} + + +static int _wrap_gain_relay_set(PyObject *_val) { + { + int temp = (int) SWIG_As_int(_val); + if (PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "C/C++ variable 'gain_relay (int)'"); + return 1; + } + gain_relay = temp; + } + return 0; +} + + +static PyObject *_wrap_gain_relay_get() { + PyObject *pyobj; + + pyobj = SWIG_From_int((int)gain_relay); + return pyobj; +} + + +static int _wrap_latch_delay_set(PyObject *_val) { + { + int temp = (int) SWIG_As_int(_val); + if (PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "C/C++ variable 'latch_delay (int)'"); + return 1; + } + latch_delay = temp; + } + return 0; +} + + +static PyObject *_wrap_latch_delay_get() { + PyObject *pyobj; + + pyobj = SWIG_From_int((int)latch_delay); + return pyobj; +} + + +static int _wrap_dds_clock_set(PyObject *_val) { + { + double temp = (double) SWIG_As_double(_val); + if (PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "C/C++ variable 'dds_clock (double)'"); + return 1; + } + dds_clock = temp; + } + return 0; +} + + +static PyObject *_wrap_dds_clock_get() { + PyObject *pyobj; + + pyobj = SWIG_From_double((double)dds_clock); + return pyobj; +} + + +static int _wrap_pll_mult_set(PyObject *_val) { + { + int temp = (int) SWIG_As_int(_val); + if (PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "C/C++ variable 'pll_mult (int)'"); + return 1; + } + pll_mult = temp; + } + return 0; +} + + +static PyObject *_wrap_pll_mult_get() { + PyObject *pyobj; + + pyobj = SWIG_From_int((int)pll_mult); + return pyobj; +} + + +static int _wrap_dds_clock_correction_set(PyObject *_val) { + { + double temp = (double) SWIG_As_double(_val); + if (PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "C/C++ variable 'dds_clock_correction (double)'"); + return 1; + } + dds_clock_correction = temp; + } + return 0; +} + + +static PyObject *_wrap_dds_clock_correction_get() { + PyObject *pyobj; + + pyobj = SWIG_From_double((double)dds_clock_correction); + return pyobj; +} + + +static int _wrap_sysClock_set(PyObject *_val) { + { + double temp = (double) SWIG_As_double(_val); + if (PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "C/C++ variable 'sysClock (double)'"); + return 1; + } + sysClock = temp; + } + return 0; +} + + +static PyObject *_wrap_sysClock_get() { + PyObject *pyobj; + + pyobj = SWIG_From_double((double)sysClock); + return pyobj; +} + + +static int _wrap_ioud_clock_set(PyObject *_val) { + { + int temp = (int) SWIG_As_int(_val); + if (PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "C/C++ variable 'ioud_clock (int)'"); + return 1; + } + ioud_clock = temp; + } + return 0; +} + + +static PyObject *_wrap_ioud_clock_get() { + PyObject *pyobj; + + pyobj = SWIG_From_int((int)ioud_clock); + return pyobj; +} + + +static int _wrap_dac_mult_set(PyObject *_val) { + { + ushort * temp; + if ((SWIG_ConvertPtr(_val, (void **)(&temp), SWIGTYPE_p_ushort, SWIG_POINTER_EXCEPTION)) == -1) { + PyErr_SetString(PyExc_TypeError, "C/C++ variable 'dac_mult (ushort)'"); + return 1; + } + dac_mult = *((ushort *) temp); + } + return 0; +} + + +static PyObject *_wrap_dac_mult_get() { + PyObject *pyobj; + + pyobj = SWIG_NewPointerObj((void *)(&dac_mult), SWIGTYPE_p_ushort, 0); + return pyobj; +} + + +static int _wrap_dds_freq_set(PyObject *_val) { + { + double temp = (double) SWIG_As_double(_val); + if (PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "C/C++ variable 'dds_freq (double)'"); + return 1; + } + dds_freq = temp; + } + return 0; +} + + +static PyObject *_wrap_dds_freq_get() { + PyObject *pyobj; + + pyobj = SWIG_From_double((double)dds_freq); + return pyobj; +} + + +static int _wrap_if_freq_set(PyObject *_val) { + { + double temp = (double) SWIG_As_double(_val); + if (PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "C/C++ variable 'if_freq (double)'"); + return 1; + } + if_freq = temp; + } + return 0; +} + + +static PyObject *_wrap_if_freq_get() { + PyObject *pyobj; + + pyobj = SWIG_From_double((double)if_freq); + return pyobj; +} + + +static int _wrap_if_shift_set(PyObject *_val) { + { + BOOL temp = (BOOL) SWIG_As_int(_val); + if (PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "C/C++ variable 'if_shift (BOOL)'"); + return 1; + } + if_shift = temp; + } + return 0; +} + + +static PyObject *_wrap_if_shift_get() { + PyObject *pyobj; + + pyobj = SWIG_From_int((int)if_shift); + return pyobj; +} + + +static int _wrap_spur_reduction_set(PyObject *_val) { + { + BOOL temp = (BOOL) SWIG_As_int(_val); + if (PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "C/C++ variable 'spur_reduction (BOOL)'"); + return 1; + } + spur_reduction = temp; + } + return 0; +} + + +static PyObject *_wrap_spur_reduction_get() { + PyObject *pyobj; + + pyobj = SWIG_From_int((int)spur_reduction); + return pyobj; +} + + +static int _wrap_dds_step_size_set(PyObject *_val) { + { + double temp = (double) SWIG_As_double(_val); + if (PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "C/C++ variable 'dds_step_size (double)'"); + return 1; + } + dds_step_size = temp; + } + return 0; +} + + +static PyObject *_wrap_dds_step_size_get() { + PyObject *pyobj; + + pyobj = SWIG_From_double((double)dds_step_size); + return pyobj; +} + + +static int _wrap_sample_rate_set(PyObject *_val) { + { + int temp = (int) SWIG_As_int(_val); + if (PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "C/C++ variable 'sample_rate (int)'"); + return 1; + } + sample_rate = temp; + } + return 0; +} + + +static PyObject *_wrap_sample_rate_get() { + PyObject *pyobj; + + pyobj = SWIG_From_int((int)sample_rate); + return pyobj; +} + + +static int _wrap_fft_length_set(PyObject *_val) { + { + int temp = (int) SWIG_As_int(_val); + if (PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "C/C++ variable 'fft_length (int)'"); + return 1; + } + fft_length = temp; + } + return 0; +} + + +static PyObject *_wrap_fft_length_get() { + PyObject *pyobj; + + pyobj = SWIG_From_int((int)fft_length); + return pyobj; +} + + +static int _wrap_FFT_Bin_Size_set(PyObject *_val) { + { + double temp = (double) SWIG_As_double(_val); + if (PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "C/C++ variable 'FFT_Bin_Size (double)'"); + return 1; + } + FFT_Bin_Size = temp; + } + return 0; +} + + +static PyObject *_wrap_FFT_Bin_Size_get() { + PyObject *pyobj; + + pyobj = SWIG_From_double((double)FFT_Bin_Size); + return pyobj; +} + + +static int _wrap_tune_fft_set(PyObject *_val) { + { + int temp = (int) SWIG_As_int(_val); + if (PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "C/C++ variable 'tune_fft (int)'"); + return 1; + } + tune_fft = temp; + } + return 0; +} + + +static PyObject *_wrap_tune_fft_get() { + PyObject *pyobj; + + pyobj = SWIG_From_int((int)tune_fft); + return pyobj; +} + + +static int _wrap_tune_frac_rel_set(PyObject *_val) { + { + double temp = (double) SWIG_As_double(_val); + if (PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "C/C++ variable 'tune_frac_rel (double)'"); + return 1; + } + tune_frac_rel = temp; + } + return 0; +} + + +static PyObject *_wrap_tune_frac_rel_get() { + PyObject *pyobj; + + pyobj = SWIG_From_double((double)tune_frac_rel); + return pyobj; +} + + +static int _wrap_vfo_offset_set(PyObject *_val) { + { + double temp = (double) SWIG_As_double(_val); + if (PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "C/C++ variable 'vfo_offset (double)'"); + return 1; + } + vfo_offset = temp; + } + return 0; +} + + +static PyObject *_wrap_vfo_offset_get() { + PyObject *pyobj; + + pyobj = SWIG_From_double((double)vfo_offset); + return pyobj; +} + + +static int _wrap_min_freq_set(PyObject *_val) { + { + double temp = (double) SWIG_As_double(_val); + if (PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "C/C++ variable 'min_freq (double)'"); + return 1; + } + min_freq = temp; + } + return 0; +} + + +static PyObject *_wrap_min_freq_get() { + PyObject *pyobj; + + pyobj = SWIG_From_double((double)min_freq); + return pyobj; +} + + +static int _wrap_max_freq_set(PyObject *_val) { + { + double temp = (double) SWIG_As_double(_val); + if (PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "C/C++ variable 'max_freq (double)'"); + return 1; + } + max_freq = temp; + } + return 0; +} + + +static PyObject *_wrap_max_freq_get() { + PyObject *pyobj; + + pyobj = SWIG_From_double((double)max_freq); + return pyobj; +} + + +static int _wrap_baseAdr_set(PyObject *_val) { + { + u_short * temp; + if ((SWIG_ConvertPtr(_val, (void **)(&temp), SWIGTYPE_p_u_short, SWIG_POINTER_EXCEPTION)) == -1) { + PyErr_SetString(PyExc_TypeError, "C/C++ variable 'baseAdr (u_short)'"); + return 1; + } + baseAdr = *((u_short *) temp); + } + return 0; +} + + +static PyObject *_wrap_baseAdr_get() { + PyObject *pyobj; + + pyobj = SWIG_NewPointerObj((void *)(&baseAdr), SWIGTYPE_p_u_short, 0); + return pyobj; +} + + +static int _wrap_curBandPlan_set(PyObject *_val) { + { + if (sizeof(int) != sizeof(curBandPlan)) { + PyErr_SetString(PyExc_TypeError, "enum variable 'curBandPlan' can not be set"); + return 1; + } + if (!SWIG_AsVal_int(_val, (int*)(void*)&(curBandPlan))) { + return 1; + } + } + return 0; +} + + +static PyObject *_wrap_curBandPlan_get() { + PyObject *pyobj; + + pyobj = SWIG_From_int((int)curBandPlan); + return pyobj; +} + + +static int _wrap_TWO_TO_THE_48_DIVIDED_BY_200_set(PyObject *_val) { + { + double temp = (double) SWIG_As_double(_val); + if (PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "C/C++ variable 'TWO_TO_THE_48_DIVIDED_BY_200 (double)'"); + return 1; + } + TWO_TO_THE_48_DIVIDED_BY_200 = temp; + } + return 0; +} + + +static PyObject *_wrap_TWO_TO_THE_48_DIVIDED_BY_200_get() { + PyObject *pyobj; + + pyobj = SWIG_From_double((double)TWO_TO_THE_48_DIVIDED_BY_200); + return pyobj; +} + + +static int _wrap_last_tuning_word_set(PyObject *_val) { + { + long temp = (long) SWIG_As_long(_val); + if (PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "C/C++ variable 'last_tuning_word (long)'"); + return 1; + } + last_tuning_word = temp; + } + return 0; +} + + +static PyObject *_wrap_last_tuning_word_get() { + PyObject *pyobj; + + pyobj = SWIG_From_long((long)last_tuning_word); + return pyobj; +} + + +static int _wrap_usb_enabled_set(PyObject *_val) { + { + BOOL temp = (BOOL) SWIG_As_int(_val); + if (PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "C/C++ variable 'usb_enabled (BOOL)'"); + return 1; + } + usb_enabled = temp; + } + return 0; +} + + +static PyObject *_wrap_usb_enabled_get() { + PyObject *pyobj; + + pyobj = SWIG_From_int((int)usb_enabled); + return pyobj; +} + + +static PyObject *_wrap_openPort(PyObject *self, PyObject *args) { + PyObject *resultobj; + char *arg1 ; + BOOL result; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:openPort",&obj0)) goto fail; + if (!SWIG_AsCharPtr(obj0, (char**)&arg1)) SWIG_fail; + result = (BOOL)openPort(arg1); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_closePort(PyObject *self, PyObject *args) { + PyObject *resultobj; + + if(!PyArg_ParseTuple(args,(char *)":closePort")) goto fail; + closePort(); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_USB_Sdr1kLatch(PyObject *self, PyObject *args) { + PyObject *resultobj; + int arg1 ; + BYTE arg2 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"OO:USB_Sdr1kLatch",&obj0,&obj1)) goto fail; + arg1 = (int)SWIG_As_int(obj0); + if (PyErr_Occurred()) SWIG_fail; + arg2 = (BYTE)SWIG_As_unsigned_SS_char(obj1); + if (PyErr_Occurred()) SWIG_fail; + USB_Sdr1kLatch(arg1,arg2); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_USB_Sdr1kGetStatusPort(PyObject *self, PyObject *args) { + PyObject *resultobj; + BYTE result; + + if(!PyArg_ParseTuple(args,(char *)":USB_Sdr1kGetStatusPort")) goto fail; + result = (BYTE)USB_Sdr1kGetStatusPort(); + + resultobj = SWIG_From_unsigned_SS_char((unsigned char)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_USB_Sdr1kGetADC(PyObject *self, PyObject *args) { + PyObject *resultobj; + int result; + + if(!PyArg_ParseTuple(args,(char *)":USB_Sdr1kGetADC")) goto fail; + result = (int)USB_Sdr1kGetADC(); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_USB_Sdr1kDDSReset(PyObject *self, PyObject *args) { + PyObject *resultobj; + + if(!PyArg_ParseTuple(args,(char *)":USB_Sdr1kDDSReset")) goto fail; + USB_Sdr1kDDSReset(); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_USB_Sdr1kDDSWrite(PyObject *self, PyObject *args) { + PyObject *resultobj; + BYTE arg1 ; + BYTE arg2 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"OO:USB_Sdr1kDDSWrite",&obj0,&obj1)) goto fail; + arg1 = (BYTE)SWIG_As_unsigned_SS_char(obj0); + if (PyErr_Occurred()) SWIG_fail; + arg2 = (BYTE)SWIG_As_unsigned_SS_char(obj1); + if (PyErr_Occurred()) SWIG_fail; + USB_Sdr1kDDSWrite(arg1,arg2); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_USB_Sdr1kSRLoad(PyObject *self, PyObject *args) { + PyObject *resultobj; + BYTE arg1 ; + BYTE arg2 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"OO:USB_Sdr1kSRLoad",&obj0,&obj1)) goto fail; + arg1 = (BYTE)SWIG_As_unsigned_SS_char(obj0); + if (PyErr_Occurred()) SWIG_fail; + arg2 = (BYTE)SWIG_As_unsigned_SS_char(obj1); + if (PyErr_Occurred()) SWIG_fail; + USB_Sdr1kSRLoad(arg1,arg2); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_DttSP_ChangeOsc(PyObject *self, PyObject *args) { + PyObject *resultobj; + double arg1 ; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:DttSP_ChangeOsc",&obj0)) goto fail; + arg1 = (double)SWIG_As_double(obj0); + if (PyErr_Occurred()) SWIG_fail; + DttSP_ChangeOsc(arg1); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_Init(PyObject *self, PyObject *args) { + PyObject *resultobj; + + if(!PyArg_ParseTuple(args,(char *)":Init")) goto fail; + Init(); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_PowerOn(PyObject *self, PyObject *args) { + PyObject *resultobj; + + if(!PyArg_ParseTuple(args,(char *)":PowerOn")) goto fail; + PowerOn(); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_StandBy(PyObject *self, PyObject *args) { + PyObject *resultobj; + + if(!PyArg_ParseTuple(args,(char *)":StandBy")) goto fail; + StandBy(); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_Impulse(PyObject *self, PyObject *args) { + PyObject *resultobj; + + if(!PyArg_ParseTuple(args,(char *)":Impulse")) goto fail; + Impulse(); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_StatusPort(PyObject *self, PyObject *args) { + PyObject *resultobj; + BYTE result; + + if(!PyArg_ParseTuple(args,(char *)":StatusPort")) goto fail; + result = (BYTE)StatusPort(); + + resultobj = SWIG_From_unsigned_SS_char((unsigned char)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_SetExt(PyObject *self, PyObject *args) { + PyObject *resultobj; + int arg1 ; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:SetExt",&obj0)) goto fail; + arg1 = (int)SWIG_As_int(obj0); + if (PyErr_Occurred()) SWIG_fail; + SetExt((ExtPin )arg1); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_ResExt(PyObject *self, PyObject *args) { + PyObject *resultobj; + int arg1 ; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:ResExt",&obj0)) goto fail; + arg1 = (int)SWIG_As_int(obj0); + if (PyErr_Occurred()) SWIG_fail; + ResExt((ExtPin )arg1); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_PinValue(PyObject *self, PyObject *args) { + PyObject *resultobj; + int arg1 ; + BOOL result; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:PinValue",&obj0)) goto fail; + arg1 = (int)SWIG_As_int(obj0); + if (PyErr_Occurred()) SWIG_fail; + result = (BOOL)PinValue((ExtPin )arg1); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_SetBPF(PyObject *self, PyObject *args) { + PyObject *resultobj; + double arg1 ; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:SetBPF",&obj0)) goto fail; + arg1 = (double)SWIG_As_double(obj0); + if (PyErr_Occurred()) SWIG_fail; + SetBPF(arg1); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_TestPort(PyObject *self, PyObject *args) { + PyObject *resultobj; + + if(!PyArg_ParseTuple(args,(char *)":TestPort")) goto fail; + TestPort(); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_RCKStrobe(PyObject *self, PyObject *args) { + PyObject *resultobj; + BOOL arg1 ; + int arg2 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"OO:RCKStrobe",&obj0,&obj1)) goto fail; + arg1 = (BOOL)SWIG_As_int(obj0); + if (PyErr_Occurred()) SWIG_fail; + arg2 = (int)SWIG_As_int(obj1); + if (PyErr_Occurred()) SWIG_fail; + RCKStrobe(arg1,(RFE_RCK )arg2); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_SRLoad(PyObject *self, PyObject *args) { + PyObject *resultobj; + int arg1 ; + int arg2 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"OO:SRLoad",&obj0,&obj1)) goto fail; + arg1 = (int)SWIG_As_int(obj0); + if (PyErr_Occurred()) SWIG_fail; + arg2 = (int)SWIG_As_int(obj1); + if (PyErr_Occurred()) SWIG_fail; + SRLoad((RFE_RCK )arg1,arg2); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_ResetRFE(PyObject *self, PyObject *args) { + PyObject *resultobj; + + if(!PyArg_ParseTuple(args,(char *)":ResetRFE")) goto fail; + ResetRFE(); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_PA_SetLPF(PyObject *self, PyObject *args) { + PyObject *resultobj; + int arg1 ; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:PA_SetLPF",&obj0)) goto fail; + arg1 = (int)SWIG_As_int(obj0); + if (PyErr_Occurred()) SWIG_fail; + PA_SetLPF(arg1); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_PA_GetADC(PyObject *self, PyObject *args) { + PyObject *resultobj; + int arg1 ; + BYTE result; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:PA_GetADC",&obj0)) goto fail; + arg1 = (int)SWIG_As_int(obj0); + if (PyErr_Occurred()) SWIG_fail; + result = (BYTE)PA_GetADC(arg1); + + resultobj = SWIG_From_unsigned_SS_char((unsigned char)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_PA_ATUTune(PyObject *self, PyObject *args) { + PyObject *resultobj; + int arg1 ; + BOOL result; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:PA_ATUTune",&obj0)) goto fail; + arg1 = (int)SWIG_As_int(obj0); + if (PyErr_Occurred()) SWIG_fail; + result = (BOOL)PA_ATUTune((ATUTuneMode )arg1); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_getEnableLPF0(PyObject *self, PyObject *args) { + PyObject *resultobj; + BOOL result; + + if(!PyArg_ParseTuple(args,(char *)":getEnableLPF0")) goto fail; + result = (BOOL)getEnableLPF0(); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_setEnableLPF0(PyObject *self, PyObject *args) { + PyObject *resultobj; + BOOL arg1 ; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:setEnableLPF0",&obj0)) goto fail; + arg1 = (BOOL)SWIG_As_int(obj0); + if (PyErr_Occurred()) SWIG_fail; + setEnableLPF0(arg1); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_getExtended(PyObject *self, PyObject *args) { + PyObject *resultobj; + BOOL result; + + if(!PyArg_ParseTuple(args,(char *)":getExtended")) goto fail; + result = (BOOL)getExtended(); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_setExtended(PyObject *self, PyObject *args) { + PyObject *resultobj; + BOOL arg1 ; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:setExtended",&obj0)) goto fail; + arg1 = (BOOL)SWIG_As_int(obj0); + if (PyErr_Occurred()) SWIG_fail; + setExtended(arg1); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_getX2Enabled(PyObject *self, PyObject *args) { + PyObject *resultobj; + BOOL result; + + if(!PyArg_ParseTuple(args,(char *)":getX2Enabled")) goto fail; + result = (BOOL)getX2Enabled(); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_setX2Enabled(PyObject *self, PyObject *args) { + PyObject *resultobj; + BOOL arg1 ; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:setX2Enabled",&obj0)) goto fail; + arg1 = (BOOL)SWIG_As_int(obj0); + if (PyErr_Occurred()) SWIG_fail; + setX2Enabled(arg1); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_getX2Delay(PyObject *self, PyObject *args) { + PyObject *resultobj; + int result; + + if(!PyArg_ParseTuple(args,(char *)":getX2Delay")) goto fail; + result = (int)getX2Delay(); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_setX2Delay(PyObject *self, PyObject *args) { + PyObject *resultobj; + int arg1 ; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:setX2Delay",&obj0)) goto fail; + arg1 = (int)SWIG_As_int(obj0); + if (PyErr_Occurred()) SWIG_fail; + setX2Delay(arg1); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_getRFE_Enabled(PyObject *self, PyObject *args) { + PyObject *resultobj; + BOOL result; + + if(!PyArg_ParseTuple(args,(char *)":getRFE_Enabled")) goto fail; + result = (BOOL)getRFE_Enabled(); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_setRFE_Enabled(PyObject *self, PyObject *args) { + PyObject *resultobj; + BOOL arg1 ; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:setRFE_Enabled",&obj0)) goto fail; + arg1 = (BOOL)SWIG_As_int(obj0); + if (PyErr_Occurred()) SWIG_fail; + setRFE_Enabled(arg1); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_getPA_Enabled(PyObject *self, PyObject *args) { + PyObject *resultobj; + BOOL result; + + if(!PyArg_ParseTuple(args,(char *)":getPA_Enabled")) goto fail; + result = (BOOL)getPA_Enabled(); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_setPA_Enabled(PyObject *self, PyObject *args) { + PyObject *resultobj; + BOOL arg1 ; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:setPA_Enabled",&obj0)) goto fail; + arg1 = (BOOL)SWIG_As_int(obj0); + if (PyErr_Occurred()) SWIG_fail; + setPA_Enabled(arg1); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_getXVTR_Enabled(PyObject *self, PyObject *args) { + PyObject *resultobj; + BOOL result; + + if(!PyArg_ParseTuple(args,(char *)":getXVTR_Enabled")) goto fail; + result = (BOOL)getXVTR_Enabled(); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_setXVTR_Enabled(PyObject *self, PyObject *args) { + PyObject *resultobj; + BOOL arg1 ; + BOOL result; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:setXVTR_Enabled",&obj0)) goto fail; + arg1 = (BOOL)SWIG_As_int(obj0); + if (PyErr_Occurred()) SWIG_fail; + result = (BOOL)setXVTR_Enabled(arg1); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_getUSB_Enabled(PyObject *self, PyObject *args) { + PyObject *resultobj; + BOOL result; + + if(!PyArg_ParseTuple(args,(char *)":getUSB_Enabled")) goto fail; + result = (BOOL)getUSB_Enabled(); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_setUSB_Enabled(PyObject *self, PyObject *args) { + PyObject *resultobj; + BOOL arg1 ; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:setUSB_Enabled",&obj0)) goto fail; + arg1 = (BOOL)SWIG_As_int(obj0); + if (PyErr_Occurred()) SWIG_fail; + setUSB_Enabled(arg1); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_getCurrentXVTRTRMode(PyObject *self, PyObject *args) { + PyObject *resultobj; + int result; + + if(!PyArg_ParseTuple(args,(char *)":getCurrentXVTRTRMode")) goto fail; + result = (int)getCurrentXVTRTRMode(); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_setCurrentXVTRTRMode(PyObject *self, PyObject *args) { + PyObject *resultobj; + int arg1 ; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:setCurrentXVTRTRMode",&obj0)) goto fail; + arg1 = (int)SWIG_As_int(obj0); + if (PyErr_Occurred()) SWIG_fail; + setCurrentXVTRTRMode((XVTRTRMode )arg1); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_getLatchDelay(PyObject *self, PyObject *args) { + PyObject *resultobj; + int result; + + if(!PyArg_ParseTuple(args,(char *)":getLatchDelay")) goto fail; + result = (int)getLatchDelay(); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_setLatchDelay(PyObject *self, PyObject *args) { + PyObject *resultobj; + int arg1 ; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:setLatchDelay",&obj0)) goto fail; + arg1 = (int)SWIG_As_int(obj0); + if (PyErr_Occurred()) SWIG_fail; + setLatchDelay(arg1); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_getMinFreq(PyObject *self, PyObject *args) { + PyObject *resultobj; + double result; + + if(!PyArg_ParseTuple(args,(char *)":getMinFreq")) goto fail; + result = (double)getMinFreq(); + + resultobj = SWIG_From_double((double)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_getMaxFreq(PyObject *self, PyObject *args) { + PyObject *resultobj; + double result; + + if(!PyArg_ParseTuple(args,(char *)":getMaxFreq")) goto fail; + result = (double)getMaxFreq(); + + resultobj = SWIG_From_double((double)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_getBaseAddr(PyObject *self, PyObject *args) { + PyObject *resultobj; + u_short result; + + if(!PyArg_ParseTuple(args,(char *)":getBaseAddr")) goto fail; + result = getBaseAddr(); + + { + u_short * resultptr; + resultptr = (u_short *) malloc(sizeof(u_short)); + memmove(resultptr, &result, sizeof(u_short)); + resultobj = SWIG_NewPointerObj((void *)(resultptr), SWIGTYPE_p_u_short, 1); + } + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_setBaseAddr(PyObject *self, PyObject *args) { + PyObject *resultobj; + u_short arg1 ; + u_short result; + u_short *argp1 ; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:setBaseAddr",&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&argp1),SWIGTYPE_p_u_short, + SWIG_POINTER_EXCEPTION) == -1)) SWIG_fail; + arg1 = *argp1; + result = setBaseAddr(arg1); + + { + u_short * resultptr; + resultptr = (u_short *) malloc(sizeof(u_short)); + memmove(resultptr, &result, sizeof(u_short)); + resultobj = SWIG_NewPointerObj((void *)(resultptr), SWIGTYPE_p_u_short, 1); + } + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_getBandRelay(PyObject *self, PyObject *args) { + PyObject *resultobj; + int result; + + if(!PyArg_ParseTuple(args,(char *)":getBandRelay")) goto fail; + result = (int)getBandRelay(); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_setBandRelay(PyObject *self, PyObject *args) { + PyObject *resultobj; + int arg1 ; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:setBandRelay",&obj0)) goto fail; + arg1 = (int)SWIG_As_int(obj0); + if (PyErr_Occurred()) SWIG_fail; + setBandRelay((BandSetting )arg1); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_getTransmitRelay(PyObject *self, PyObject *args) { + PyObject *resultobj; + BOOL result; + + if(!PyArg_ParseTuple(args,(char *)":getTransmitRelay")) goto fail; + result = (BOOL)getTransmitRelay(); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_setTransmitRelay(PyObject *self, PyObject *args) { + PyObject *resultobj; + BOOL arg1 ; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:setTransmitRelay",&obj0)) goto fail; + arg1 = (BOOL)SWIG_As_int(obj0); + if (PyErr_Occurred()) SWIG_fail; + setTransmitRelay(arg1); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_getMuteRelay(PyObject *self, PyObject *args) { + PyObject *resultobj; + BOOL result; + + if(!PyArg_ParseTuple(args,(char *)":getMuteRelay")) goto fail; + result = (BOOL)getMuteRelay(); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_setMuteRelay(PyObject *self, PyObject *args) { + PyObject *resultobj; + BOOL arg1 ; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:setMuteRelay",&obj0)) goto fail; + arg1 = (BOOL)SWIG_As_int(obj0); + if (PyErr_Occurred()) SWIG_fail; + setMuteRelay(arg1); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_getGainRelay(PyObject *self, PyObject *args) { + PyObject *resultobj; + BOOL result; + + if(!PyArg_ParseTuple(args,(char *)":getGainRelay")) goto fail; + result = (BOOL)getGainRelay(); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_setGainRelay(PyObject *self, PyObject *args) { + PyObject *resultobj; + BOOL arg1 ; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:setGainRelay",&obj0)) goto fail; + arg1 = (BOOL)SWIG_As_int(obj0); + if (PyErr_Occurred()) SWIG_fail; + setGainRelay(arg1); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_getExternalOutput(PyObject *self, PyObject *args) { + PyObject *resultobj; + int result; + + if(!PyArg_ParseTuple(args,(char *)":getExternalOutput")) goto fail; + result = (int)getExternalOutput(); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_setExternalOutput(PyObject *self, PyObject *args) { + PyObject *resultobj; + int arg1 ; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:setExternalOutput",&obj0)) goto fail; + arg1 = (int)SWIG_As_int(obj0); + if (PyErr_Occurred()) SWIG_fail; + setExternalOutput(arg1); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_getDDSClockCorrection(PyObject *self, PyObject *args) { + PyObject *resultobj; + double result; + + if(!PyArg_ParseTuple(args,(char *)":getDDSClockCorrection")) goto fail; + result = (double)getDDSClockCorrection(); + + resultobj = SWIG_From_double((double)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_setDDSClockCorrection(PyObject *self, PyObject *args) { + PyObject *resultobj; + double arg1 ; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:setDDSClockCorrection",&obj0)) goto fail; + arg1 = (double)SWIG_As_double(obj0); + if (PyErr_Occurred()) SWIG_fail; + setDDSClockCorrection(arg1); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_getPLLMult(PyObject *self, PyObject *args) { + PyObject *resultobj; + int result; + + if(!PyArg_ParseTuple(args,(char *)":getPLLMult")) goto fail; + result = (int)getPLLMult(); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_setPLLMult(PyObject *self, PyObject *args) { + PyObject *resultobj; + int arg1 ; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:setPLLMult",&obj0)) goto fail; + arg1 = (int)SWIG_As_int(obj0); + if (PyErr_Occurred()) SWIG_fail; + setPLLMult(arg1); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_getDDSClock(PyObject *self, PyObject *args) { + PyObject *resultobj; + double result; + + if(!PyArg_ParseTuple(args,(char *)":getDDSClock")) goto fail; + result = (double)getDDSClock(); + + resultobj = SWIG_From_double((double)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_setDDSClock(PyObject *self, PyObject *args) { + PyObject *resultobj; + double arg1 ; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:setDDSClock",&obj0)) goto fail; + arg1 = (double)SWIG_As_double(obj0); + if (PyErr_Occurred()) SWIG_fail; + setDDSClock(arg1); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_getIFShift(PyObject *self, PyObject *args) { + PyObject *resultobj; + BOOL result; + + if(!PyArg_ParseTuple(args,(char *)":getIFShift")) goto fail; + result = (BOOL)getIFShift(); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_setIFShift(PyObject *self, PyObject *args) { + PyObject *resultobj; + BOOL arg1 ; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:setIFShift",&obj0)) goto fail; + arg1 = (BOOL)SWIG_As_int(obj0); + if (PyErr_Occurred()) SWIG_fail; + setIFShift(arg1); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_getSpurReduction(PyObject *self, PyObject *args) { + PyObject *resultobj; + BOOL result; + + if(!PyArg_ParseTuple(args,(char *)":getSpurReduction")) goto fail; + result = (BOOL)getSpurReduction(); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_setSpurReduction(PyObject *self, PyObject *args) { + PyObject *resultobj; + BOOL arg1 ; + BOOL result; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:setSpurReduction",&obj0)) goto fail; + arg1 = (BOOL)SWIG_As_int(obj0); + if (PyErr_Occurred()) SWIG_fail; + result = (BOOL)setSpurReduction(arg1); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_getIFFreq(PyObject *self, PyObject *args) { + PyObject *resultobj; + double result; + + if(!PyArg_ParseTuple(args,(char *)":getIFFreq")) goto fail; + result = (double)getIFFreq(); + + resultobj = SWIG_From_double((double)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_setIFFreq(PyObject *self, PyObject *args) { + PyObject *resultobj; + double arg1 ; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:setIFFreq",&obj0)) goto fail; + arg1 = (double)SWIG_As_double(obj0); + if (PyErr_Occurred()) SWIG_fail; + setIFFreq(arg1); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_getDDSFreq(PyObject *self, PyObject *args) { + PyObject *resultobj; + double result; + + if(!PyArg_ParseTuple(args,(char *)":getDDSFreq")) goto fail; + result = (double)getDDSFreq(); + + resultobj = SWIG_From_double((double)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_setDDSFreq(PyObject *self, PyObject *args) { + PyObject *resultobj; + double arg1 ; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:setDDSFreq",&obj0)) goto fail; + arg1 = (double)SWIG_As_double(obj0); + if (PyErr_Occurred()) SWIG_fail; + setDDSFreq(arg1); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_getSampleRate(PyObject *self, PyObject *args) { + PyObject *resultobj; + int result; + + if(!PyArg_ParseTuple(args,(char *)":getSampleRate")) goto fail; + result = (int)getSampleRate(); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_setSampleRate(PyObject *self, PyObject *args) { + PyObject *resultobj; + int arg1 ; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:setSampleRate",&obj0)) goto fail; + arg1 = (int)SWIG_As_int(obj0); + if (PyErr_Occurred()) SWIG_fail; + setSampleRate(arg1); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_getFFTLength(PyObject *self, PyObject *args) { + PyObject *resultobj; + int result; + + if(!PyArg_ParseTuple(args,(char *)":getFFTLength")) goto fail; + result = (int)getFFTLength(); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_setFFTLength(PyObject *self, PyObject *args) { + PyObject *resultobj; + int arg1 ; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:setFFTLength",&obj0)) goto fail; + arg1 = (int)SWIG_As_int(obj0); + if (PyErr_Occurred()) SWIG_fail; + setFFTLength(arg1); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_getTuneFFT(PyObject *self, PyObject *args) { + PyObject *resultobj; + int result; + + if(!PyArg_ParseTuple(args,(char *)":getTuneFFT")) goto fail; + result = (int)getTuneFFT(); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_getTuneFracRel(PyObject *self, PyObject *args) { + PyObject *resultobj; + double result; + + if(!PyArg_ParseTuple(args,(char *)":getTuneFracRel")) goto fail; + result = (double)getTuneFracRel(); + + resultobj = SWIG_From_double((double)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_getVFOOffset(PyObject *self, PyObject *args) { + PyObject *resultobj; + double result; + + if(!PyArg_ParseTuple(args,(char *)":getVFOOffset")) goto fail; + result = (double)getVFOOffset(); + + resultobj = SWIG_From_double((double)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_setVFOOffset(PyObject *self, PyObject *args) { + PyObject *resultobj; + double arg1 ; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:setVFOOffset",&obj0)) goto fail; + arg1 = (double)SWIG_As_double(obj0); + if (PyErr_Occurred()) SWIG_fail; + setVFOOffset(arg1); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_getIOUDClock(PyObject *self, PyObject *args) { + PyObject *resultobj; + int result; + + if(!PyArg_ParseTuple(args,(char *)":getIOUDClock")) goto fail; + result = (int)getIOUDClock(); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_setIOUDClock(PyObject *self, PyObject *args) { + PyObject *resultobj; + int arg1 ; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:setIOUDClock",&obj0)) goto fail; + arg1 = (int)SWIG_As_int(obj0); + if (PyErr_Occurred()) SWIG_fail; + setIOUDClock(arg1); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_getDACMult(PyObject *self, PyObject *args) { + PyObject *resultobj; + u_short result; + + if(!PyArg_ParseTuple(args,(char *)":getDACMult")) goto fail; + result = getDACMult(); + + { + u_short * resultptr; + resultptr = (u_short *) malloc(sizeof(u_short)); + memmove(resultptr, &result, sizeof(u_short)); + resultobj = SWIG_NewPointerObj((void *)(resultptr), SWIGTYPE_p_u_short, 1); + } + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_setDACMult(PyObject *self, PyObject *args) { + PyObject *resultobj; + u_short arg1 ; + u_short *argp1 ; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:setDACMult",&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&argp1),SWIGTYPE_p_u_short, + SWIG_POINTER_EXCEPTION) == -1)) SWIG_fail; + arg1 = *argp1; + setDACMult(arg1); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_getAMP_Relay(PyObject *self, PyObject *args) { + PyObject *resultobj; + BOOL result; + + if(!PyArg_ParseTuple(args,(char *)":getAMP_Relay")) goto fail; + result = (BOOL)getAMP_Relay(); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_setAMP_Relay(PyObject *self, PyObject *args) { + PyObject *resultobj; + BOOL arg1 ; + BOOL result; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:setAMP_Relay",&obj0)) goto fail; + arg1 = (BOOL)SWIG_As_int(obj0); + if (PyErr_Occurred()) SWIG_fail; + result = (BOOL)setAMP_Relay(arg1); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_getATTN_Relay(PyObject *self, PyObject *args) { + PyObject *resultobj; + BOOL result; + + if(!PyArg_ParseTuple(args,(char *)":getATTN_Relay")) goto fail; + result = (BOOL)getATTN_Relay(); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_setATTN_Relay(PyObject *self, PyObject *args) { + PyObject *resultobj; + BOOL arg1 ; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:setATTN_Relay",&obj0)) goto fail; + arg1 = (BOOL)SWIG_As_int(obj0); + if (PyErr_Occurred()) SWIG_fail; + setATTN_Relay(arg1); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_getXVTR_TR_Relay(PyObject *self, PyObject *args) { + PyObject *resultobj; + BOOL result; + + if(!PyArg_ParseTuple(args,(char *)":getXVTR_TR_Relay")) goto fail; + result = (BOOL)getXVTR_TR_Relay(); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_setXVTR_TR_Relay(PyObject *self, PyObject *args) { + PyObject *resultobj; + BOOL arg1 ; + BOOL result; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:setXVTR_TR_Relay",&obj0)) goto fail; + arg1 = (BOOL)SWIG_As_int(obj0); + if (PyErr_Occurred()) SWIG_fail; + result = (BOOL)setXVTR_TR_Relay(arg1); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_getXVTR_Relay(PyObject *self, PyObject *args) { + PyObject *resultobj; + BOOL result; + + if(!PyArg_ParseTuple(args,(char *)":getXVTR_Relay")) goto fail; + result = (BOOL)getXVTR_Relay(); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_setXVTR_Relay(PyObject *self, PyObject *args) { + PyObject *resultobj; + BOOL arg1 ; + BOOL result; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:setXVTR_Relay",&obj0)) goto fail; + arg1 = (BOOL)SWIG_As_int(obj0); + if (PyErr_Occurred()) SWIG_fail; + result = (BOOL)setXVTR_Relay(arg1); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_getIMPULSE_Relay(PyObject *self, PyObject *args) { + PyObject *resultobj; + BOOL result; + + if(!PyArg_ParseTuple(args,(char *)":getIMPULSE_Relay")) goto fail; + result = (BOOL)getIMPULSE_Relay(); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_setIMPULSE_Relay(PyObject *self, PyObject *args) { + PyObject *resultobj; + BOOL arg1 ; + BOOL result; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:setIMPULSE_Relay",&obj0)) goto fail; + arg1 = (BOOL)SWIG_As_int(obj0); + if (PyErr_Occurred()) SWIG_fail; + result = (BOOL)setIMPULSE_Relay(arg1); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_getPA_TransmitRelay(PyObject *self, PyObject *args) { + PyObject *resultobj; + BOOL result; + + if(!PyArg_ParseTuple(args,(char *)":getPA_TransmitRelay")) goto fail; + result = (BOOL)getPA_TransmitRelay(); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_setPA_TransmitRelay(PyObject *self, PyObject *args) { + PyObject *resultobj; + BOOL arg1 ; + BOOL result; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:setPA_TransmitRelay",&obj0)) goto fail; + arg1 = (BOOL)SWIG_As_int(obj0); + if (PyErr_Occurred()) SWIG_fail; + result = (BOOL)setPA_TransmitRelay(arg1); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_getPA_BiasOn(PyObject *self, PyObject *args) { + PyObject *resultobj; + BOOL result; + + if(!PyArg_ParseTuple(args,(char *)":getPA_BiasOn")) goto fail; + result = (BOOL)getPA_BiasOn(); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_setPA_BiasOn(PyObject *self, PyObject *args) { + PyObject *resultobj; + BOOL arg1 ; + BOOL result; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:setPA_BiasOn",&obj0)) goto fail; + arg1 = (BOOL)SWIG_As_int(obj0); + if (PyErr_Occurred()) SWIG_fail; + result = (BOOL)setPA_BiasOn(arg1); + + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyMethodDef SwigMethods[] = { + { (char *)"openPort", _wrap_openPort, METH_VARARGS, NULL }, + { (char *)"closePort", _wrap_closePort, METH_VARARGS, NULL }, + { (char *)"USB_Sdr1kLatch", _wrap_USB_Sdr1kLatch, METH_VARARGS, NULL }, + { (char *)"USB_Sdr1kGetStatusPort", _wrap_USB_Sdr1kGetStatusPort, METH_VARARGS, NULL }, + { (char *)"USB_Sdr1kGetADC", _wrap_USB_Sdr1kGetADC, METH_VARARGS, NULL }, + { (char *)"USB_Sdr1kDDSReset", _wrap_USB_Sdr1kDDSReset, METH_VARARGS, NULL }, + { (char *)"USB_Sdr1kDDSWrite", _wrap_USB_Sdr1kDDSWrite, METH_VARARGS, NULL }, + { (char *)"USB_Sdr1kSRLoad", _wrap_USB_Sdr1kSRLoad, METH_VARARGS, NULL }, + { (char *)"DttSP_ChangeOsc", _wrap_DttSP_ChangeOsc, METH_VARARGS, NULL }, + { (char *)"Init", _wrap_Init, METH_VARARGS, NULL }, + { (char *)"PowerOn", _wrap_PowerOn, METH_VARARGS, NULL }, + { (char *)"StandBy", _wrap_StandBy, METH_VARARGS, NULL }, + { (char *)"Impulse", _wrap_Impulse, METH_VARARGS, NULL }, + { (char *)"StatusPort", _wrap_StatusPort, METH_VARARGS, NULL }, + { (char *)"SetExt", _wrap_SetExt, METH_VARARGS, NULL }, + { (char *)"ResExt", _wrap_ResExt, METH_VARARGS, NULL }, + { (char *)"PinValue", _wrap_PinValue, METH_VARARGS, NULL }, + { (char *)"SetBPF", _wrap_SetBPF, METH_VARARGS, NULL }, + { (char *)"TestPort", _wrap_TestPort, METH_VARARGS, NULL }, + { (char *)"RCKStrobe", _wrap_RCKStrobe, METH_VARARGS, NULL }, + { (char *)"SRLoad", _wrap_SRLoad, METH_VARARGS, NULL }, + { (char *)"ResetRFE", _wrap_ResetRFE, METH_VARARGS, NULL }, + { (char *)"PA_SetLPF", _wrap_PA_SetLPF, METH_VARARGS, NULL }, + { (char *)"PA_GetADC", _wrap_PA_GetADC, METH_VARARGS, NULL }, + { (char *)"PA_ATUTune", _wrap_PA_ATUTune, METH_VARARGS, NULL }, + { (char *)"getEnableLPF0", _wrap_getEnableLPF0, METH_VARARGS, NULL }, + { (char *)"setEnableLPF0", _wrap_setEnableLPF0, METH_VARARGS, NULL }, + { (char *)"getExtended", _wrap_getExtended, METH_VARARGS, NULL }, + { (char *)"setExtended", _wrap_setExtended, METH_VARARGS, NULL }, + { (char *)"getX2Enabled", _wrap_getX2Enabled, METH_VARARGS, NULL }, + { (char *)"setX2Enabled", _wrap_setX2Enabled, METH_VARARGS, NULL }, + { (char *)"getX2Delay", _wrap_getX2Delay, METH_VARARGS, NULL }, + { (char *)"setX2Delay", _wrap_setX2Delay, METH_VARARGS, NULL }, + { (char *)"getRFE_Enabled", _wrap_getRFE_Enabled, METH_VARARGS, NULL }, + { (char *)"setRFE_Enabled", _wrap_setRFE_Enabled, METH_VARARGS, NULL }, + { (char *)"getPA_Enabled", _wrap_getPA_Enabled, METH_VARARGS, NULL }, + { (char *)"setPA_Enabled", _wrap_setPA_Enabled, METH_VARARGS, NULL }, + { (char *)"getXVTR_Enabled", _wrap_getXVTR_Enabled, METH_VARARGS, NULL }, + { (char *)"setXVTR_Enabled", _wrap_setXVTR_Enabled, METH_VARARGS, NULL }, + { (char *)"getUSB_Enabled", _wrap_getUSB_Enabled, METH_VARARGS, NULL }, + { (char *)"setUSB_Enabled", _wrap_setUSB_Enabled, METH_VARARGS, NULL }, + { (char *)"getCurrentXVTRTRMode", _wrap_getCurrentXVTRTRMode, METH_VARARGS, NULL }, + { (char *)"setCurrentXVTRTRMode", _wrap_setCurrentXVTRTRMode, METH_VARARGS, NULL }, + { (char *)"getLatchDelay", _wrap_getLatchDelay, METH_VARARGS, NULL }, + { (char *)"setLatchDelay", _wrap_setLatchDelay, METH_VARARGS, NULL }, + { (char *)"getMinFreq", _wrap_getMinFreq, METH_VARARGS, NULL }, + { (char *)"getMaxFreq", _wrap_getMaxFreq, METH_VARARGS, NULL }, + { (char *)"getBaseAddr", _wrap_getBaseAddr, METH_VARARGS, NULL }, + { (char *)"setBaseAddr", _wrap_setBaseAddr, METH_VARARGS, NULL }, + { (char *)"getBandRelay", _wrap_getBandRelay, METH_VARARGS, NULL }, + { (char *)"setBandRelay", _wrap_setBandRelay, METH_VARARGS, NULL }, + { (char *)"getTransmitRelay", _wrap_getTransmitRelay, METH_VARARGS, NULL }, + { (char *)"setTransmitRelay", _wrap_setTransmitRelay, METH_VARARGS, NULL }, + { (char *)"getMuteRelay", _wrap_getMuteRelay, METH_VARARGS, NULL }, + { (char *)"setMuteRelay", _wrap_setMuteRelay, METH_VARARGS, NULL }, + { (char *)"getGainRelay", _wrap_getGainRelay, METH_VARARGS, NULL }, + { (char *)"setGainRelay", _wrap_setGainRelay, METH_VARARGS, NULL }, + { (char *)"getExternalOutput", _wrap_getExternalOutput, METH_VARARGS, NULL }, + { (char *)"setExternalOutput", _wrap_setExternalOutput, METH_VARARGS, NULL }, + { (char *)"getDDSClockCorrection", _wrap_getDDSClockCorrection, METH_VARARGS, NULL }, + { (char *)"setDDSClockCorrection", _wrap_setDDSClockCorrection, METH_VARARGS, NULL }, + { (char *)"getPLLMult", _wrap_getPLLMult, METH_VARARGS, NULL }, + { (char *)"setPLLMult", _wrap_setPLLMult, METH_VARARGS, NULL }, + { (char *)"getDDSClock", _wrap_getDDSClock, METH_VARARGS, NULL }, + { (char *)"setDDSClock", _wrap_setDDSClock, METH_VARARGS, NULL }, + { (char *)"getIFShift", _wrap_getIFShift, METH_VARARGS, NULL }, + { (char *)"setIFShift", _wrap_setIFShift, METH_VARARGS, NULL }, + { (char *)"getSpurReduction", _wrap_getSpurReduction, METH_VARARGS, NULL }, + { (char *)"setSpurReduction", _wrap_setSpurReduction, METH_VARARGS, NULL }, + { (char *)"getIFFreq", _wrap_getIFFreq, METH_VARARGS, NULL }, + { (char *)"setIFFreq", _wrap_setIFFreq, METH_VARARGS, NULL }, + { (char *)"getDDSFreq", _wrap_getDDSFreq, METH_VARARGS, NULL }, + { (char *)"setDDSFreq", _wrap_setDDSFreq, METH_VARARGS, NULL }, + { (char *)"getSampleRate", _wrap_getSampleRate, METH_VARARGS, NULL }, + { (char *)"setSampleRate", _wrap_setSampleRate, METH_VARARGS, NULL }, + { (char *)"getFFTLength", _wrap_getFFTLength, METH_VARARGS, NULL }, + { (char *)"setFFTLength", _wrap_setFFTLength, METH_VARARGS, NULL }, + { (char *)"getTuneFFT", _wrap_getTuneFFT, METH_VARARGS, NULL }, + { (char *)"getTuneFracRel", _wrap_getTuneFracRel, METH_VARARGS, NULL }, + { (char *)"getVFOOffset", _wrap_getVFOOffset, METH_VARARGS, NULL }, + { (char *)"setVFOOffset", _wrap_setVFOOffset, METH_VARARGS, NULL }, + { (char *)"getIOUDClock", _wrap_getIOUDClock, METH_VARARGS, NULL }, + { (char *)"setIOUDClock", _wrap_setIOUDClock, METH_VARARGS, NULL }, + { (char *)"getDACMult", _wrap_getDACMult, METH_VARARGS, NULL }, + { (char *)"setDACMult", _wrap_setDACMult, METH_VARARGS, NULL }, + { (char *)"getAMP_Relay", _wrap_getAMP_Relay, METH_VARARGS, NULL }, + { (char *)"setAMP_Relay", _wrap_setAMP_Relay, METH_VARARGS, NULL }, + { (char *)"getATTN_Relay", _wrap_getATTN_Relay, METH_VARARGS, NULL }, + { (char *)"setATTN_Relay", _wrap_setATTN_Relay, METH_VARARGS, NULL }, + { (char *)"getXVTR_TR_Relay", _wrap_getXVTR_TR_Relay, METH_VARARGS, NULL }, + { (char *)"setXVTR_TR_Relay", _wrap_setXVTR_TR_Relay, METH_VARARGS, NULL }, + { (char *)"getXVTR_Relay", _wrap_getXVTR_Relay, METH_VARARGS, NULL }, + { (char *)"setXVTR_Relay", _wrap_setXVTR_Relay, METH_VARARGS, NULL }, + { (char *)"getIMPULSE_Relay", _wrap_getIMPULSE_Relay, METH_VARARGS, NULL }, + { (char *)"setIMPULSE_Relay", _wrap_setIMPULSE_Relay, METH_VARARGS, NULL }, + { (char *)"getPA_TransmitRelay", _wrap_getPA_TransmitRelay, METH_VARARGS, NULL }, + { (char *)"setPA_TransmitRelay", _wrap_setPA_TransmitRelay, METH_VARARGS, NULL }, + { (char *)"getPA_BiasOn", _wrap_getPA_BiasOn, METH_VARARGS, NULL }, + { (char *)"setPA_BiasOn", _wrap_setPA_BiasOn, METH_VARARGS, NULL }, + { NULL, NULL, 0, NULL } +}; + + +/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ + +static swig_type_info _swigt__p_ushort[] = {{"_p_ushort", 0, "ushort *", 0, 0, 0, 0},{"_p_ushort", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_char[] = {{"_p_char", 0, "char *", 0, 0, 0, 0},{"_p_char", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_u_short[] = {{"_p_u_short", 0, "u_short *", 0, 0, 0, 0},{"_p_u_short", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; + +static swig_type_info *swig_types_initial[] = { +_swigt__p_ushort, +_swigt__p_char, +_swigt__p_u_short, +0 +}; + + +/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ + +static swig_const_info swig_const_table[] = { +{0, 0, 0, 0.0, 0, 0}}; + +#ifdef __cplusplus +} +#endif + +#ifdef __cplusplus +extern "C" +#endif +SWIGEXPORT(void) SWIG_init(void) { + static PyObject *SWIG_globals = 0; + static int typeinit = 0; + PyObject *m, *d; + int i; + if (!SWIG_globals) SWIG_globals = SWIG_newvarlink(); + m = Py_InitModule((char *) SWIG_name, SwigMethods); + d = PyModule_GetDict(m); + + if (!typeinit) { + for (i = 0; swig_types_initial[i]; i++) { + swig_types[i] = SWIG_TypeRegister(swig_types_initial[i]); + } + typeinit = 1; + } + SWIG_InstallConstants(d,swig_const_table); + + PyDict_SetItemString(d,"FALSE", SWIG_From_int((int)0)); + PyDict_SetItemString(d,"TRUE", SWIG_From_int((int)1)); + PyDict_SetItemString(d,(char*)"cvar", SWIG_globals); + SWIG_addvarlink(SWIG_globals,(char*)"DttSP_SampleRate",_wrap_DttSP_SampleRate_get, _wrap_DttSP_SampleRate_set); + PyDict_SetItemString(d,"IARU1", SWIG_From_int((int)IARU1)); + PyDict_SetItemString(d,"IARU2", SWIG_From_int((int)IARU2)); + PyDict_SetItemString(d,"IARU3", SWIG_From_int((int)IARU3)); + PyDict_SetItemString(d,"BYPASS", SWIG_From_int((int)BYPASS)); + PyDict_SetItemString(d,"MEMORY", SWIG_From_int((int)MEMORY)); + PyDict_SetItemString(d,"FULL", SWIG_From_int((int)FULL)); + PyDict_SetItemString(d,"LAST", SWIG_From_int((int)LAST)); + PyDict_SetItemString(d,"POSITIVE", SWIG_From_int((int)POSITIVE)); + PyDict_SetItemString(d,"NEGATIVE", SWIG_From_int((int)NEGATIVE)); + PyDict_SetItemString(d,"NONE", SWIG_From_int((int)NONE)); + PyDict_SetItemString(d,"bsnone", SWIG_From_int((int)bsnone)); + PyDict_SetItemString(d,"bs0", SWIG_From_int((int)bs0)); + PyDict_SetItemString(d,"bs1", SWIG_From_int((int)bs1)); + PyDict_SetItemString(d,"bs2", SWIG_From_int((int)bs2)); + PyDict_SetItemString(d,"bs3", SWIG_From_int((int)bs3)); + PyDict_SetItemString(d,"bs4", SWIG_From_int((int)bs4)); + PyDict_SetItemString(d,"bs5", SWIG_From_int((int)bs5)); + PyDict_SetItemString(d,"EXT", SWIG_From_int((int)EXT)); + PyDict_SetItemString(d,"BPF", SWIG_From_int((int)BPF)); + PyDict_SetItemString(d,"DAT", SWIG_From_int((int)DAT)); + PyDict_SetItemString(d,"ADR", SWIG_From_int((int)ADR)); + PyDict_SetItemString(d,"PIN_12", SWIG_From_int((int)PIN_12)); + PyDict_SetItemString(d,"Dash", SWIG_From_int((int)Dash)); + PyDict_SetItemString(d,"Dot", SWIG_From_int((int)Dot)); + PyDict_SetItemString(d,"PA_DATA", SWIG_From_int((int)PA_DATA)); + PyDict_SetItemString(d,"PIN_11", SWIG_From_int((int)PIN_11)); + PyDict_SetItemString(d,"P1", SWIG_From_int((int)P1)); + PyDict_SetItemString(d,"P2", SWIG_From_int((int)P2)); + PyDict_SetItemString(d,"P3", SWIG_From_int((int)P3)); + PyDict_SetItemString(d,"P4", SWIG_From_int((int)P4)); + PyDict_SetItemString(d,"P5", SWIG_From_int((int)P5)); + PyDict_SetItemString(d,"P6", SWIG_From_int((int)P6)); + PyDict_SetItemString(d,"P7", SWIG_From_int((int)P7)); + PyDict_SetItemString(d,"SER", SWIG_From_int((int)0x01)); + PyDict_SetItemString(d,"SCK", SWIG_From_int((int)0x02)); + PyDict_SetItemString(d,"SCLR_NOT", SWIG_From_int((int)0x04)); + PyDict_SetItemString(d,"DCDR_NE", SWIG_From_int((int)0x20)); + PyDict_SetItemString(d,"IC11", SWIG_From_int((int)IC11)); + PyDict_SetItemString(d,"IC7", SWIG_From_int((int)IC7)); + PyDict_SetItemString(d,"IC9", SWIG_From_int((int)IC9)); + PyDict_SetItemString(d,"IC10", SWIG_From_int((int)IC10)); + PyDict_SetItemString(d,"LPF0", SWIG_From_int((int)0x01)); + PyDict_SetItemString(d,"LPF1", SWIG_From_int((int)0x02)); + PyDict_SetItemString(d,"LPF2", SWIG_From_int((int)0x04)); + PyDict_SetItemString(d,"LPF3", SWIG_From_int((int)0x08)); + PyDict_SetItemString(d,"LPF4", SWIG_From_int((int)0x10)); + PyDict_SetItemString(d,"LPF5", SWIG_From_int((int)0x20)); + PyDict_SetItemString(d,"LPF6", SWIG_From_int((int)0x40)); + PyDict_SetItemString(d,"LPF7", SWIG_From_int((int)0x80)); + PyDict_SetItemString(d,"LPF8", SWIG_From_int((int)0x01)); + PyDict_SetItemString(d,"LPF9", SWIG_From_int((int)0x02)); + PyDict_SetItemString(d,"BPF0", SWIG_From_int((int)0x80)); + PyDict_SetItemString(d,"BPF1", SWIG_From_int((int)0x40)); + PyDict_SetItemString(d,"BPF2", SWIG_From_int((int)0x10)); + PyDict_SetItemString(d,"BPF3", SWIG_From_int((int)0x20)); + PyDict_SetItemString(d,"BPF4", SWIG_From_int((int)0x08)); + PyDict_SetItemString(d,"BPF5", SWIG_From_int((int)0x04)); + SWIG_addvarlink(SWIG_globals,(char*)"ic11_memory",_wrap_ic11_memory_get, _wrap_ic11_memory_set); + PyDict_SetItemString(d,"PAF0", SWIG_From_int((int)0x01)); + PyDict_SetItemString(d,"PAF1", SWIG_From_int((int)0x02)); + PyDict_SetItemString(d,"PAF2", SWIG_From_int((int)0x04)); + PyDict_SetItemString(d,"ADC_CLK", SWIG_From_int((int)0x08)); + PyDict_SetItemString(d,"ADC_DI", SWIG_From_int((int)0x10)); + PyDict_SetItemString(d,"ADC_CS_NOT", SWIG_From_int((int)0x20)); + PyDict_SetItemString(d,"PATR", SWIG_From_int((int)0x40)); + PyDict_SetItemString(d,"ATUCTL", SWIG_From_int((int)0x80)); + SWIG_addvarlink(SWIG_globals,(char*)"ic7_memory",_wrap_ic7_memory_get, _wrap_ic7_memory_set); + PyDict_SetItemString(d,"AMP_RLYS", SWIG_From_int((int)0x03)); + PyDict_SetItemString(d,"XVTR_TR_RLY", SWIG_From_int((int)0x04)); + PyDict_SetItemString(d,"XVTR_RLY", SWIG_From_int((int)0x08)); + PyDict_SetItemString(d,"ATTN_RLY", SWIG_From_int((int)0x10)); + PyDict_SetItemString(d,"IMPULSE_RLY", SWIG_From_int((int)0x20)); + PyDict_SetItemString(d,"PA_BIAS_NOT", SWIG_From_int((int)0x40)); + PyDict_SetItemString(d,"IMPULSE", SWIG_From_int((int)0x80)); + SWIG_addvarlink(SWIG_globals,(char*)"rfe_enabled",_wrap_rfe_enabled_get, _wrap_rfe_enabled_set); + SWIG_addvarlink(SWIG_globals,(char*)"xvtr_enabled",_wrap_xvtr_enabled_get, _wrap_xvtr_enabled_set); + SWIG_addvarlink(SWIG_globals,(char*)"pa_enabled",_wrap_pa_enabled_get, _wrap_pa_enabled_set); + PyDict_SetItemString(d,"PA_LPF_OFF", SWIG_From_int((int)0)); + PyDict_SetItemString(d,"PA_LPF_12_10", SWIG_From_int((int)0x01)); + PyDict_SetItemString(d,"PA_LPF_17_15", SWIG_From_int((int)0x02)); + PyDict_SetItemString(d,"PA_LPF_30_20", SWIG_From_int((int)0x01+0x02)); + PyDict_SetItemString(d,"PA_LPF_60_40", SWIG_From_int((int)0x04)); + PyDict_SetItemString(d,"PA_LPF_80", SWIG_From_int((int)0x04+0x01)); + PyDict_SetItemString(d,"PA_LPF_160", SWIG_From_int((int)0x04+0x02)); + PyDict_SetItemString(d,"PA_FORWARD_PWR", SWIG_From_int((int)0)); + PyDict_SetItemString(d,"PA_REVERSE_PWR", SWIG_From_int((int)1)); + PyDict_SetItemString(d,"TR", SWIG_From_int((int)0x40)); + PyDict_SetItemString(d,"MUTE", SWIG_From_int((int)0x80)); + PyDict_SetItemString(d,"GAIN", SWIG_From_int((int)0x80)); + PyDict_SetItemString(d,"WRB", SWIG_From_int((int)0x40)); + PyDict_SetItemString(d,"RESET", SWIG_From_int((int)0x80)); + SWIG_addvarlink(SWIG_globals,(char*)"band_relay",_wrap_band_relay_get, _wrap_band_relay_set); + SWIG_addvarlink(SWIG_globals,(char*)"external_output",_wrap_external_output_get, _wrap_external_output_set); + SWIG_addvarlink(SWIG_globals,(char*)"mute_relay",_wrap_mute_relay_get, _wrap_mute_relay_set); + SWIG_addvarlink(SWIG_globals,(char*)"transmit_relay",_wrap_transmit_relay_get, _wrap_transmit_relay_set); + SWIG_addvarlink(SWIG_globals,(char*)"gain_relay",_wrap_gain_relay_get, _wrap_gain_relay_set); + SWIG_addvarlink(SWIG_globals,(char*)"latch_delay",_wrap_latch_delay_get, _wrap_latch_delay_set); + PyDict_SetItemString(d,"COMP_PD", SWIG_From_int((int)0x10)); + PyDict_SetItemString(d,"DIG_PD", SWIG_From_int((int)0x01)); + PyDict_SetItemString(d,"BYPASS_PLL", SWIG_From_int((int)0x20)); + PyDict_SetItemString(d,"INT_IOUD", SWIG_From_int((int)0x01)); + PyDict_SetItemString(d,"OSK_EN", SWIG_From_int((int)0x20)); + PyDict_SetItemString(d,"OSK_INT", SWIG_From_int((int)0x10)); + PyDict_SetItemString(d,"BYPASS_SINC", SWIG_From_int((int)0x40)); + PyDict_SetItemString(d,"PLL_RANGE", SWIG_From_int((int)0x40)); + SWIG_addvarlink(SWIG_globals,(char*)"dds_clock",_wrap_dds_clock_get, _wrap_dds_clock_set); + SWIG_addvarlink(SWIG_globals,(char*)"pll_mult",_wrap_pll_mult_get, _wrap_pll_mult_set); + SWIG_addvarlink(SWIG_globals,(char*)"dds_clock_correction",_wrap_dds_clock_correction_get, _wrap_dds_clock_correction_set); + SWIG_addvarlink(SWIG_globals,(char*)"sysClock",_wrap_sysClock_get, _wrap_sysClock_set); + SWIG_addvarlink(SWIG_globals,(char*)"ioud_clock",_wrap_ioud_clock_get, _wrap_ioud_clock_set); + SWIG_addvarlink(SWIG_globals,(char*)"dac_mult",_wrap_dac_mult_get, _wrap_dac_mult_set); + SWIG_addvarlink(SWIG_globals,(char*)"dds_freq",_wrap_dds_freq_get, _wrap_dds_freq_set); + SWIG_addvarlink(SWIG_globals,(char*)"if_freq",_wrap_if_freq_get, _wrap_if_freq_set); + SWIG_addvarlink(SWIG_globals,(char*)"if_shift",_wrap_if_shift_get, _wrap_if_shift_set); + SWIG_addvarlink(SWIG_globals,(char*)"spur_reduction",_wrap_spur_reduction_get, _wrap_spur_reduction_set); + SWIG_addvarlink(SWIG_globals,(char*)"dds_step_size",_wrap_dds_step_size_get, _wrap_dds_step_size_set); + SWIG_addvarlink(SWIG_globals,(char*)"sample_rate",_wrap_sample_rate_get, _wrap_sample_rate_set); + SWIG_addvarlink(SWIG_globals,(char*)"fft_length",_wrap_fft_length_get, _wrap_fft_length_set); + SWIG_addvarlink(SWIG_globals,(char*)"FFT_Bin_Size",_wrap_FFT_Bin_Size_get, _wrap_FFT_Bin_Size_set); + SWIG_addvarlink(SWIG_globals,(char*)"tune_fft",_wrap_tune_fft_get, _wrap_tune_fft_set); + SWIG_addvarlink(SWIG_globals,(char*)"tune_frac_rel",_wrap_tune_frac_rel_get, _wrap_tune_frac_rel_set); + SWIG_addvarlink(SWIG_globals,(char*)"vfo_offset",_wrap_vfo_offset_get, _wrap_vfo_offset_set); + SWIG_addvarlink(SWIG_globals,(char*)"min_freq",_wrap_min_freq_get, _wrap_min_freq_set); + SWIG_addvarlink(SWIG_globals,(char*)"max_freq",_wrap_max_freq_get, _wrap_max_freq_set); + SWIG_addvarlink(SWIG_globals,(char*)"baseAdr",_wrap_baseAdr_get, _wrap_baseAdr_set); + SWIG_addvarlink(SWIG_globals,(char*)"curBandPlan",_wrap_curBandPlan_get, _wrap_curBandPlan_set); + SWIG_addvarlink(SWIG_globals,(char*)"TWO_TO_THE_48_DIVIDED_BY_200",_wrap_TWO_TO_THE_48_DIVIDED_BY_200_get, _wrap_TWO_TO_THE_48_DIVIDED_BY_200_set); + SWIG_addvarlink(SWIG_globals,(char*)"last_tuning_word",_wrap_last_tuning_word_get, _wrap_last_tuning_word_set); + SWIG_addvarlink(SWIG_globals,(char*)"usb_enabled",_wrap_usb_enabled_get, _wrap_usb_enabled_set); + PyDict_SetItemString(d,"SDR1K_LATCH_EXT", SWIG_From_int((int)0x01)); + PyDict_SetItemString(d,"SDR1K_LATCH_BPF", SWIG_From_int((int)0x02)); +} + diff --git a/pyhw2/hw2.py b/pyhw2/hw2.py new file mode 100644 index 0000000..386e8ae --- /dev/null +++ b/pyhw2/hw2.py @@ -0,0 +1,39 @@ +#/usr/bin/env python + +import sys +from sdr1khw import * + +FALSE = 0 +TRUE = 1 + +openPort("/dev/parport0") +DttSP_SampleRate = 48000.0 + +setRFE_Enabled(TRUE) +ResetRFE() +setXVTR_Enabled(FALSE) +setExtended(FALSE) +setXVTR_TR_Relay(FALSE) +setBandRelay(bs0) + +Init() + +setVFOOffset(0.0) +setATTN_Relay(TRUE) +setTransmitRelay(FALSE) +setGainRelay(TRUE) +setSpurReduction(FALSE) +setExternalOutput(FALSE) +setDDSClockCorrection(0.0) +setDDSFreq(13.845) +setMuteRelay(FALSE) + +print "Ready" + +cmd = sys.stdin.readline() +while not cmd == '': + res = eval(cmd) + print res + cmd = sys.stdin.readline() + +closePort() diff --git a/pyhw2/sdr1k-setup.py b/pyhw2/sdr1k-setup.py new file mode 100644 index 0000000..6e69452 --- /dev/null +++ b/pyhw2/sdr1k-setup.py @@ -0,0 +1,23 @@ +from sdr1khw import * + +openPort("/dev/parport0") +DttSP_SampleRate = 48000.0 + +setRFE_Enabled(TRUE) +ResetRFE() +setXVTR_Enabled(FALSE) +setExtended(FALSE) +setXVTR_TR_Relay(FALSE) +setBandRelay(bs0) + +Init() + +setVFOOffset(0.0) +setATTN_Relay(TRUE) +setTransmitRelay(FALSE) +setGainRelay(TRUE) +setSpurReduction(FALSE) +setExternalOutput(FALSE) +setDDSClockCorrection(0.0) +setDDSFreq(13.845) +setMuteRelay(FALSE) diff --git a/pyhw2/sdr1khw.py b/pyhw2/sdr1khw.py new file mode 100644 index 0000000..3aac512 --- /dev/null +++ b/pyhw2/sdr1khw.py @@ -0,0 +1,330 @@ +# This file was created automatically by SWIG. +# Don't modify this file, modify the SWIG interface instead. +# This file is compatible with both classic and new-style classes. + +import _sdr1khw + +def _swig_setattr(self,class_type,name,value): + if (name == "this"): + if isinstance(value, class_type): + self.__dict__[name] = value.this + if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown + del value.thisown + return + method = class_type.__swig_setmethods__.get(name,None) + if method: return method(self,value) + self.__dict__[name] = value + +def _swig_getattr(self,class_type,name): + method = class_type.__swig_getmethods__.get(name,None) + if method: return method(self) + raise AttributeError,name + +import types +try: + _object = types.ObjectType + _newclass = 1 +except AttributeError: + class _object : pass + _newclass = 0 +del types + + +FALSE = _sdr1khw.FALSE +TRUE = _sdr1khw.TRUE +IARU1 = _sdr1khw.IARU1 +IARU2 = _sdr1khw.IARU2 +IARU3 = _sdr1khw.IARU3 +BYPASS = _sdr1khw.BYPASS +MEMORY = _sdr1khw.MEMORY +FULL = _sdr1khw.FULL +LAST = _sdr1khw.LAST +POSITIVE = _sdr1khw.POSITIVE +NEGATIVE = _sdr1khw.NEGATIVE +NONE = _sdr1khw.NONE +bsnone = _sdr1khw.bsnone +bs0 = _sdr1khw.bs0 +bs1 = _sdr1khw.bs1 +bs2 = _sdr1khw.bs2 +bs3 = _sdr1khw.bs3 +bs4 = _sdr1khw.bs4 +bs5 = _sdr1khw.bs5 +EXT = _sdr1khw.EXT +BPF = _sdr1khw.BPF +DAT = _sdr1khw.DAT +ADR = _sdr1khw.ADR +PIN_12 = _sdr1khw.PIN_12 +Dash = _sdr1khw.Dash +Dot = _sdr1khw.Dot +PA_DATA = _sdr1khw.PA_DATA +PIN_11 = _sdr1khw.PIN_11 +P1 = _sdr1khw.P1 +P2 = _sdr1khw.P2 +P3 = _sdr1khw.P3 +P4 = _sdr1khw.P4 +P5 = _sdr1khw.P5 +P6 = _sdr1khw.P6 +P7 = _sdr1khw.P7 +SER = _sdr1khw.SER +SCK = _sdr1khw.SCK +SCLR_NOT = _sdr1khw.SCLR_NOT +DCDR_NE = _sdr1khw.DCDR_NE +IC11 = _sdr1khw.IC11 +IC7 = _sdr1khw.IC7 +IC9 = _sdr1khw.IC9 +IC10 = _sdr1khw.IC10 +LPF0 = _sdr1khw.LPF0 +LPF1 = _sdr1khw.LPF1 +LPF2 = _sdr1khw.LPF2 +LPF3 = _sdr1khw.LPF3 +LPF4 = _sdr1khw.LPF4 +LPF5 = _sdr1khw.LPF5 +LPF6 = _sdr1khw.LPF6 +LPF7 = _sdr1khw.LPF7 +LPF8 = _sdr1khw.LPF8 +LPF9 = _sdr1khw.LPF9 +BPF0 = _sdr1khw.BPF0 +BPF1 = _sdr1khw.BPF1 +BPF2 = _sdr1khw.BPF2 +BPF3 = _sdr1khw.BPF3 +BPF4 = _sdr1khw.BPF4 +BPF5 = _sdr1khw.BPF5 +PAF0 = _sdr1khw.PAF0 +PAF1 = _sdr1khw.PAF1 +PAF2 = _sdr1khw.PAF2 +ADC_CLK = _sdr1khw.ADC_CLK +ADC_DI = _sdr1khw.ADC_DI +ADC_CS_NOT = _sdr1khw.ADC_CS_NOT +PATR = _sdr1khw.PATR +ATUCTL = _sdr1khw.ATUCTL +AMP_RLYS = _sdr1khw.AMP_RLYS +XVTR_TR_RLY = _sdr1khw.XVTR_TR_RLY +XVTR_RLY = _sdr1khw.XVTR_RLY +ATTN_RLY = _sdr1khw.ATTN_RLY +IMPULSE_RLY = _sdr1khw.IMPULSE_RLY +PA_BIAS_NOT = _sdr1khw.PA_BIAS_NOT +IMPULSE = _sdr1khw.IMPULSE +PA_LPF_OFF = _sdr1khw.PA_LPF_OFF +PA_LPF_12_10 = _sdr1khw.PA_LPF_12_10 +PA_LPF_17_15 = _sdr1khw.PA_LPF_17_15 +PA_LPF_30_20 = _sdr1khw.PA_LPF_30_20 +PA_LPF_60_40 = _sdr1khw.PA_LPF_60_40 +PA_LPF_80 = _sdr1khw.PA_LPF_80 +PA_LPF_160 = _sdr1khw.PA_LPF_160 +PA_FORWARD_PWR = _sdr1khw.PA_FORWARD_PWR +PA_REVERSE_PWR = _sdr1khw.PA_REVERSE_PWR +TR = _sdr1khw.TR +MUTE = _sdr1khw.MUTE +GAIN = _sdr1khw.GAIN +WRB = _sdr1khw.WRB +RESET = _sdr1khw.RESET +COMP_PD = _sdr1khw.COMP_PD +DIG_PD = _sdr1khw.DIG_PD +BYPASS_PLL = _sdr1khw.BYPASS_PLL +INT_IOUD = _sdr1khw.INT_IOUD +OSK_EN = _sdr1khw.OSK_EN +OSK_INT = _sdr1khw.OSK_INT +BYPASS_SINC = _sdr1khw.BYPASS_SINC +PLL_RANGE = _sdr1khw.PLL_RANGE +SDR1K_LATCH_EXT = _sdr1khw.SDR1K_LATCH_EXT +SDR1K_LATCH_BPF = _sdr1khw.SDR1K_LATCH_BPF + +openPort = _sdr1khw.openPort + +closePort = _sdr1khw.closePort + +USB_Sdr1kLatch = _sdr1khw.USB_Sdr1kLatch + +USB_Sdr1kGetStatusPort = _sdr1khw.USB_Sdr1kGetStatusPort + +USB_Sdr1kGetADC = _sdr1khw.USB_Sdr1kGetADC + +USB_Sdr1kDDSReset = _sdr1khw.USB_Sdr1kDDSReset + +USB_Sdr1kDDSWrite = _sdr1khw.USB_Sdr1kDDSWrite + +USB_Sdr1kSRLoad = _sdr1khw.USB_Sdr1kSRLoad + +DttSP_ChangeOsc = _sdr1khw.DttSP_ChangeOsc + +Init = _sdr1khw.Init + +PowerOn = _sdr1khw.PowerOn + +StandBy = _sdr1khw.StandBy + +Impulse = _sdr1khw.Impulse + +StatusPort = _sdr1khw.StatusPort + +SetExt = _sdr1khw.SetExt + +ResExt = _sdr1khw.ResExt + +PinValue = _sdr1khw.PinValue + +SetBPF = _sdr1khw.SetBPF + +TestPort = _sdr1khw.TestPort + +RCKStrobe = _sdr1khw.RCKStrobe + +SRLoad = _sdr1khw.SRLoad + +ResetRFE = _sdr1khw.ResetRFE + +PA_SetLPF = _sdr1khw.PA_SetLPF + +PA_GetADC = _sdr1khw.PA_GetADC + +PA_ATUTune = _sdr1khw.PA_ATUTune + +getEnableLPF0 = _sdr1khw.getEnableLPF0 + +setEnableLPF0 = _sdr1khw.setEnableLPF0 + +getExtended = _sdr1khw.getExtended + +setExtended = _sdr1khw.setExtended + +getX2Enabled = _sdr1khw.getX2Enabled + +setX2Enabled = _sdr1khw.setX2Enabled + +getX2Delay = _sdr1khw.getX2Delay + +setX2Delay = _sdr1khw.setX2Delay + +getRFE_Enabled = _sdr1khw.getRFE_Enabled + +setRFE_Enabled = _sdr1khw.setRFE_Enabled + +getPA_Enabled = _sdr1khw.getPA_Enabled + +setPA_Enabled = _sdr1khw.setPA_Enabled + +getXVTR_Enabled = _sdr1khw.getXVTR_Enabled + +setXVTR_Enabled = _sdr1khw.setXVTR_Enabled + +getUSB_Enabled = _sdr1khw.getUSB_Enabled + +setUSB_Enabled = _sdr1khw.setUSB_Enabled + +getCurrentXVTRTRMode = _sdr1khw.getCurrentXVTRTRMode + +setCurrentXVTRTRMode = _sdr1khw.setCurrentXVTRTRMode + +getLatchDelay = _sdr1khw.getLatchDelay + +setLatchDelay = _sdr1khw.setLatchDelay + +getMinFreq = _sdr1khw.getMinFreq + +getMaxFreq = _sdr1khw.getMaxFreq + +getBaseAddr = _sdr1khw.getBaseAddr + +setBaseAddr = _sdr1khw.setBaseAddr + +getBandRelay = _sdr1khw.getBandRelay + +setBandRelay = _sdr1khw.setBandRelay + +getTransmitRelay = _sdr1khw.getTransmitRelay + +setTransmitRelay = _sdr1khw.setTransmitRelay + +getMuteRelay = _sdr1khw.getMuteRelay + +setMuteRelay = _sdr1khw.setMuteRelay + +getGainRelay = _sdr1khw.getGainRelay + +setGainRelay = _sdr1khw.setGainRelay + +getExternalOutput = _sdr1khw.getExternalOutput + +setExternalOutput = _sdr1khw.setExternalOutput + +getDDSClockCorrection = _sdr1khw.getDDSClockCorrection + +setDDSClockCorrection = _sdr1khw.setDDSClockCorrection + +getPLLMult = _sdr1khw.getPLLMult + +setPLLMult = _sdr1khw.setPLLMult + +getDDSClock = _sdr1khw.getDDSClock + +setDDSClock = _sdr1khw.setDDSClock + +getIFShift = _sdr1khw.getIFShift + +setIFShift = _sdr1khw.setIFShift + +getSpurReduction = _sdr1khw.getSpurReduction + +setSpurReduction = _sdr1khw.setSpurReduction + +getIFFreq = _sdr1khw.getIFFreq + +setIFFreq = _sdr1khw.setIFFreq + +getDDSFreq = _sdr1khw.getDDSFreq + +setDDSFreq = _sdr1khw.setDDSFreq + +getSampleRate = _sdr1khw.getSampleRate + +setSampleRate = _sdr1khw.setSampleRate + +getFFTLength = _sdr1khw.getFFTLength + +setFFTLength = _sdr1khw.setFFTLength + +getTuneFFT = _sdr1khw.getTuneFFT + +getTuneFracRel = _sdr1khw.getTuneFracRel + +getVFOOffset = _sdr1khw.getVFOOffset + +setVFOOffset = _sdr1khw.setVFOOffset + +getIOUDClock = _sdr1khw.getIOUDClock + +setIOUDClock = _sdr1khw.setIOUDClock + +getDACMult = _sdr1khw.getDACMult + +setDACMult = _sdr1khw.setDACMult + +getAMP_Relay = _sdr1khw.getAMP_Relay + +setAMP_Relay = _sdr1khw.setAMP_Relay + +getATTN_Relay = _sdr1khw.getATTN_Relay + +setATTN_Relay = _sdr1khw.setATTN_Relay + +getXVTR_TR_Relay = _sdr1khw.getXVTR_TR_Relay + +setXVTR_TR_Relay = _sdr1khw.setXVTR_TR_Relay + +getXVTR_Relay = _sdr1khw.getXVTR_Relay + +setXVTR_Relay = _sdr1khw.setXVTR_Relay + +getIMPULSE_Relay = _sdr1khw.getIMPULSE_Relay + +setIMPULSE_Relay = _sdr1khw.setIMPULSE_Relay + +getPA_TransmitRelay = _sdr1khw.getPA_TransmitRelay + +setPA_TransmitRelay = _sdr1khw.setPA_TransmitRelay + +getPA_BiasOn = _sdr1khw.getPA_BiasOn + +setPA_BiasOn = _sdr1khw.setPA_BiasOn +cvar = _sdr1khw.cvar +