Skip to content

ehsanmir/Simple-SPI-over-GPIO-in-Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SPI over GPIO

The Serial Peripheral Interface (SPI) is a synchronous serial communication interface specification used for short-distance communication, primarily in embedded systems. A general-purpose input/output (GPIO) is an uncommitted digital signal pin on an integrated circuit or electronic circuit board which may be used as an input or output, or both, and is controllable by software.

The SPI bus specifies four logic signals:

  1. SCLK: Serial Clock (output from master)
  2. MOSI(SDI): Master Out Slave In (data output from master)
  3. MISO(SDO): Master In Slave Out (data output from slave)
  4. CS /SS: Chip/Slave Select (often active low, output from master to indicate that data is being sent)

SPI BUS

Usage

Using of these codes in your project is super easy:

  1. Select 4 gpio pins from the board and connect to the SPI device. You also have to connect VCC and GND pins and optionally the DAV pin.
  2. Clone the project files:
git clone https://github.com/ehsanmir/Simple-SPI-over-GPIO-in-Python
  1. Import selected gpio pin numbers in the config.ini file.

  2. Now you can run something like this:

from spi import *

writeSPI('f01b33ea')
print(readSPI(32))

Author

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details

About

Reading and writing on SPI bus in embedded linux.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages