def __init__(self): SerialBSLTarget.__init__(self) self.i2c_switch_addr = 0x90 self.i2c_control_delay = 0 self.invertSCL = False self.invertSDA = False self.swapSCLSDA = False
def add_extra_options(self): SerialBSLTarget.add_extra_options(self) # by default, use 38400 baud if self.parser.has_option("--speed"): option = self.parser.get_option("--speed") option.default = 38400 option.help = "change baud rate (default %s)" % option.default group = self.parser.get_option_group("--speed") self.parser.remove_option("--speed") group.add_option(option) group = OptionGroup(self.parser, "I2C switch settings") group.add_option("--invert-scl", dest="invert_scl", action="store_true", help="invert I2C switch SCL line", default=False) group.add_option("--invert-sda", dest="invert_sda", action="store_true", help="invert I2C switch SDA line", default=False) group.add_option("--swap-scl-sda", dest="swap_scl_sda", action="store_true", help="swap I2C switch SCL and SDA lines", default=False) self.parser.add_option_group(group)
def parse_extra_options(self): SerialBSLTarget.parse_extra_options(self) if self.options.invert_scl: self.invertSCL = True if self.options.invert_sda: self.invertSDA = True if self.options.swap_scl_sda: self.swapSCLSDA = True
def add_extra_options(self): SerialBSLTarget.add_extra_options(self) # by default, invert TEST/TCK if self.parser.has_option("--invert-test"): option = self.parser.get_option("--invert-test") option.action = "store_false" option.default = True option.help = "do not invert RTS line (default inverted)" group = self.parser.get_option_group("--invert-test") self.parser.remove_option("--invert-test") group.add_option(option) # by default, invert RST if self.parser.has_option("--invert-reset"): option = self.parser.get_option("--invert-reset") option.action = "store_false" option.default = True option.help = "do not invert DTR line (default inverted)" group = self.parser.get_option_group("--invert-reset") self.parser.remove_option("--invert-reset") group.add_option(option) # by default, swap TEST/TCK and RST if self.parser.has_option("--swap-reset-test"): option = self.parser.get_option("--swap-reset-test") option.action = "store_false" option.default = True option.help = "do not exchange RST and TEST signals (DTR/RTS) (default swapped)" group = self.parser.get_option_group("--swap-reset-test") self.parser.remove_option("--swap-reset-test") group.add_option(option) # by default, use 38400 baud if self.parser.has_option("--speed"): option = self.parser.get_option("--speed") option.default = 38400 option.help = "change baud rate (default %s)" % option.default group = self.parser.get_option_group("--speed") self.parser.remove_option("--speed") group.add_option(option)
def __init__(self): SerialBSLTarget.__init__(self)