Skip to main content

PCI driver for python

Project description

PCI driver for python

Environment

Installation

pip install pypci

Usage

>>> import pypci

# look-up pci board
>>> board = pypci.lspci(vendor=0x1147, device=3214)

>>> board[0].vendor_id
4423

>>> board[0].bar
[BaseAddressRegister(type='mem', addr=2421170176, size=64),
 BaseAddressRegister(type='mem', addr=2421166080, size=64),
 BaseAddressRegister(type='mem', addr=2421174272, size=32)]


# read data
>>> bar2 = board[0].bar[2]
>>> pypci.read(bar2, 0x0c, 4)
b'\x00\x00\x00\x0c'


# write data
>>> pypci.write(bar[2], 0x04, b'\x01')

>>> data = struct.pack('<I', 1234567)
>>> pypci.write(bar[2], 0x00, data)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pypci-0.1.4.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

pypci-0.1.4-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file pypci-0.1.4.tar.gz.

File metadata

  • Download URL: pypci-0.1.4.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for pypci-0.1.4.tar.gz
Algorithm Hash digest
SHA256 8bf78f19ee4879671b60b582c699a9a3fbdb1f7f337e55b119bb07921423da8e
MD5 b363238d089a23e98ca36ca63a2b5e66
BLAKE2b-256 ed4e9a3072b32ec5d04f93ba2f7783bbedb9b3885f65fa275d90cc086bfc0c32

See more details on using hashes here.

File details

Details for the file pypci-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: pypci-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for pypci-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 35c46cfde2d1fc692527941323bdd66c0487f16e6ac7768f86e53fc32b1d8156
MD5 5ed2a5fc011407e1063478f1daf2ef3b
BLAKE2b-256 609f1b04d3525a1fe4539e009b1b7d40ef85ac48d0898a10d34a6c2ad7467d40

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page