GithubHelp home page GithubHelp logo

gr3yr0n1n / spidriver Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jamesbowman/spidriver

0.0 2.0 0.0 5.26 MB

SPI driver public repo

License: BSD 3-Clause "New" or "Revised" License

C 25.68% Makefile 1.49% NSIS 4.58% Shell 0.08% Forth 16.05% Python 52.13%

spidriver's Introduction

logo

Build Status

SPIDriver is a tool for controlling any SPI device from your PC's USB port. It connects as a standard USB serial device, so there are no drivers to install. The serial protocol is very simple, and there are included drivers for

  • Windows/Mac/Linux GUI
  • Windows/Mac/Linux command-line
  • Python 2 and 3
  • Windows/Mac/Linux C/C++

front

Features:

  • live display shows you exactly what it's doing all the time
  • sustained SPI transfers at 500 Kbps
  • USB line voltage monitor to detect supply problems
  • target device current measurement
  • two auxiliary control lines, A and B
  • dedicated power out lines. 2 each of GND, 3.3 V and 5 V. Up to 500 mA total
  • signals color coded to match jumper colors
  • all signals are 3.3 V, and are 5 V tolerant
  • uses an FTDI USB serial adapter, and Silicon Labs automotive-grade microcontroller
  • also reports uptime, temperature and running CRC of all traffic
  • all sensors and signals controlled over serial

flashexample

For example to read the 3-byte ID from this serial flash in Python:

>>> s = SpiDriver()
>>> s.sel()               # start command
>>> s.write(b'\x9f')      # command 9F is READ JEDEC ID 
>>> list(s.read(3))       # read next 3 bytes
[239, 64, 24]
>>> s.unsel()             # end command
>>>

or using the command line:

$ spi s t 0x9f r 3 u
0xef,0x40,0x18
$

flashexample2

Command-line tool

You can build the command-line tool like this:

$ cd c
$ make -f linux/Makefile 
mkdir -p build/
cc -o build/spi  -I common linux/spi.c common/spidriver.c
$ ./build/spi -h
Bad command '-h'

Commands are:
  i     display status information (uptime, voltage, current, temperature)
  s     SPI select
  u     SPI unselect
  w     write bytes to SPI
  r N   read N bytes from SPI
  a 0/1 Set A line
  b 0/1 Set B line

spidriver's People

Contributors

jamesbowman avatar cabalist avatar

Watchers

James Cloos avatar gr3yR0n1n avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.