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')
def getCfgInfo(self): cp = configparser.ConfigParser(allow_no_value=True) cp.read(ModuleObj.get_figPath()) self.__list = cp.options('POWER') self.__list = self.__list[1:] self.__list = sorted(self.__list)
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)
def get_cfgInfo(self): cp = ConfigParser.ConfigParser(allow_no_value=True) cp.read(ModuleObj.get_figPath()) ops = cp.options('GPIO') map = {} mode_map = {} for op in ops: value = cp.get('GPIO', op) list = re.split(r' +|\t+', value) map[string.atoi(re.findall(r'\d+', op)[0])] = string.atoi( list[len(list) - 2]) mode_map[op] = list[0:len(list) - 2] EintData.set_mapTable(map) EintData.set_modeMap(mode_map) if cp.has_option('EINT', 'EINT_MAP_COUNT'): self.__map_count = string.atoi(cp.get('EINT', 'EINT_MAP_COUNT')) if cp.has_option('EINT', 'INTERNAL_EINT'): info = cp.get('EINT', 'INTERNAL_EINT') str_list = info.split(':') for item in str_list: sub_list = item.split('/') EintData._int_eint[sub_list[0]] = sub_list[1] if cp.has_option('EINT', 'BUILTIN_EINT'): info = cp.get('EINT', 'BUILTIN_EINT') str_list = info.split(':') for builtin_item in str_list: builtin_list = builtin_item.split('/') #EintData._builtin_map[builtin_list[0]] = builtin_list[1] temp = 'BUILTIN_%s' % (builtin_list[0]) if cp.has_option('EINT', temp): info = cp.get('EINT', temp) str_list = info.split(':') temp_map = {} for item in str_list: sub_list = item.split('/') temp_map[ sub_list[0]] = sub_list[1] + ':' + builtin_list[1] EintData._builtin_map[builtin_list[0]] = temp_map EintData._builtin_eint_count += len(temp_map) self.__gpio_obj.set_eint_map_table(EintData._map_table)
def get_cfgInfo(self): cp = configparser.ConfigParser(allow_no_value=True) cp.read(ModuleObj.get_figPath()) I2cData._i2c_count = string.atoi(cp.get('I2C', 'I2C_COUNT')) I2cData._channel_count = string.atoi(cp.get('I2C', 'CHANNEL_COUNT')) if cp.has_option('Chip Type', 'I2C_BUS'): flag = cp.get('Chip Type', 'I2C_BUS') if flag == '0': self._bBusEnable = False if cp.has_option('Chip Type', 'I2C_BUS'): flag = cp.get('Chip Type', 'I2C_BUS') if flag == '0': self._bBusEnable = False
def get_cfgInfo(self): # ConfigParser accept ":" and "=", so SRC_PIN will be treated specially cp = configparser.ConfigParser(allow_no_value=True) cp.read(ModuleObj.get_figPath()) if cp.has_option('Chip Type', 'MD1_EINT_SRC_PIN'): flag = cp.get('Chip Type', 'MD1_EINT_SRC_PIN') if flag == '0': self.__bSrcPinEnable = False if(self.__bSrcPinEnable): for option in cp.options('SRC_PIN'): value = cp.get('SRC_PIN', option) value = value[1:] temp = value.split('=') self.__srcPin[temp[0]] = temp[1] else: self.__srcPin[''] = '-1'
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
def get_cfgInfo(self): cp = configparser.ConfigParser(allow_no_value=True) cp.read(ModuleObj.get_figPath()) count = string.atoi(cp.get('CLK_BUF', 'CLK_BUF_COUNT')) self.__count = count ops = cp.options('CLK_BUF') for op in ops: if op == 'clk_buf_count': self.__count = string.atoi(cp.get('CLK_BUF', op)) ClkData._count = string.atoi(cp.get('CLK_BUF', op)) continue value = cp.get('CLK_BUF', op) var_list = value.split(':') data = ClkData() data.set_curList(var_list[2:]) data.set_defVarName(string.atoi(var_list[0])) data.set_defCurrent(string.atoi(var_list[1])) key = op[16:].upper() ModuleObj.set_data(self, key, data)
def get_cfgInfo(self): cp = configparser.ConfigParser(allow_no_value=True) cp.read(ModuleObj.get_figPath()) count = string.atoi(cp.get('CLK_BUF', 'CLK_BUF_COUNT')) self.__count = count