コード例 #1
0
 def __init__(self):
     parser = xserial.ArgumentParser()
     options = parser.parse_args()
     self.serial = xserial.get_serial(options)
     self.serial.reset_device()
     self.serial.detect_wires()
     time.sleep(
         0.2
     )  # Give Diabolo enough time to compute the CRC of the application
     self.serial.sync()
     self.prompt = self.serial.lastchar
コード例 #2
0
 def __init__(self):
     parser = xserial.ArgumentParser()
     parser.add_argument('command', help='read or write', choices=['read','write'])
     parser.add_argument('address', help='address to read or write',
                         type=lambda(x): int(x,0))
     parser.add_argument('value', help='how many byte to read, or value to write',
                         type=lambda(x): int(x,0))
     self.options = parser.parse_args()
     self.serial = xserial.get_serial(self.options)
     self.serial.reset_device()
     self.serial.detect_wires()
     time.sleep(0.2)  # Give Diabolo enough time to compute the CRC of the application
     self.serial.sync()
コード例 #3
0
ファイル: main.py プロジェクト: z13z4ck/hwa
"""

import sys
import os.path
sys.path.insert(1,os.path.normpath(sys.path[0]+"../../../../../python"))

import __builtin__
import premain
from utils import s2hex, hexdump
import time

enable_trace()

import xserial

parser = xserial.ArgumentParser()

parser.add_argument('--lpf', help="low-pass filter on received data", action='store_true')
parser.add_argument('--gfx', help="graphical gauge", action='store_true')

args = parser.parse_args()

serial = xserial.get_serial(args)

serial.reset_device()
serial.detect_wires()
time.sleep(0.2)	# Leave Diabolo enough time to check the CRC and start the application
serial.sync()


if args.gfx: