示例#1
0
def chip_dir_get_from_dev(name):
    chip = XObject.get_chip_object(name)
    if chip is not None:
        return chip.read_dir_config()
        # state = utility.list_convert_number(input_output_status)
        # return state
    else:
        return False
示例#2
0
def select_channel(channel_name):
    """ select which channel to operate
        
        Args:
        channel_name: which channel   will be select, check it in profile. for example:'back-light
            
        Returns:
            object:  return  switch object.
                    
        Raises:
            KeyError: If the key is invalid.    
            ValueError: If the parameter is invalid
    """
    busswitch = Profile.get_busswitch()
    chipname = busswitch[channel_name]['chip']
    channel = busswitch[channel_name]['channel']

    switcher = XObject.get_chip_object(chipname)
    if switcher.select_channel(channel) is False:
        logger.warning("select %s channel %s fail" % (chipname, channel_name))

    return switcher
示例#3
0
def chip_dir_set_to_dev(name, value):
    chip = XObject.get_chip_object(name)
    if chip is not None:
        return chip.write_dir_config(value)
    else:
        return False
示例#4
0
def chip_set_to_dev(name, value):
    chip = XObject.get_chip_object(name)
    if chip is not None:
        return chip.write_outport(value)
    else:
        return False