Пример #1
0
    def __init__(self,
                 dac_i2c=None,
                 eeprom_i2c=None,
                 ocp_main_pin=None,
                 ocp_batt_pin=None,
                 ocp_dbg_pin=None):

        self.dac1 = AD5667R(ArmorDef.DAC1_DEV_ADDR, dac_i2c,
                            ArmorDef.DAC_VOLTAGE_REF)
        self.dac2 = AD5667R(ArmorDef.DAC2_DEV_ADDR, dac_i2c,
                            ArmorDef.DAC_VOLTAGE_REF)
        self.dac3 = MCP4725(ArmorDef.DAC3_DEV_ADDR, dac_i2c,
                            ArmorDef.DAC3_VOLTAGE_REF)
        self.res1 = AD5272(ArmorDef.RES_1_ADDR, dac_i2c)
        self.res2 = AD5272(ArmorDef.RES_2_ADDR, dac_i2c)
        self.eeprom = CAT24C32(ArmorDef.EEPROM_DEV_ADDR, eeprom_i2c)
        self.sensor = NCT75(ArmorDef.SENSOR_DEV_ADDR, eeprom_i2c)
        self.pca9536 = PCA9536(ArmorDef.IO_EXP_DEV_ADDR, eeprom_i2c)
        self.dac_output_volt = dict()
        self.current_limit = dict()
        self.ocp_status = dict()
        self.eload_current = 0
        self.ocp_main_pin = ocp_main_pin
        self.ocp_batt_pin = ocp_batt_pin
        self.ocp_dbg_pin = ocp_dbg_pin

        super(ArmorBase, self).__init__(self.eeprom,
                                        self.sensor,
                                        range_table=armor_range_table)
Пример #2
0
    def __init__(self, i2c, ipcore, range_table=starlordii_range_table):

        self.eeprom = CAT24C32(Audio005Def.EEPROM_I2C_ADDR, i2c)
        self.nct75 = NCT75(Audio005Def.TEMP_I2C_ADDR, i2c)
        self.pca9536 = PCA9536(Audio005Def.PCA9536_DEV_ADDR, i2c)

        if isinstance(ipcore, basestring):
            ipcore = MIXAudio005SGR(ipcore)

        self.ipcore = ipcore
        self.analyzer = self.ipcore.analyzer
        self.signal_source = self.ipcore.signal_source
        self.adc_rst_pin = Pin(self.ipcore.gpio, Audio005Def.ADC_RESET_PIN)
        self.i2s_rx_en_pin = Pin(self.ipcore.gpio, Audio005Def.I2S_RX_EN_PIN)
        self.dac_rst_pin = Pin(self.ipcore.gpio, Audio005Def.DAC_RESET_PIN)
        self.i2s_tx_en_pin = Pin(self.ipcore.gpio, Audio005Def.I2S_TX_EN_PIN)
        self.i2s_ch_select = [
            Pin(self.ipcore.gpio, Audio005Def.I2S_CH_SELECT_2),
            Pin(self.ipcore.gpio, Audio005Def.I2S_CH_SELECT_3)
        ]

        super(Audio005Base, self).__init__(self.eeprom,
                                           self.nct75,
                                           range_table=range_table)
        self.is_enable_upload = False
Пример #3
0
    def __init__(self, i2c, ipcore=None):

        if i2c:
            self.eeprom = CAT24C32(WolverineiiDef.EEPROM_DEV_ADDR, i2c)
            self.sensor = NCT75(WolverineiiDef.SENSOR_DEV_ADDR, i2c)
            self.pca9536 = PCA9536(WolverineiiDef.IO_EXP_DEV_ADDR, i2c)
        else:
            self.eeprom = EepromEmulator('eeprom_emulator')
            self.sensor = NCT75Emulator('nct75_emulator')
            self.pca9536 = PCA9536Emulator('pca9536_emulator')
        if ipcore:
            if isinstance(ipcore, basestring):
                axi4_bus = AXI4LiteBus(ipcore,
                                       WolverineiiDef.MIXDAQT1_REG_SIZE)
                ipcore = MIXDAQT1SGR(
                    axi4_bus,
                    'AD7175',
                    ad717x_mvref=WolverineiiDef.AD7175_MVREF,
                    code_polar=WolverineiiDef.AD7175_CODE_POLAR,
                    reference=WolverineiiDef.AD7175_REFERENCE,
                    clock=WolverineiiDef.AD7175_CLOCK)
                self.ipcore = ipcore
            else:
                self.ipcore = ipcore
            self.ad7175 = self.ipcore.ad717x
            self.ad7175.config = {
                'ch0': {
                    'P': 'AIN0',
                    'N': 'AIN1'
                },
                'ch1': {
                    'P': 'AIN2',
                    'N': 'AIN3'
                }
            }
        else:
            self.ad7175 = MIXAd7175SGEmulator('mix_ad7175_sg_emulator',
                                              WolverineiiDef.EMULATOR_REG_SIZE)

        self.mode = 'cal'
        self.measure_path = dict()

        super(WolverineII,
              self).__init__(self.eeprom,
                             self.sensor,
                             cal_table=wolverineii_calibration_info,
                             range_table=wolverineii_range_table)
