{ "info": { "author": "Stephen Caudle", "author_email": "scaudle@doceme.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Topic :: Software Development", "Topic :: System :: Hardware", "Topic :: System :: Hardware :: Hardware Drivers" ], "description": "Python Spidev\n=============\n\nThis project contains a python module for interfacing with SPI devices from user space via the spidev linux kernel driver.\n\nAll code is MIT licensed unless explicitly stated otherwise.\n\nUsage\n-----\n\n```python\nimport spidev\nspi = spidev.SpiDev()\nspi.open(bus, device)\nto_send = [0x01, 0x02, 0x03]\nspi.xfer(to_send)\n```\nSettings\n--------\n\n```python\nimport spidev\nspi = spidev.SpiDev()\nspi.open(bus, device)\n\n# Settings (for example)\nspi.max_speed_hz = 5000\nspi.mode = 0b01\n\n...\n```\n\n* `bits_per_word`\n* `cshigh`\n* `loop` - Set the \"SPI_LOOP\" flag to enable loopback mode\n* `no_cs` - Set the \"SPI_NO_CS\" flag to disable use of the chip select (although the driver may still own the CS pin)\n* `lsbfirst`\n* `max_speed_hz`\n* `mode` - SPI mode as two bit pattern of clock polarity and phase [CPOL|CPHA], min: 0b00 = 0, max: 0b11 = 3\n* `threewire` - SI/SO signals shared\n\nMethods\n-------\n\n open(bus, device)\n\nConnects to the specified SPI device, opening `/dev/spidev.`\n\n readbytes(n)\n\nRead n bytes from SPI device.\n\n writebytes(list of values)\n\nWrites a list of values to SPI device.\n\n writebytes2(list of values)\n\nSimilar to `writebytes` but accepts arbitrary large lists.\nIf list size exceeds buffer size (which is read from `/sys/module/spidev/parameters/bufsiz`),\ndata will be split into smaller chunks and sent in multiple operations.\n\nAlso, `writebytes2` understands [buffer protocol](https://docs.python.org/3/c-api/buffer.html)\nso it can accept numpy byte arrays for example without need to convert them with `tolist()` first.\nThis offers much better performance where you need to transfer frames to SPI-connected displays for instance.\n\n xfer(list of values[, speed_hz, delay_usec, bits_per_word])\n\nPerforms an SPI transaction. Chip-select should be released and reactivated between blocks.\nDelay specifies the delay in usec between blocks.\n\n xfer2(list of values[, speed_hz, delay_usec, bits_per_word])\n\nPerforms an SPI transaction. Chip-select should be held active between blocks.\n\n xfer3(list of values[, speed_hz, delay_usec, bits_per_word])\n\nSimilar to `xfer2` but accepts arbitrary large lists.\nIf list size exceeds buffer size (which is read from `/sys/module/spidev/parameters/bufsiz`),\ndata will be split into smaller chunks and sent in multiple operations.\n\n close()\n\nDisconnects from the SPI device.\n\nChangelog\n---------\n\n3.4\n=====\n\n* Changed license to MIT\n\n3.0.1\n=====\n\n* Fixed README.md and CHANGELOG.md formatting, hopefully\n\n3.0\n===\n\n* Memset fix recommended by Dougie Lawson\n* Fixes for Kernel 3.15+ from https://github.com/chrillomat/py-spidev\n* Fixes for Python 3/2 compatibility.\n* Added subclassing support - https://github.com/doceme/py-spidev/issues/10\n\n2.0\n===\n\nCode sourced from http://elk.informatik.fh-augsburg.de/da/da-49/trees/pyap7k/lang/py-spi\nand modified.\n\nPre 2.0\n=======\n\nspimodule.c originally uathored by Volker Thoms, 2009.", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/doceme/py-spidev", "keywords": "", "license": "GPLv2", "maintainer": "", "maintainer_email": "", "name": "spidev", "package_url": "https://pypi.org/project/spidev/", "platform": "", "project_url": "https://pypi.org/project/spidev/", "project_urls": { "Homepage": "http://github.com/doceme/py-spidev" }, "release_url": "https://pypi.org/project/spidev/3.4/", "requires_dist": null, "requires_python": "", "summary": "Python bindings for Linux SPI access through spidev", "version": "3.4" }, "last_serial": 4851250, "releases": { "2.0": [ { "comment_text": "", "digests": { "md5": "b2ff7e51b350febb15ebc20b8a4ed430", "sha256": "0b27bfa3c05c29dea3a14ed23761388c280a33381dda922d8184882b8216bd3c" }, "downloads": -1, "filename": "spidev-2.0.tar.gz", "has_sig": false, "md5_digest": "b2ff7e51b350febb15ebc20b8a4ed430", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4982, "upload_time": "2012-12-17T11:06:02", "url": "https://files.pythonhosted.org/packages/bf/59/ec1104f4b9d6b64873b8470121e89abf6a731ab9209151eb75e2bad810f6/spidev-2.0.tar.gz" } ], "3.0": [ { "comment_text": "", "digests": { "md5": "06a4f20ad3fb108b719bf4fcc5126607", "sha256": "af3ec8bf50f2577f62407b1ff1c0be3d5dadcdc3ce0ba2f8eea15e647ff2b51e" }, "downloads": -1, "filename": "spidev-3.0.tar.gz", "has_sig": false, "md5_digest": "06a4f20ad3fb108b719bf4fcc5126607", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12418, "upload_time": "2015-02-04T09:36:43", "url": "https://files.pythonhosted.org/packages/94/c7/d7434902a367cacb975c0905b05bc3592737eadf36dce8b2320ac885bf4e/spidev-3.0.tar.gz" } ], "3.1": [ { "comment_text": "", "digests": { "md5": "fe9146030263c62858051f3485afa313", "sha256": "355391e9ad3024950590626b080324394c12e75bb21923dbd56a978a1eac6ac7" }, "downloads": -1, "filename": "spidev-3.1.tar.gz", "has_sig": false, "md5_digest": "fe9146030263c62858051f3485afa313", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12583, "upload_time": "2015-07-29T20:33:52", "url": "https://files.pythonhosted.org/packages/9c/4f/fd0f50ca92645980ad857fccbb13b1f2e877bc1defedf6404b63f9bea4b4/spidev-3.1.tar.gz" } ], "3.2": [ { "comment_text": "", "digests": { "md5": "f601676f1bb48b9aa3b3897f95216365", "sha256": "09d2b5122f0dd79910713a11f9a0020f71537224bf829916def4fffc0ea59456" }, "downloads": -1, "filename": "spidev-3.2.tar.gz", "has_sig": false, "md5_digest": "f601676f1bb48b9aa3b3897f95216365", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12812, "upload_time": "2016-03-08T13:54:26", "url": "https://files.pythonhosted.org/packages/36/83/73748b6e1819b57d8e1df8090200195cdae33aaa22a49a91ded16785eedd/spidev-3.2.tar.gz" } ], "3.4": [ { "comment_text": "", "digests": { "md5": "bbab6352449f1d572cc9eefeafc58bd1", "sha256": "4314e52f573d95233c907f307558893313a8a606e197e77bb711526b0e179e80" }, "downloads": -1, "filename": "spidev-3.4.tar.gz", "has_sig": false, "md5_digest": "bbab6352449f1d572cc9eefeafc58bd1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10222, "upload_time": "2019-02-21T18:21:06", "url": "https://files.pythonhosted.org/packages/fb/14/4c2e1640f0cb04862c76d9d76ed7c945b0f67876e503ac02f7f675fe86a0/spidev-3.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "bbab6352449f1d572cc9eefeafc58bd1", "sha256": "4314e52f573d95233c907f307558893313a8a606e197e77bb711526b0e179e80" }, "downloads": -1, "filename": "spidev-3.4.tar.gz", "has_sig": false, "md5_digest": "bbab6352449f1d572cc9eefeafc58bd1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10222, "upload_time": "2019-02-21T18:21:06", "url": "https://files.pythonhosted.org/packages/fb/14/4c2e1640f0cb04862c76d9d76ed7c945b0f67876e503ac02f7f675fe86a0/spidev-3.4.tar.gz" } ] }