本文整理汇总了Python中pyOCD.board.MbedBoard.init方法的典型用法代码示例。如果您正苦于以下问题:Python MbedBoard.init方法的具体用法?Python MbedBoard.init怎么用?Python MbedBoard.init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyOCD.board.MbedBoard
的用法示例。
在下文中一共展示了MbedBoard.init方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getAdapter
# 需要导入模块: from pyOCD.board import MbedBoard [as 别名]
# 或者: from pyOCD.board.MbedBoard import init [as 别名]
def getAdapter():
'''
Get a CMSIS DAP debug adapter
'''
interfaces = INTERFACE[usb_backend].getAllConnectedInterface(VID, PID)
if interfaces == None:
print "Not find a mbed interface"
sys.exit(1)
first_interface = interfaces[0]
adapter = MbedBoard("target_lpc1768", "flash_lpc1768", first_interface)
adapter.init()
return adapter
示例2: MbedBoard
# 需要导入模块: from pyOCD.board import MbedBoard [as 别名]
# 或者: from pyOCD.board.MbedBoard import init [as 别名]
if args.verbose == 2:
logging.basicConfig(level=logging.DEBUG)
elif args.verbose == 1:
logging.basicConfig(level=logging.INFO)
adapter = None
try:
interfaces = INTERFACE[usb_backend].getAllConnectedInterface(VID, PID)
if interfaces == None:
print "Not find a mbed interface"
sys.exit(1)
# Use the first one
first_interface = interfaces[0]
adapter = MbedBoard("target_lpc1768", "flash_lpc1768", first_interface)
adapter.init()
target = adapter.target
target.halt()
if args.ihex:
print 'flash hex file - %s to nrf51822' % args.ihex
flashHex(target, args.ihex)
offset = 0x14000
if args.offset:
offset = args.offset
if args.bin:
print 'flash binary file - %s to nrf51822' % args.bin
flashBin(target, args.bin, offset)