def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) self.use_sidetone = 0 self.vfo_frequency = 52000000 self.vfo_sample_rate = conf.sample_rate self.vfo_test = 0 # JIM self.adf4351_freq = 52E6 self.tx_frequency = 0 self.firmware_version = None # firmware version is initially unknown self.rx_udp_socket = None self.got_udp_status = '' self.got_adf4351_status = '' self.rx_phase0 = self.rx_phase1 = 0 self.tx_phase = 0 self.scan_enable = 0 self.scan_blocks = 0 self.scan_samples = 1 self.scan_phase = 0 self.fft_scan_valid = 0.84 self.adf4351_int_mode = 1 # integer one, fractional zero self.adf4351_aux_rf_out = 0b101 self.adf4351_rf_divider = 4 # Fout = Fvco / 2 ** rf_divider self.adf4351_band_sel_clock_div = 40 self.adf4351_r_counter = 8 # Fpfd = Fref / 2 / r_counter self.adf4351_int_value = 1317 # Fvco = Fpfd * (int_value + frac_value / modulus) self.adf4351_frac_value = 0 self.adf4351_modulus = 23 self.decim3 = 10 self.SetDecim(192000) self.var_rates = ['31X', '19X', '9X', '5X', '3X', '2X', '1728', '1152', '768', '384', '192', '96', '48'] # supported sample rates as strings self.index = 0 self.NewUdpStatus() self.NewAdf4351(self.adf4351_freq)
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) self.use_sidetone = 1 self.clock = conf.sdriq_clock self.rf_gain_labels = ('RF +30', 'RF +20', 'RF +10', 'RF 0 dB') if conf.fft_size_multiplier == 0: conf.fft_size_multiplier = 3 # Set size needed by VarDecim
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) self.rf_gain_labels = ('RF +0', 'RF -10', 'RF -20', 'RF -30') self.antenna_labels = ('Wide Band', 'Band Filter') self.vardecim_index = 0 self.fVFO = 0.0 # Careful, this is a float if DEBUG: print ("__init__: %s" % conf) self.rates = [ 48000, \ 95000, \ 96000, \ 125000, \ 192000, \ 250000, \ 500000, \ 1000000, \ 1600000, \ 2000000 \ ] self.current_rate = 192000 self.att = 0; self.wb = 0 def __del__(self): # try to clear hardware if perseus: perseus.close() perseus.deinit()
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) global UseSdriq, UseRxudp, Application, Config Application = app Config = conf UseSdriq = conf.use_sdriq UseRxudp = conf.use_rx_udp self.use_sidetone = 1 self.vfo_frequency = 0 # current vfo frequency # Select receiver if conf.use_rx_udp: from hiqsdr import quisk_hardware as hw self.receiver = hw.Hardware(app, conf) self.rf_gain_labels = ('RF 0 dB', 'RF +16', 'RF -20', 'RF -10') elif UseSdriq: from sdriqpkg import quisk_hardware as quisk_hardware_sdriq self.receiver = quisk_hardware_sdriq.Hardware(app, conf) self.rf_gain_labels = self.receiver.rf_gain_labels else: self.receiver = HwRxEthVfo() self.rf_gain_labels = ('RF 0 dB', 'RF +16', 'RF -20', 'RF -10') # Select transmitter if conf.use_rx_udp: self.transmitter = self.receiver # this is a transceiver elif Config.tx_ip: self.transmitter = HwTx2007() else: self.transmitter = BaseHardware(app, conf) # Other hardware self.anttuner = AntennaTuner() # Control the antenna tuner self.lpfilter = LowPassFilter() # Control LP filter box self.hpfilter = HighPassFilter() # Control HP filter box
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) self.use_sidetone = 1 self.clock = conf.sdriq_clock self.rf_gain_labels = ('RF +30', 'RF +20', 'RF +10', 'RF 0 dB') if conf.fft_size_multiplier == 0: conf.fft_size_multiplier = 3 # Set size needed by VarDecim
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) self.device = None self.usb = None self.rf_gain_labels = ('RF +10', 'RF 0', 'RF -10', 'RF -20') self.index = 1 self.enable = 0 self.rate = 0 self.att = 10 self.freq = 7220000 self.old_freq = 0 self.sdrmicron_clock = 76800000 self.sdrmicron_decim = 1600 self.bscope_data = '' self.fw_ver = None self.frame_msg = '' if conf.fft_size_multiplier == 0: conf.fft_size_multiplier = 3 # Set size needed by VarDecim rx_bytes = 3 # rx_bytes is the number of bytes in each I or Q sample: 1, 2, 3, or 4 rx_endian = 1 # rx_endian is the order of bytes in the sample array: 0 == little endian; 1 == big endian self.InitSamples( rx_bytes, rx_endian ) # Initialize: read samples from this hardware file and send them to Quisk bs_bytes = 2 bs_endian = 1 self.InitBscope(bs_bytes, bs_endian, self.sdrmicron_clock, 16384) # Initialize bandscope
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) self.use_sidetone = 1 self.got_udp_status = '' # status from UDP receiver # want_udp_status is a string with numbers in little-endian order: # [0:2] 'St' # [2:6] Rx tune phase # [6:10] Tx tune phase # [10:11] Tx output level 0 to 255 # [11:12] Tx control bits # 0 No transmit # 1 CW # 2 SSB and IMD # [12:13] Rx control bits # Second stage decimation less one, 1-39, six bits # [13:14] zero self.rx_phase = 0 self.tx_phase = 0 self.tx_level = 0 self.tx_control = 0 self.rx_control = 0 self.index = 0 self.mode = None self.firmware_version = None # firmware version is initially unknown self.is_spot = 0 # Are we in Spot mode? self.rx_udp_socket = None self.vfo_frequency = 0 # current vfo frequency self.tx_frequency = 0 self.decimations = [] # supported decimation rates for dec in (40, 20, 10, 8, 5, 4, 2): self.decimations.append(dec * 64) if self.conf.fft_size_multiplier == 0: self.conf.fft_size_multiplier = 7 # Set size needed by VarDecim
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) self.use_sidetone = 0 self.vfo_frequency = 52000000 self.vfo_sample_rate = conf.sample_rate self.vfo_test = 0 # JIM self.tx_frequency = 0 self.firmware_version = None # firmware version is initially unknown self.rx_udp_socket = None self.tx_udp_socket = None self.got_rx_udp_status = '' self.got_tx_udp_status = '' self.band = '' self.rx_phase0 = self.rx_phase1 = 0 self.tx_phase = 0 self.button_PTT = 0 self.mode_is_cw = 0 self.scan_enable = 0 self.scan_blocks = 0 self.scan_samples = 1 self.scan_phase = 0 self.fft_scan_valid = 0.84 self.Rx4351 = Adf4351(True, conf.rx_clock38, 8) self.Tx4351 = Adf4351(False, 10700000, 2) self.Tx4351.aux_rf_out = 0b000 # enable aux RF out 0b111 or turn off 0b000 self.decim3 = 10 self.SetDecim(192000) self.var_rates = ['31X', '19X', '9X', '5X', '3X', '2X', '1728', '1152', '768', '384', '192', '96', '48'] # supported sample rates as strings self.index = 0 self.DcI, self.DcQ = (0.0, 0.0) self.NewAdf4351(self.Rx4351, 146E6) self.NewAdf4351(self.Tx4351, 146E6) self.NewAd9951(52e6) self.NewUdpStatus()
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) global UseSdriq, UseRxudp, Application, Config Application = app Config = conf UseSdriq = conf.use_sdriq UseRxudp = conf.use_rx_udp self.use_sidetone = 1 self.vfo_frequency = 0 # current vfo frequency # Select receiver if conf.use_rx_udp: from n2adr import hardware_transceiver self.receiver = hardware_transceiver.Hardware(app, conf) self.rf_gain_labels = ('RF 0 dB', 'RF +16', 'RF -20', 'RF -10') elif UseSdriq: from sdriqpkg import quisk_hardware as quisk_hardware_sdriq self.receiver = quisk_hardware_sdriq.Hardware(app, conf) self.rf_gain_labels = self.receiver.rf_gain_labels else: self.receiver = HwRxEthVfo() self.rf_gain_labels = ('RF 0 dB', 'RF +16', 'RF -20', 'RF -10') # Select transmitter if conf.use_rx_udp: self.transmitter = self.receiver # this is a transceiver elif Config.tx_ip: self.transmitter = HwTx2007() else: self.transmitter = BaseHardware(app, conf) # Other hardware self.anttuner = AntennaTuner() # Control the antenna tuner self.lpfilter = LowPassFilter() # Control LP filter box self.hpfilter = HighPassFilter() # Control HP filter box
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) self.usb_dev = None self.vfo = None self.ptt_button = 0 self.is_cw = False self.key_thread = None self.si570_i2c_address = conf.si570_i2c_address
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) self.debug = 1 self.si5351 = Si5351Drv() self.xtalFreq = 25000000 print("Init/Using PISDR HAT on RPi, by Yuan Wang (BG3MDO)") self.vfo = 0 self.is_tx = 0
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) print "Balthus:Init called" self.tty_name = '/dev/ttyUSB0' # serial port name self.serial = None # the open serial port self.timer = 0.02 # time between commands in seconds self.time0 = 0 # time of last command self.serial_out = [] # send commands slowly self.vfo_frequency = 0
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) self.var_index = 0 self.hermes_mac = bytearray(6) self.hermes_ip = "" self.hermes_code_version = -1 self.hermes_board_id = -1 self.hermes_temperature = 0.0 self.hermes_fwd_power = 0.0 self.hermes_rev_power = 0.0 self.hermes_pa_current = 0.0 self.eeprom_valid = 0 self.alex_hpf_f1 = 0 self.alex_hpf_f2 = 0 self.alex_lpf_f1 = 0 self.alex_lpf_f2 = 0 self.mode = None self.band = None self.vfo_frequency = 0 self.tx_frequency = 0 self.vna_count = 0 self.vna_started = False self.repeater_freq = None # original repeater output frequency try: self.repeater_delay = conf.repeater_delay # delay for changing repeater frequency in seconds except: self.repeater_delay = 0.25 self.repeater_time0 = 0 # time of repeater change in frequency # Create the proper broadcast addresses for socket_discover if conf.udp_rx_ip: # Known IP address of hardware self.broadcast_addrs = [conf.udp_rx_ip] else: self.broadcast_addrs = [] for interf in QS.ip_interfaces(): broadc = interf[3] # broadcast address if broadc and broadc[0:4] != '127.': self.broadcast_addrs.append(broadc) self.broadcast_addrs.append('255.255.255.255') if DEBUG: print ('broadcast_addrs', self.broadcast_addrs) # This is the control data to send to the Hermes using the Metis protocol # Duplex must be on or else the first Rx frequency is locked to the Tx frequency self.pc2hermes = bytearray(17 * 4) # Control bytes not including C0. Python initializes this to zero. self.pc2hermeslitewritequeue = bytearray(4 * 5) self.pc2hermes[3] = 0x04 # C0 index == 0, C4[5:3]: number of receivers 0b000 -> one receiver; C4[2] duplex on self.pc2hermes[4 * 9] = 63 # C0 index == 0b1001, C1[7:0] Tx level for c0 in range(1, 9): # Set all frequencies to 7012352, 0x006B0000 self.SetControlByte(c0, 2, 0x6B) value = conf.keyupDelay if value > 1023: value = 1023 self.SetControlByte(0x10, 2, value & 0x3) # cw_hang_time self.SetControlByte(0x10, 1, (value >> 2) & 0xFF) # cw_hang_time self.SetLowPwrEnable(conf.hermes_lowpwr_tr_enable) self.EnablePowerAmp(conf.hermes_power_amp) self.ChangeTxLNA(conf.hermes_TxLNA_dB) self.MakePowerCalibration()
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) self.var_index = 0 self.hermes_mac = bytearray(6) self.hermes_ip = "" self.hermes_code_version = -1 self.hermes_board_id = -1 self.hermes_temperature = 0.0 self.hermes_fwd_power = 0.0 self.hermes_rev_power = 0.0 self.hermes_pa_current = 0.0 self.eeprom_valid = 0 self.mode = None self.band = None self.vfo_frequency = 0 self.tx_frequency = 0 self.vna_count = 0 self.vna_started = False self.repeater_freq = None # original repeater output frequency self.antenna_labels = ('Ant 0', 'Ant 1') # labels for the antenna button self.antenna_index = 0 # index of antenna in use self.delay_config = 30 # Delay sending message to HL2 until after sound starts try: self.repeater_delay = conf.repeater_delay # delay for changing repeater frequency in seconds except: self.repeater_delay = 0.25 self.repeater_time0 = 0 # time of repeater change in frequency # Create the proper broadcast addresses for socket_discover if conf.udp_rx_ip: # Known IP address of hardware self.broadcast_addrs = [conf.udp_rx_ip] else: self.broadcast_addrs = [] for interf in QS.ip_interfaces(): broadc = interf[3] # broadcast address if broadc and broadc[0:4] != '127.': self.broadcast_addrs.append(broadc) self.broadcast_addrs.append('255.255.255.255') if DEBUG: print ('broadcast_addrs', self.broadcast_addrs) # This is the control data to send to the Hermes using the Metis protocol # Duplex must be on or else the first Rx frequency is locked to the Tx frequency # # From the protocol document, the data are: C1==[31:24], C2=[23:16], C3=[15:8], C4=[7:0] where [] are inclusive. # self.pc2hermes[] is used for the first 17 addresses 0x00 through 0x10. These are sent round-robin. self.pc2hermes = bytearray(17 * 4) # Control bytes not including C0. Python initializes this to zero. # Addresses C0 = 0x12 through 0x3E use self.pc2hermeswritequeue, which is capable of requesting an ACK. # C0 is a six-bit address. If the address is OR'd with 0x40, an ACK must be received or the item is re-transmitted. # The item sent to the HL2 is C0<<1 | MoxBit. # Sound must be started before you can use pc2hermeswritequeue. self.pc2hermeslitewritequeue = bytearray(4 * 5) # Four of (C0, C1, C2, C3, C4) # Initialize some data self.pc2hermes[3] = 0x04 # C0 index == 0, C4[5:3]: number of receivers 0b000 -> one receiver; C4[2] duplex on self.pc2hermes[4 * 9] = 63 # C0 index == 0b1001, C1[7:0] Tx level for c0 in range(1, 9): # Set all frequencies to 7012352, 0x006B0000 self.SetControlByte(c0, 2, 0x6B) self.ChangeTxLNA(conf.hermes_TxLNA_dB) self.MakePowerCalibration()
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) self.rf_gain_labels = ('RF +30', 'RF +20', 'RF +10', 'RF 0 dB') if conf.fft_size_multiplier == 0: conf.fft_size_multiplier = 3 # Set size needed by VarDecim self.clock = int(conf.sdriq_clock) self.device = Sdriq(self, conf.sdriq_name, self.clock, conf.sdriq_decimation) # SDR-IQ hardware access self.busy_cursor = False # Is the busy cursor displayed? rx_bytes = 2 # rx_bytes is the number of bytes in each I or Q sample: 1, 2, 3, or 4 rx_endian = 0 # rx_endian is the order of bytes in the sample array: 0 == little endian; 1 == big endian self.InitSamples(rx_bytes, rx_endian) # Initialize: read samples from this hardware file and send them to Quisk
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) self.var_index = 0 self.hermes_ip = "" self.hermes_code_version = -1 self.hermes_board_id = -1 self.hermes_temperature = 0 self.hermes_fwd_power = 0 self.hermes_rev_power = 0 self.hermes_pa_current = 0 self.mode = None self.band = None self.vfo_frequency = 0 self.tx_frequency = 0 self.vna_count = 0 self.vna_started = False self.repeater_freq = None # original repeater output frequency try: self.repeater_delay = conf.repeater_delay # delay for changing repeater frequency in seconds except: self.repeater_delay = 0.25 self.repeater_time0 = 0 # time of repeater change in frequency # Create the proper broadcast address for rx_udp_ip. if False and self.conf.rx_udp_ip: nm = self.conf.rx_udp_ip_netmask.split('.') ip = self.conf.rx_udp_ip.split('.') nm = map(int, nm) ip = map(int, ip) bc = '' for i in range(4): x = (ip[i] | ~nm[i]) & 0xFF bc = bc + str(x) + '.' self.broadcast_addr = bc[:-1] else: self.broadcast_addr = '255.255.255.255' # This socket is used for the Metis Discover protocol self.discover_request = chr(0xEF) + chr(0xFE) + chr(0x02) + chr(0) * 60 self.socket_discover = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) self.socket_discover.setblocking(0) self.socket_discover.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) # This is the control data to send to the Hermes using the Metis protocol # Duplex must be on or else the first Rx frequency is locked to the Tx frequency self.pc2hermes = bytearray( 17 * 4 ) # Control bytes not including C0. Python initializes this to zero. self.pc2hermeslitewritequeue = bytearray(4 * 5) self.pc2hermes[ 3] = 0x04 # C0 index == 0, C4[5:3]: number of receivers 0b000 -> one receiver; C4[2] duplex on for c0 in range(1, 9): # Set all frequencies to 7012352, 0x006B0000 self.SetControlByte(c0, 2, 0x6B) self.SetLowPwrEnable(conf.hermes_lowpwr_tr_enable) self.EnablePowerAmp(conf.hermes_power_amp)
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) self.hamlib_rigctld_port = 4532 # Standard rigctld control port self.hamlib_poll_seconds = 0.2 # Time interval to poll for changes self.hamlib_connected = False self.radio_freq = None self.radio_mode = None self.quisk_freq = None self.quisk_vfo = None self.quisk_mode = 'USB' self.received = '' self.toggle = False self.time0 = 0
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) self.hamlib_rigctld_port = 4532 # Standard rigctld control port self.hamlib_poll_seconds = 0.2 # Time interval to poll for changes self.hamlib_connected = False self.radio_freq = None self.radio_mode = None self.quisk_freq = None self.quisk_vfo = None self.quisk_mode = 'USB' self.received = '' self.toggle = False self.time0 = 0
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) self.use_sidetone = 0 self.vfo_frequency = 52000000 self.vfo_sample_rate = conf.sample_rate self.vfo_test = 0 # JIM self.tx_frequency = 0 self.CorrectTxDc = { '23cm': (1270.0, 0.167081, 0.150557), '2': (146.0, 0.018772, 0.038658), '33cm': (915.0, 0.140150, 0.051967), '6': (52.0, 0.020590, 0.024557), '70cm': (435.0, 0.004495, 0.096879), '1.25': (223.5, 0.042958, 0.055212), } self.rx_clock38 = 38880000 - 30 # master clock frequency, 38880 kHz nominal #rx_udp_clock = rx_clock38 * 32 // 2 // 9 # ADC sample rate in Hertz self.rx_udp_clock_nominal = 69120000 # rate to display self.tx_clock80 = 80000000 + 14 self.firmware_version = None # firmware version is initially unknown self.rx_udp_socket = None self.tx_udp_socket = None self.got_rx_udp_status = '' self.got_tx_udp_status = '' self.band = '' self.rx_phase0 = self.rx_phase1 = 0 self.tx_phase = 0 self.button_PTT = 0 self.mode_is_cw = 0 self.scan_enable = 0 self.scan_blocks = 0 self.scan_samples = 1 self.scan_phase = 0 self.fft_scan_valid = 0.84 self.preamp = Preamp() self.Rx4351 = Adf4351(True, self.rx_clock38, 8) self.Tx4351 = Adf4351(False, 10700000, 2) self.Tx4351.aux_rf_out = 0b000 # enable aux RF out 0b111 or turn off 0b000 self.decim3 = 10 self.SetDecim(192000) self.var_rates = [ '31X', '19X', '9X', '5X', '3X', '2X', '1728', '1152', '768', '384', '192', '96', '48' ] # supported sample rates as strings self.index = 0 self.repeater_freq = None self.DcI, self.DcQ = (0.0, 0.0) self.NewAdf4351(self.Rx4351, 146E6) self.NewAdf4351(self.Tx4351, 146E6) self.NewAd9951(52e6) self.NewUdpStatus()
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) self.usb_dev = None self.vfo = None self.repeater_freq = None # original repeater output frequency try: self.repeater_delay = conf.repeater_delay # delay for changing repeater frequency in seconds except: self.repeater_delay = 0.25 self.repeater_time0 = 0 # time of repeater change in frequency self.ptt_button = 0 self.is_cw = False self.key_thread = None self.si570_i2c_address = conf.si570_i2c_address
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) self.usb_dev = None self.vfo = None self.repeater_freq = None # original repeater output frequency try: self.repeater_delay = conf.repeater_delay # delay for changing repeater frequency in seconds except: self.repeater_delay = 0.25 self.repeater_time0 = 0 # time of repeater change in frequency self.ptt_button = 0 self.is_cw = False self.key_thread = None self.si570_i2c_address = conf.si570_i2c_address
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) self.local_tune = 2 self.index = 0 self.clock = 80000000 self.old_LO_freq = 0 self.rf_gain_labels = ('RF -10', 'RF -7', 'RF -4', 'RF -1', '+2', '+5', '+8', '+11', '+14', '+17', '+20', '+23', '+26', '+29', '+32', '+35') self.conf = conf self.plugin = Control(self.conf.rx_udp_ip, self.conf.rx_udp_port) self.app = app self.decimations = [] # supported decimation rates for dec in (53333, 96000, 133333, 185185, 192000, 370370, 740740, 1333333): self.decimations.append(dec)
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) self.vfo_frequency = self.conf.fixed_vfo_freq # current vfo frequency self.tune = self.vfo_frequency + 10000 # Current tuning frequency in Hertz self.is_cw = False ##20180226 JMH added this property to support SSmicro Si5351 TX setup ## self.ptt_button = 0 ##20180226 JMH added this property to support SSmicro Si5351 TX setup self.key_thread = None ##20180226 JMH added this property to support SSmicro Si5351 TX setup self.usb_dev = None ##20180226 JMH added this property to support SSmicro Si5351 TX setup self.CmdStr = '' ##20180226 JMH added this property to support SSmicro Si5351 TX setup self.tty_name = '/dev/ttyACM0' # serial port name for SftRkSDR self.serial = None # the open serial port self.timer = 0.02 # time between SftRkSDR commands in seconds self.time0 = 0 # time of last SftRkSDR command self.serial_out = [] # send commands slowly try: if not (conf.HrdwrTalk == None): self.HrdwrTalk = conf.HrdwrTalk except: self.HrdwrTalk = True
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) self.model = 25018 # Funcube Pro+ self.vfo = None self.lna = None self.mixer = None self.ifgain = None self.receiver = Hamlib.Rig(self.model) self.receiver.open() self.vfo = int(self.receiver.get_freq()) if (self.vfo == 0): print('+++ Could not find FuncubePro+ !\nExiting') exit() self.mixer = self.receiver.get_level_i(Hamlib.RIG_LEVEL_ATT, Hamlib.RIG_VFO_CURR) self.lna = self.receiver.get_level_i(Hamlib.RIG_LEVEL_PREAMP, Hamlib.RIG_VFO_CURR) self.ifgain = (int)(self.receiver.get_level_f( Hamlib.RIG_LEVEL_RF, Hamlib.RIG_VFO_CURR) * 100)
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) # Default port settings for RS-HFIQ serialport.port = "/dev/ttyUSB0" serialport.baudrate = 57600 serialport.bytesize = serial.EIGHTBITS #number of bits per bytes serialport.parity = serial.PARITY_NONE #set parity check: no parity serialport.stopbits = serial.STOPBITS_ONE #number of stop bits serialport.timeout = 1 #non-block read serialport.rtscts = False try: serialport.open() except Exception as e: print(e) raise Exception self.vfo = None return None
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) self.var_index = 0 self.hermes_ip = "" self.hermes_board_id = -1 self.mode = None self.band = None self.vfo_frequency = 0 self.tx_frequency = 0 self.repeater_freq = None # original repeater output frequency try: self.repeater_delay = conf.repeater_delay # delay for changing repeater frequency in seconds except: self.repeater_delay = 0.25 self.repeater_time0 = 0 # time of repeater change in frequency # Create the proper broadcast address for rx_udp_ip. if False and self.conf.rx_udp_ip: nm = self.conf.rx_udp_ip_netmask.split('.') ip = self.conf.rx_udp_ip.split('.') nm = map(int, nm) ip = map(int, ip) bc = '' for i in range(4): x = (ip[i] | ~ nm[i]) & 0xFF bc = bc + str(x) + '.' self.broadcast_addr = bc[:-1] else: self.broadcast_addr = '255.255.255.255' # This socket is used for the Metis Discover protocol self.discover_request = chr(0xEF) + chr(0xFE) + chr(0x02) + chr(0) * 60 self.socket_discover = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) self.socket_discover.setblocking(0) self.socket_discover.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) # This is the control data to send to the Hermes using the Metis protocol self.pc2hermes = bytearray(17 * 4) # Python initializes this to zero self.pc2hermes[3] = 0x04 # C0 index == 0, C4[5:3]: number of receivers 0b000 -> one receiver; C4[2] duplex on QS.pc_to_hermes(self.pc2hermes)
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) self.use_sidetone = 0 self.vfo_frequency = 52000000 self.vfo_sample_rate = conf.sample_rate self.vfo_test = 0 # JIM self.adf4351_freq = 52E6 self.tx_frequency = 0 self.firmware_version = None # firmware version is initially unknown self.rx_udp_socket = None self.got_udp_status = '' self.got_adf4351_status = '' self.rx_phase0 = self.rx_phase1 = 0 self.tx_phase = 0 self.scan_enable = 0 self.scan_blocks = 0 self.scan_samples = 1 self.scan_phase = 0 self.fft_scan_valid = 0.84 self.adf4351_int_mode = 1 # integer one, fractional zero self.adf4351_aux_rf_out = 0b101 self.adf4351_rf_divider = 4 # Fout = Fvco / 2 ** rf_divider self.adf4351_band_sel_clock_div = 40 self.adf4351_r_counter = 8 # Fpfd = Fref / 2 / r_counter self.adf4351_int_value = 1317 # Fvco = Fpfd * (int_value + frac_value / modulus) self.adf4351_frac_value = 0 self.adf4351_modulus = 23 self.decim3 = 10 self.SetDecim(192000) self.var_rates = [ '31X', '19X', '9X', '5X', '3X', '2X', '1728', '1152', '768', '384', '192', '96', '48' ] # supported sample rates as strings self.index = 0 self.NewUdpStatus() self.NewAdf4351(self.adf4351_freq)
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) self.use_sidetone = 1 self.got_udp_status = '' # status from UDP receiver # want_udp_status is a 14-byte string with numbers in little-endian order: # [0:2] 'St' # [2:6] Rx tune phase # [6:10] Tx tune phase # [10] Tx output level 0 to 255 # [11] Tx control bits: # 0x01 Enable CW transmit # 0x02 Enable all other transmit # 0x04 Use the HiQSDR extended IO pins not present in the 2010 QEX ver 1.0 # 0x08 The key is down (software key) # [12] Rx control bits # Second stage decimation less one, 1-39, six bits # [13] zero or firmware version number # The above is used for firmware version 1.0. # Version 1.1 adds eight more bytes for the HiQSDR conntrol ports: # [14] X1 connector: Preselect pins 69, 68, 65, 64; Preamp pin 63, Tx LED pin 57 # [15] Attenuator pins 84, 83, 82, 81, 80 # [16] More bits: AntSwitch pin 41 is 0x01 # [17:22] The remaining five bytes are sent as zero. # Version 1.2 uses the same format as 1.1, but adds the "Qs" command (see below). # Version 1.3 adds features needed by the new quisk_vna.py program: # [17] This one byte must be zero # [18:20] This is vna_count, the number of VNA data points; or zero for normal operation # [20:22] These two bytes mmust be zero # The "Qs" command is a two-byte UDP packet sent to the control port. It returns the hardware status # as the above string, except that the string starts with "Qs" instead of "St". Do not send the "Qs" command # from Quisk, as it interferes with the "St" command. The "Qs" command is meant to be used from an # external program, such as HamLib or a logging program. # When vna_count != 0, we are in VNA mode. The start frequency is rx_phase, and for each point tx_phase is added # to advance the frequency. A zero sample is added to mark the blocks. The samples are I and Q averaged at DC. self.rx_phase = 0 self.tx_phase = 0 self.tx_level = 0 self.tx_control = 0 self.rx_control = 0 self.vna_count = 0 # VNA scan count; MUST be zero for non-VNA operation self.index = 0 self.mode = None self.band = None self.HiQSDR_Connector_X1 = 0 self.HiQSDR_Attenuator = 0 self.HiQSDR_Bits = 0 if conf.use_rx_udp == 2: # Set to 2 for the HiQSDR self.rf_gain_labels = ('RF 0 dB', 'RF +10', 'RF -10', 'RF -20', 'RF -30') self.antenna_labels = ('Ant 1', 'Ant 2') self.firmware_version = None # firmware version is initially unknown self.rx_udp_socket = None self.vfo_frequency = 0 # current vfo frequency self.tx_frequency = 0 self.decimations = [] # supported decimation rates for dec in (40, 20, 10, 8, 5, 4, 2): self.decimations.append(dec * 64) if self.conf.fft_size_multiplier == 0: self.conf.fft_size_multiplier = 7 # Set size needed by VarDecim
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf)
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) self.vfo = self.conf.fixed_vfo_freq # Fixed VFO frequency in Hertz self.tune = self.vfo + 10000 # Current tuning frequency in Hertz
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) self.got_udp_status = '' # status from UDP receiver # want_udp_status is a 14-byte string with numbers in little-endian order: # [0:2] 'St' # [2:6] Rx tune phase # [6:10] Tx tune phase # [10] Tx output level 0 to 255 # [11] Tx control bits: # 0x01 Enable CW transmit # 0x02 Enable all other transmit # 0x04 Use the HiQSDR extended IO pins not present in the 2010 QEX ver 1.0 # 0x08 The key is down (software key) # 0x40 odyssey: Spot button is in use # 0x80 odyssey: Mic Boost 20dB # [12] Rx control bits # Second stage decimation less one, 1-39, six bits # [13] zero or firmware version number # The above is used for firmware version 1.0. # Version 1.1 adds eight more bytes for the HiQSDR conntrol ports: # [14] X1 connector: Preselect pins 69, 68, 65, 64; Preamp pin 63, Tx LED pin 57 # [15] Attenuator pins 84, 83, 82, 81, 80 # [16] More bits: AntSwitch pin 41 is 0x01 # [17:22] The remaining five bytes are sent as zero. # Version 1.2 uses the same format as 1.1, but adds the "Qs" command (see below). # Version 1.3 adds features needed by the new quisk_vna.py program: # [17] The sidetone volume 0 to 255 # [18:20] This is vna_count, the number of VNA data points; or zero for normal operation # [20] The CW delay as specified in the config file # [21] Control bits: # 0x01 Switch on tx mirror on rx for adaptive predistortion # [22:24] Noise blanker level # The "Qs" command is a two-byte UDP packet sent to the control port. It returns the hardware status # as the above string, except that the string starts with "Qs" instead of "St". Do not send the "Qs" command # from Quisk, as it interferes with the "St" command. The "Qs" command is meant to be used from an # external program, such as HamLib or a logging program. # When vna_count != 0, we are in VNA mode. The start frequency is rx_phase, and for each point tx_phase is added # to advance the frequency. A zero sample is added to mark the blocks. The samples are I and Q averaged at DC. self.rx_phase = 0 self.tx_phase = 0 self.tx_level = 0 self.tx_control = 0 self.rx_control = 0 self.vna_count = 0 # VNA scan count; MUST be zero for non-VNA operation self.cw_delay = conf.cw_delay self.index = 0 self.mode = None self.usingSpot = False self.band = None self.rf_gain = 0 self.sidetone_volume = 0 # sidetone volume 0 to 255 self.repeater_freq = None # original repeater output frequency self.HiQSDR_Connector_X1 = 0 self.HiQSDR_Attenuator = 0 self.HiQSDR_Bits = 0 try: if conf.radio_sound_mic_boost: self.tx_control = 0x80 except: pass if conf.use_rx_udp == 2: # Set to 2 for the HiQSDR self.rf_gain_labels = ('RF 0 dB', 'RF +10', 'RF -10', 'RF -20', 'RF -30') self.antenna_labels = ('Ant 1', 'Ant 2') self.firmware_version = None # firmware version is initially unknown self.rx_udp_socket = None self.vfo_frequency = 0 # current vfo frequency self.tx_frequency = 0 self.decimations = [] # supported decimation rates for dec in (40, 20, 10, 8, 5, 4, 2): self.decimations.append(dec * 64) if self.conf.fft_size_multiplier == 0: self.conf.fft_size_multiplier = 6 # Set size needed by VarDecim
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) self.fcd = FCD() self.tune = 0
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) self.usb_dev = None self.vfo = None self.key_thread = None self.name_of_mic_play = conf.name_of_mic_play # True if we can transmit
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) self.vfo = None self.ptt_button = 0 self.usbsr_ip_address = conf.usbsr_ip_address self.usbsr_port = conf.usbsr_port
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) self.use_sidetone = 1
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) self.vfo = self.conf.fixed_vfo_freq # Fixed VFO frequency in Hertz self.tune = self.vfo + 10000 # Current tuning frequency in Hertz
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) self.model=25019 #Could be a paramter later, to handel different models self.vfo = None self.receiver = Hamlib.Rig(self.model) self.receiver.state.rigport.pathname='/dev/ttyUSB0' #Could be a parameter later
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) self.usb_dev = None self.vfo = None self.key_thread = None self.name_of_mic_play = conf.name_of_mic_play # True if we can transmit
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) self.got_udp_status = '' # status from UDP receiver # want_udp_status is a 14-byte string with numbers in little-endian order: # [0:2] 'St' # [2:6] Rx tune phase # [6:10] Tx tune phase # [10] Tx output level 0 to 255 # [11] Tx control bits: # 0x01 Enable CW transmit # 0x02 Enable all other transmit # 0x04 Use the HiQSDR extended IO pins not present in the 2010 QEX ver 1.0 # 0x08 The key is down (software key) # bits 5 and 4: Transmit sample rate # 0b00 48k # 0b01 192k # 0b10 480k # 0b11 8k # 0x40 odyssey: Spot button is in use # 0x80 odyssey: Mic Boost 20dB # [12] Rx control bits # bits 5 through 0 # Second stage decimation less one, 1-39, six bits # bits 7, 6 # 0b00 Prescaler 8, 3-byte samples I and Q; 1440 / 6 = 240 samples per UDP packet # 0b01 Prescaler 2, 2-byte samples # 0b10 Prescaler 40, 3-byte samples # 0b11 Prescaler 2, 1-byte samples # [13] zero or firmware version number # The above is used for firmware version 1.0. # Version 1.1 adds eight more bytes for the HiQSDR conntrol ports: # [14] X1 connector: Preselect pins 69, 68, 65, 64; Preamp pin 63, Tx LED pin 57 # [15] Attenuator pins 84, 83, 82, 81, 80 # [16] More bits: AntSwitch pin 41 is 0x01 # [17:22] The remaining five bytes are sent as zero. # Version 1.2 uses the same format as 1.1, but adds the "Qs" command (see below). # Version 1.3 adds features needed by the new quisk_vna.py program: # [17] The sidetone volume 0 to 255 # [18:20] This is vna_count, the number of VNA data points; or zero for normal operation # [20] The CW delay as specified in the config file # [21] Control bits: # 0x01 Switch on tx mirror on rx for adaptive predistortion # [22:24] Noise blanker level # The "Qs" command is a two-byte UDP packet sent to the control port. It returns the hardware status # as the above string, except that the string starts with "Qs" instead of "St". Do not send the "Qs" command # from Quisk, as it interferes with the "St" command. The "Qs" command is meant to be used from an # external program, such as HamLib or a logging program. # When vna_count != 0, we are in VNA mode. The start frequency is rx_phase, and for each point tx_phase is added # to advance the frequency. A zero sample is added to mark the blocks. The samples are I and Q averaged at DC. self.rx_phase = 0 self.tx_phase = 0 self.tx_level = 0 self.tx_control = 0 self.rx_control = 0 QS.set_sample_bytes(3) self.vna_count = 0 # VNA scan count; MUST be zero for non-VNA operation self.cw_delay = conf.cw_delay self.index = 0 self.mode = None self.usingSpot = False self.band = None self.rf_gain = 0 self.sidetone_volume = 0 # sidetone volume 0 to 255 self.repeater_freq = None # original repeater output frequency self.HiQSDR_Connector_X1 = 0 self.HiQSDR_Attenuator = 0 self.HiQSDR_Bits = 0 try: if conf.radio_sound_mic_boost: self.tx_control = 0x80 except: pass if conf.use_rx_udp == 2: # Set to 2 for the HiQSDR self.rf_gain_labels = ('RF 0 dB', 'RF +10', 'RF -10', 'RF -20', 'RF -30') self.antenna_labels = ('Ant 1', 'Ant 2') self.firmware_version = None # firmware version is initially unknown self.rx_udp_socket = None self.vfo_frequency = 0 # current vfo frequency self.tx_frequency = 0 self.decimations = [] # supported decimation rates for dec in (40, 20, 10, 8, 5, 4, 2): self.decimations.append(dec * 64) self.decimations.append(80) self.decimations.append(64) if self.conf.fft_size_multiplier == 0: self.conf.fft_size_multiplier = 6 # Set size needed by VarDecim
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) self.use_sidetone = 1
def __init__(self, app, conf): BaseHardware.__init__(self, app, conf) self.vfo = None self.ptt_button = 0 self.usbsr_ip_address = conf.usbsr_ip_address self.usbsr_port = conf.usbsr_port