X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=blobdiff_plain;f=examples%2Fpython%2Fcomplete.py;h=f1b737c923d2d44b40138d54111f94becb1803ce;hp=cf60d4d31e7fafd7e275df72fdd3b05ce54f269f;hb=bcf4a08bf629f8c6364b9057ab68228709ccab29;hpb=50280d45a136b6915dfdd06843f5f847a7ca468a diff --git a/examples/python/complete.py b/examples/python/complete.py index cf60d4d..f1b737c 100644 --- a/examples/python/complete.py +++ b/examples/python/complete.py @@ -9,7 +9,7 @@ of the swig generated python wrapper You need to build and install the wrapper first""" import os -import ftdi +import ftdi1 as ftdi import time # initialize @@ -63,6 +63,14 @@ ftdi.disable_bitbang( ftdic ) print '' +# read pins +ret, pins = ftdi.read_pins( ftdic ) +print 'pins:', +if ( ret == 0 ): + print '%02x' % ord( pins[0] ) +print '' + + # read chip id ret, chipid = ftdi.read_chipid( ftdic ) print 'FDTI chip id: %X\n' % chipid @@ -76,9 +84,10 @@ if (ret==0): print 'complete eeprom:' ret = ftdi.read_eeprom( ftdic ) -ret, eeprom = ftdi.get_eeprom_buf ( ftdic ) +size = 128 +ret, eeprom = ftdi.get_eeprom_buf ( ftdic, size ) if ( ret == 0 ): - for i in range( 128 ): + for i in range( size ): print '%02x' % ord( eeprom[i] ), if ( i % 8 == 7 ): print ''