Пример #4
0
    def __init__(self, i2c, ipcore):

        self.eeprom = CAT24C32(WolverineiiDef.EEPROM_DEV_ADDR, i2c)
        self.sensor = NCT75(WolverineiiDef.SENSOR_DEV_ADDR, i2c)
        self.pca9536 = PCA9536(WolverineiiDef.IO_EXP_DEV_ADDR, i2c)

        if isinstance(ipcore, basestring):
            axi4_bus = AXI4LiteBus(ipcore, WolverineiiDef.MIXDAQT1_REG_SIZE)
            ipcore = MIXDAQT1SGR(axi4_bus,
                                 'AD7175',
                                 ad717x_mvref=WolverineiiDef.AD7175_MVREF,
                                 code_polar=WolverineiiDef.AD7175_CODE_POLAR,
                                 reference=WolverineiiDef.AD7175_REFERENCE,
                                 clock=WolverineiiDef.AD7175_CLOCK,
                                 use_gpio=True)

        self.ipcore = ipcore
        self.ad7175 = self.ipcore.ad717x
        self.ad7175.config = {
            'ch0': {
                'P': 'AIN0',
                'N': 'AIN1'
            },
            'ch1': {
                'P': 'AIN2',
                'N': 'AIN3'
            }
        }

        self.measure_path = dict()

        self.continuous_sample_mode = None

        self.gpio = ipcore.gpio
        self.tag_pins = [
            Pin(self.gpio, WolverineiiDef.TAG_BASE_PIN + x,
                WolverineiiDef.GPIO_OUTPUT_DIR) for x in range(4)
        ]

        super(WolverineII, self).__init__(self.eeprom,
                                          self.sensor,
                                          range_table=wolverineii_range_table)
Пример #5
0
    def __init__(self, i2c, ipcore, range_table=starlord_table):

        self.eeprom = CAT24C32(StarLordDef.EEPROM_I2C_ADDR, i2c)
        self.nct75 = NCT75(StarLordDef.TEMP_I2C_ADDR, i2c)
        self.pca9536 = PCA9536(StarLordDef.PCA9536_DEV_ADDR, i2c)

        if isinstance(ipcore, basestring):
            ipcore = MIXAUT5SGR(ipcore)

        self.ipcore = ipcore
        self.analyzer = self.ipcore.analyzer
        self.signal_source = self.ipcore.signal_source
        self.ad7175 = self.ipcore.ad717x
        self.ad7175.config = {
            'ch0': {
                'P': 'AIN0',
                'N': 'AIN1'
            },
            'ch1': {
                'P': 'AIN2',
                'N': 'AIN3'
            }
        }
        self.adc_rst_pin = Pin(self.ipcore.gpio, StarLordDef.ADC_RESET_PIN)
        self.i2s_rx_en_pin = Pin(self.ipcore.gpio, StarLordDef.I2S_RX_EN_PIN)
        self.dac_rst_pin = Pin(self.ipcore.gpio, StarLordDef.DAC_RESET_PIN)
        self.i2s_tx_en_pin = Pin(self.ipcore.gpio, StarLordDef.I2S_TX_EN_PIN)
        self.i2s_ch_select = [
            Pin(self.ipcore.gpio, StarLordDef.I2S_CH_SELECT_2),
            Pin(self.ipcore.gpio, StarLordDef.I2S_CH_SELECT_3)
        ]
        self.fft_source_select = Pin(self.ipcore.gpio,
                                     StarLordDef.FFT_SOURCE_SELECT)
        self.ad7175_upload_select = Pin(self.ipcore.gpio,
                                        StarLordDef.AD7175_TO_FFT_OR_NOT)

        super(StarLordBase, self).__init__(self.eeprom,
                                           self.nct75,
                                           range_table=range_table)
        self.is_lna_up = False
        self.is_analyzer_up = False
        self.is_enable_upload = False
