Beispiel #1
0
    def read_adc_by_name(self, channel_name):
        '''
        VDM001002 board read TPS6598x ADC informations by channel name

        Args:
            channel_name:    string,   ['BRICKID_RFU', 'CC1_BY2', 'CC1_BY5', 'CC2_BY2', 'CC2_BY5',
                                        'GPIO_0', 'GPIO_1', 'GPIO_10 (BUSPOWER_Z)', 'GPIO_2', 'GPIO_3',
                                        'GPIO_4', 'GPIO_5', 'GPIO_5_RAW', 'GPIO_6', 'GPIO_7', 'GPIO_8',
                                        'I2CADDR', 'IN_3P3V', 'I_CC', 'I_PP_5V0', 'I_PP_EXT', 'I_PP_HV',
                                        'OUT_3P3V', 'PP_5V0', 'PP_CABLE', 'PP_HV', 'SENSEP',
                                        'V1P8_A', 'V1P8_D', 'V3P3', 'VBUS','THERMAL_SENSE'],
                                        range as follow:
                                        'BRICKID_RFU', 'CC1_BY2', 'CC1_BY5', 'CC2_BY2', 'CC2_BY5',
                                        'GPIO_0', 'GPIO_1', 'GPIO_10 (BUSPOWER_Z)', 'GPIO_2', 'GPIO_3',
                                        'GPIO_4', 'GPIO_5', 'GPIO_5_RAW', 'GPIO_6', 'GPIO_7', 'GPIO_8',
                                        'I2CADDR', 'IN_3P3V', 'I_CC', 'I_PP_5V0', 'I_PP_EXT', 'I_PP_HV',
                                        'OUT_3P3V', 'PP_5V0', 'PP_CABLE', 'PP_HV', 'SENSEP',
                                        'V1P8_A', 'V1P8_D', 'V3P3', 'VBUS','THERMAL_SENSE'
                                        eg.'GPIO_0'

        Returns:
            string, str, ADC value informations string.

        Examples:
            rd_value = vdm.read_adc_by_name('PP_5V0')\r\n
            print(rd_value)\r\n

        '''
        assert isinstance(channel_name, basestring)
        assert channel_name in ADC_NAME_LIST

        channel = hi_functions.ADC.channelByName(channel_name)
        result = hi_functions.ADCs(self.tps6598x, channel)
        return 'channel:%-5sname:%-20svalue:%s\r\n' % (channel.channel,
                                                       channel.name, result)
Beispiel #2
0
    def read_all_adc(self):
        '''
        VDM001002 board read TPS6598x chip all ADC value

        Returns:
            string, str, ADC value informations string.

        Examples:
            rd_value = vdm.read_all_adc()\r\n
            print(rd_value)\r\n

        '''
        return_str = ''
        for channel in hi_functions.ADC.channels:
            result = hi_functions.ADCs(self.tps6598x, channel)
            return_str = return_str + 'channel:%-5sname:%-20svalue:%s\r\n' % (
                channel.channel, channel.name, result)
        return return_str
Beispiel #3
0
    def read_all_adc(self, chip_id):
        '''
        USBC001001 read TPS6598x chip all ADC value

        Args:
            chip_id:     string, ["XA", "XB"].

        Returns:
            string, str, ADC value informations string.

        Examples:
            rd_value = usbc001001.read_all_adc('XA')\r\n
            print(rd_value)\r\n

        '''
        assert chip_id in USBC001001Def.USBC_ID
        return_str = ''
        for channel in hi_functions.ADC.channels:
            result = hi_functions.ADCs(self.tps6598x[chip_id], channel)
            return_str = return_str + \
                'channel:%-5sname:%-20svalue:%s\r\n' % (
                    channel.channel, channel.name, result)
        return return_str