コード例 #1
0
    def get_cfgInfo(self):
        cp = configparser.ConfigParser(allow_no_value=True)
        cp.read(ModuleObj.get_cmpPath())

        PmicData._var_list = cp.options('APPLICATION')

        if self.__chipName == '':
            return
        #parse the pmic config file
        cmpPath = os.path.join(sys.path[0], 'config', self.__chipName + '.cmp')
        if not os.path.exists(cmpPath) or not os.path.isfile(cmpPath):
            log(LogLevel.error,
                'Can not find %s pmic config file!' % (self.__chipName))
            sys.exit(-1)
        cp.read(cmpPath)
        self.__defLdo = cp.get('PMIC_TABLE', 'LDO_APPNAME_DEFAULT')
        self.__headerList = cp.get('PMIC_TABLE', 'INCLUDE_HEADER').split(':')
        self.__func = cp.get('PMIC_TABLE', 'FUNCTION')

        for i in range(1, cp.getint('PMIC_TABLE', 'NUM_LDO') + 1):
            key = 'LDO_NAME%d' % (i)
            self.__paraList.append(cp.get(key, 'PARAMETER_NAME'))

        #parse app count in fig file
        cp.read(ModuleObj.get_chipId() + '.fig')

        cp.read(ModuleObj.get_figPath())
        self.__appCount = cp.getint('Chip Type', 'PMIC_APP_COUNT')
コード例 #2
0
    def get_cfgInfo(self):
        cp = configparser.ConfigParser(allow_no_value=True)
        cp.read(ModuleObj.get_cmpPath())

        # get GPIO_FREQ section
        keys = cp.options('GPIO_FREQ')
        for key in keys:
            value = cp.get('GPIO_FREQ', key)
            GpioData._freqMap[key] = value

        # get GPIO_MODE section
        keys = cp.options('GPIO_MODE')
        for key in keys:
            value = cp.get('GPIO_MODE', key)
            GpioData._specMap[key] = value

        GpioData._mapList = cp.options('GPIO_VARIABLES_MAPPING')

        cp.read(ModuleObj.get_figPath())
        ops = cp.options('GPIO')
        for op in ops:
            value = cp.get('GPIO', op)
            list = re.split(r' +|\t+', value)
            tmp_list = list[0:len(list) - 2]
            temp = []
            for item in tmp_list:
                str = item[6:len(item) - 1]
                temp.append(str)
            GpioData._modeMap[op] = temp

            data = GpioData()
            data.set_smtNum(string.atoi(list[len(list) - 1]))
            ModuleObj.set_data(self, op.lower(), data)
コード例 #3
0
    def get_cfgInfo(self):
        cp = configparser.ConfigParser(allow_no_value=True)
        cp.read(ModuleObj.get_cmpPath())

        ops = cp.options('Key_definition')
        for op in ops:
            KpdData._keyValueMap[op.upper()] = string.atoi(
                cp.get('Key_definition', op))

        KpdData._keyValueMap['NC'] = 0

        cp.read(ModuleObj.get_figPath())
        if cp.has_option('KEYPAD_EXTEND_TYPE', 'KEY_ROW'):
            KpdData.set_row_ext(
                string.atoi(cp.get('KEYPAD_EXTEND_TYPE', 'KEY_ROW')))
        if cp.has_option('KEYPAD_EXTEND_TYPE', 'KEY_COLUMN'):
            KpdData.set_col_ext(
                string.atoi(cp.get('KEYPAD_EXTEND_TYPE', 'KEY_COLUMN')))

        return True