Пример #6
0
    def __init__(self, dac_i2c=None, eeprom_i2c=None):

        if dac_i2c:
            self.dac1 = AD5667R(ArmorDef.DAC1_DEV_ADDR, dac_i2c,
                                ArmorDef.DAC_VOLTAGE_REF)
            self.dac2 = AD5667R(ArmorDef.DAC2_DEV_ADDR, dac_i2c,
                                ArmorDef.DAC_VOLTAGE_REF)
            self.dac3 = MCP4725(ArmorDef.DAC3_DEV_ADDR, dac_i2c,
                                ArmorDef.DAC3_VOLTAGE_REF)
            self.res1 = AD5272(ArmorDef.RES_1_ADDR, dac_i2c)
            self.res2 = AD5272(ArmorDef.RES_2_ADDR, dac_i2c)
        else:
            self.dac1 = AD5667REmulator("ad5667r_emulator_1")
            self.dac2 = AD5667REmulator("ad5667r_emulator_2")
            self.dac3 = MCP4725Emulator('mcp4725_emulator')
            self.res1 = AD5272Emulator("ad5272_emulator_1")
            self.res2 = AD5272Emulator("ad5272_emulator_2")

        if eeprom_i2c:
            self.eeprom = CAT24C32(ArmorDef.EEPROM_DEV_ADDR, eeprom_i2c)
            self.sensor = NCT75(ArmorDef.SENSOR_DEV_ADDR, eeprom_i2c)
            MIXBoard.__init__(self,
                              self.eeprom,
                              self.sensor,
                              cal_table=armor_calibration_info,
                              range_table=armor_range_table)
            self.pca9536 = PCA9536(ArmorDef.IO_EXP_DEV_ADDR, eeprom_i2c)
        else:
            self.eeprom = EepromEmulator('eeprom_emulator')
            self.sensor = NCT75Emulator('nct75_emulator')
            MIXBoard.__init__(self,
                              None,
                              None,
                              cal_table=armor_calibration_info,
                              range_table=armor_range_table)
            self.pca9536 = PCA9536Emulator('pca9536_emulator')
Пример #7
0
    def __init__(self, i2c, ipcore=None, range_table=starlord_table):
        if i2c:
            self.eeprom = CAT24C32(StarLordDef.EEPROM_I2C_ADDR, i2c)
            self.nct75 = NCT75(StarLordDef.TEMP_I2C_ADDR, i2c)
            self.pca9536 = PCA9536(StarLordDef.PCA9536_DEV_ADDR, i2c)

        else:
            self.eeprom = EepromEmulator("cat24cxx_emulator")
            self.nct75 = NCT75Emulator("nct75_emulator")
            self.pca9536 = PCA9536Emulator("PCA9536_emulator")

        if ipcore:
            if isinstance(ipcore, basestring):
                ipcore = MIXAUT5SGR(ipcore)
            self.ipcore = ipcore
            self.analyzer = self.ipcore.analyzer
            self.signal_source = self.ipcore.signal_source
            self.ad7175 = self.ipcore.ad717x
            self.ad7175.config = {
                'ch0': {
                    'P': 'AIN0',
                    'N': 'AIN1'
                },
                'ch1': {
                    'P': 'AIN2',
                    'N': 'AIN3'
                }
            }
            self.adc_rst_pin = Pin(self.ipcore.gpio, StarLordDef.ADC_RESET_PIN)
            self.i2s_rx_en_pin = Pin(self.ipcore.gpio,
                                     StarLordDef.I2S_RX_EN_PIN)
            self.dac_rst_pin = Pin(self.ipcore.gpio, StarLordDef.DAC_RESET_PIN)
            self.i2s_tx_en_pin = Pin(self.ipcore.gpio,
                                     StarLordDef.I2S_TX_EN_PIN)
            self.i2s_ch_select = [
                Pin(self.ipcore.gpio, StarLordDef.I2S_CH_SELECT_2),
                Pin(self.ipcore.gpio, StarLordDef.I2S_CH_SELECT_3)
            ]
            self.fft_source_select = Pin(self.ipcore.gpio,
                                         StarLordDef.FFT_SOURCE_SELECT)
            self.ad7175_upload_select = Pin(self.ipcore.gpio,
                                            StarLordDef.AD7175_TO_FFT_OR_NOT)

        else:
            self.analyzer = MIXFftAnalyzerSGEmulator(
                "mix_fftanalyzer_sg_emulator")
            self.signal_source = MIXSignalSourceSGEmulator(
                "mix_signalsource_sg_emulator")
            self.adc_rst_pin = Pin(None, StarLordDef.ADC_RESET_PIN)
            self.i2s_rx_en_pin = Pin(None, StarLordDef.I2S_RX_EN_PIN)
            self.dac_rst_pin = Pin(None, StarLordDef.DAC_RESET_PIN)
            self.i2s_tx_en_pin = Pin(None, StarLordDef.I2S_TX_EN_PIN)
            self.ad7175 = MIXAd7175SGEmulator('mix_ad7175_sg_emulator',
                                              StarLordDef.EMULATOR_REG_SIZE)
            self.i2s_ch_select = [
                Pin(None, StarLordDef.I2S_CH_SELECT_2),
                Pin(None, StarLordDef.I2S_CH_SELECT_3)
            ]
            self.fft_source_select = Pin(None, StarLordDef.FFT_SOURCE_SELECT)
            self.ad7175_upload_select = Pin(None,
                                            StarLordDef.AD7175_TO_FFT_OR_NOT)

        super(StarLord, self).__init__(self.eeprom,
                                       self.nct75,
                                       cal_table={},
                                       range_table=range_table)
        self.is_lna_up = False
        self.is_analyzer_up = False
        self.is_enable_upload = False