2
# -*- coding: utf-8 -*-
4
# Copyright (c) 2012 Christopher Wilson <cwilson@cdwilson.us>
6
# Simplified BSD License (see LICENSE.txt for full text)
8
from msp430.bsl.target import SerialBSLTarget
11
class FCDProgTarget(SerialBSLTarget):
13
Flying Camp Design MSP430 BSL Programmer target
15
http://www.flyingcampdesign.com
19
SerialBSLTarget.__init__(self)
21
def add_extra_options(self):
22
SerialBSLTarget.add_extra_options(self)
24
# by default, invert TEST/TCK
25
if self.parser.has_option("--invert-test"):
26
option = self.parser.get_option("--invert-test")
27
option.action = "store_false"
29
option.help = "do not invert RTS line (default inverted)"
30
group = self.parser.get_option_group("--invert-test")
31
self.parser.remove_option("--invert-test")
32
group.add_option(option)
34
# by default, invert RST
35
if self.parser.has_option("--invert-reset"):
36
option = self.parser.get_option("--invert-reset")
37
option.action = "store_false"
39
option.help = "do not invert DTR line (default inverted)"
40
group = self.parser.get_option_group("--invert-reset")
41
self.parser.remove_option("--invert-reset")
42
group.add_option(option)
44
# by default, swap TEST/TCK and RST
45
if self.parser.has_option("--swap-reset-test"):
46
option = self.parser.get_option("--swap-reset-test")
47
option.action = "store_false"
49
option.help = "do not exchange RST and TEST signals (DTR/RTS) (default swapped)"
50
group = self.parser.get_option_group("--swap-reset-test")
51
self.parser.remove_option("--swap-reset-test")
52
group.add_option(option)
54
# by default, use 38400 baud
55
if self.parser.has_option("--speed"):
56
option = self.parser.get_option("--speed")
57
option.default = 38400
58
option.help = "change baud rate (default %s)" % option.default
59
group = self.parser.get_option_group("--speed")
60
self.parser.remove_option("--speed")
61
group.add_option(option)
65
# run the main application
66
bsl_target = FCDProgTarget()
69
if __name__ == '__main__':