Beispiel #1
0
def main(argv):
  vcdfile = "./foo.vcd"  
  #foo = VcdEater(vcdfile)
  foo = AntlrVCD(file(vcdfile))

  spi = SPI(CPOL=0, CPHA=1,
            SCLK="/ad9510_hw/old_booter/clockEngine/SCLK",
            CSN="/ad9510_hw/old_booter/clockEngine/CSN",
            MOSI="/ad9510_hw/old_booter/clockEngine/SDIO")
  spi.register(foo)
  
  foo.go()
  spi.end()

  print '\n'.join(spi.get_mosi())

   
  p = ad9510spi()
  cmds = p.run(spi.get_mosi())
  #print cmds
  for c in cmds:
     tag = ("read" if c['read'] else "write")
     length = c['bytes']
     addr_start = c['addr_hex']
     value = c['value_hex']
     print "%-5s addr:%5s value:%4s" % (tag, addr_start, value)
Beispiel #2
0
def main(args):
  
  vcdfile = "./foo.vcd"
  foo = AntlrVCD(file(vcdfile))

  spi = SPI(CPOL=0, CPHA=0,
            SCLK="/ad9510_hw/old_booter/clockEngine/SCLK",
            CSN="/ad9510_hw/old_booter/clockEngine/CSN",
            MOSI="/ad9510_hw/old_booter/clockEngine/SDIO")
  spi.register(foo)


  foo.go()
  spi.end()

  print spi.get_mosi()