Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.8%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Basic Info
  • Host: GitHub
  • Owner: doceme
  • License: mit
  • Language: C
  • Default Branch: master
  • Homepage:
  • Size: 101 KB
Statistics
  • Stars: 466
  • Watchers: 29
  • Forks: 205
  • Open Issues: 48
  • Releases: 1
Created over 14 years ago · Last pushed about 1 year ago
Metadata Files
Readme Changelog License

README.md

Python Spidev

This project contains a python module for interfacing with SPI devices from user space via the spidev linux kernel driver.

All code is MIT licensed unless explicitly stated otherwise.

Usage

python import spidev spi = spidev.SpiDev() spi.open(bus, device) to_send = [0x01, 0x02, 0x03] spi.xfer(to_send)

Settings

```python import spidev spi = spidev.SpiDev() spi.open(bus, device)

Settings (for example)

spi.maxspeedhz = 5000 spi.mode = 0b01

... ```

  • bits_per_word
  • cshigh
  • loop - Set the "SPI_LOOP" flag to enable loopback mode
  • no_cs - Set the "SPINOCS" flag to disable use of the chip select (although the driver may still own the CS pin)
  • lsbfirst
  • max_speed_hz
  • mode - SPI mode as two bit pattern of clock polarity and phase [CPOL|CPHA], min: 0b00 = 0, max: 0b11 = 3
  • threewire - SI/SO signals shared
  • read0 - Read 0 bytes after transfer to lower CS if cshigh == True

Methods

open(bus, device)

Connects to the specified SPI device, opening /dev/spidev<bus>.<device>

readbytes(n)

Read n bytes from SPI device.

writebytes(list of values)

Writes a list of values to SPI device.

writebytes2(list of values)

Similar to writebytes but accepts arbitrary large lists. If list size exceeds buffer size (which is read from /sys/module/spidev/parameters/bufsiz), data will be split into smaller chunks and sent in multiple operations.

Also, writebytes2 understands buffer protocol so it can accept numpy byte arrays for example without need to convert them with tolist() first. This offers much better performance where you need to transfer frames to SPI-connected displays for instance.

xfer(list of values[, speed_hz, delay_usec, bits_per_word])

Performs an SPI transaction. Chip-select should be released and reactivated between blocks. Delay specifies the delay in usec between blocks.

xfer2(list of values[, speed_hz, delay_usec, bits_per_word])

Performs an SPI transaction. Chip-select should be held active between blocks.

xfer3(list of values[, speed_hz, delay_usec, bits_per_word])

Similar to xfer2 but accepts arbitrary large lists. If list size exceeds buffer size (which is read from /sys/module/spidev/parameters/bufsiz), data will be split into smaller chunks and sent in multiple operations.

close()

Disconnects from the SPI device.

Owner

  • Name: Stephen Caudle
  • Login: doceme
  • Kind: user

GitHub Events

Total
  • Issues event: 4
  • Watch event: 12
  • Issue comment event: 3
  • Push event: 3
  • Pull request event: 3
  • Fork event: 2
  • Create event: 1
Last Year
  • Issues event: 4
  • Watch event: 12
  • Issue comment event: 3
  • Push event: 3
  • Pull request event: 3
  • Fork event: 2
  • Create event: 1

Committers

Last synced: about 3 years ago

All Time
  • Total Commits: 58
  • Total Committers: 23
  • Avg Commits per committer: 2.522
  • Development Distribution Score (DDS): 0.707
Past Year
  • Commits: 1
  • Committers: 1
  • Avg Commits per committer: 1.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Phil Howard p****l@g****m 17
Stephen Caudle s****n@c****o 8
Stephen Caudle s****n@c****m 5
ams-tech a****h@u****m 4
Stephen Caudle s****e@d****m 3
Dmitry Andrianov g****b@d****u 2
Radek Podgorny r****k@p****z 2
Catalin Petrescu c****u@g****m 2
Tom Dean t****n@w****m 1
Jacob Walker j****4@g****m 1
Jonas Zimmermann p****t@j****e 1
Jonathon Reinhart J****t@g****m 1
Lars Kellogg-Stedman l****s@r****m 1
Luiz Eduardo Amaral l****6@g****m 1
Zajcev Evgeny z****g@y****u 1
chrillomat c****i@c****t 1
dpslwk d****k@g****m 1
Paul Brook p****l@n****g 1
mk2366 k****s@g****m 1
billmccartney b****y@g****m 1
Bernd Kuhls b****s@t****e 1
Phil Howard P****l@g****m 1
Tim Wood t****0@p****t 1

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 80
  • Total pull requests: 29
  • Average time to close issues: 12 months
  • Average time to close pull requests: 4 months
  • Total issue authors: 73
  • Total pull request authors: 16
  • Average comments per issue: 2.93
  • Average comments per pull request: 0.86
  • Merged pull requests: 18
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 4
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 4
  • Pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • Gadgetoid (4)
  • sophiekovalevsky (2)
  • MikeD2-mnb (2)
  • EricPobot (2)
  • me21 (2)
  • HowardALandman (1)
  • sbelbin (1)
  • tim-seoss (1)
  • tomekki (1)
  • charlesnicholson (1)
  • gladk (1)
  • Ouroboros75 (1)
  • aronfeher (1)
  • manushawijekoon (1)
  • erikbgithub (1)
Pull Request Authors
  • Gadgetoid (6)
  • doceme (6)
  • dlech (4)
  • aardvarkkrill (2)
  • dimas (2)
  • ekerin (1)
  • JonathonReinhart (1)
  • dpslwk (1)
  • ams-tech (1)
  • mk2366 (1)
  • billmccartney (1)
  • cpetrescu (1)
  • hugolm84 (1)
  • zeeMonkeez (1)
  • ksunden (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 59,628 last-month
  • Total docker downloads: 5,185,105
  • Total dependent packages: 53
    (may contain duplicates)
  • Total dependent repositories: 1,067
    (may contain duplicates)
  • Total versions: 10
  • Total maintainers: 3
pypi.org: spidev

Python bindings for Linux SPI access through spidev

  • Versions: 8
  • Dependent Packages: 53
  • Dependent Repositories: 1,067
  • Downloads: 59,628 Last month
  • Docker Downloads: 5,185,105
Rankings
Dependent packages count: 0.3%
Dependent repos count: 0.4%
Docker downloads count: 0.6%
Downloads: 1.4%
Average: 1.5%
Stargazers count: 2.9%
Forks count: 3.6%
Maintainers (2)
Last synced: 10 months ago
alpine-edge: py3-spidev

python module for interfacing with SPI devices from user space

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Forks count: 7.7%
Average: 8.9%
Stargazers count: 13.3%
Dependent packages count: 14.6%
Maintainers (1)
Last synced: 10 months ago

Dependencies

setup.py pypi