Skip to content

Instantly share code, notes, and snippets.

@tzechienchu
Created November 22, 2022 04:01
Show Gist options
  • Save tzechienchu/4b2c080fb02aca07df8b86b6dd1862d6 to your computer and use it in GitHub Desktop.
Save tzechienchu/4b2c080fb02aca07df8b86b6dd1862d6 to your computer and use it in GitHub Desktop.
ft245 python read usb data
import sys
import ftd2xx as ftd
print(ftd.listDevices())
d = ftd.open(1)
print(d.getDeviceInfo())
d.resetDevice()
d.setBitMode(0xff, 0x40)
d.setUSBParameters(64*1024, 64*1024)
d.setFlowControl(ftd.defines.FLOW_RTS_CTS)
d.setTimeouts(100,100)
for i in range(10):
chunk = d.read(64*1024)
#print(chunk[0:8])
print(chunk.hex())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment