Skip to main content

A python API for the SmartWave interface.

Project description

SmartWaveAPI

A python API for the SmartWave interface.

Installation

  • This package requires python version 3.
  • To install this package, run the following command:
pip install SmartWaveAPI

Usage

It is recommended to use the with..as pattern to implicitly call cleanup functions when resources of the SmartWave device are no longer needed.

Basic I2C script

from SmartWaveAPI import SmartWave

with SmartWave().connect() as sw:
    with sw.createI2CConfig() as i2c:
        # write 0xaa, 0x55 to device with address 0x20
        i2c.write(0x20, bytes([0xaa, 0x55]))
        # read 2 bytes from device with address 0x20
        i2c.read(0x20, 2)
        # write value 0x0f to register 0xaa of device at 0x20
        i2c.writeRegister(0x20, 0xaa.to_bytes(1, "big"), 0x0f.to_bytes(1, "big"))
        # read value of 1-byte register 0xaa of device at 0x20
        i2c.readRegister(0x20, 0xaa.to_bytes(1, "big"), 1)

Basic SPI script

from SmartWaveAPI import SmartWave

with SmartWave().connect() as sw:
    with sw.createSPIConfig() as spi:
        # write 0xaa, 0x55 via SPI and read simultaneously
        spi.write([0xaa, 0x55])

Documentation

Further documentation can be found in our documentation page.

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

smartwaveapi-2.2.0.tar.gz (3.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

smartwaveapi-2.2.0-py3-none-any.whl (438.0 kB view details)

Uploaded Python 3

File details

Details for the file smartwaveapi-2.2.0.tar.gz.

File metadata

  • Download URL: smartwaveapi-2.2.0.tar.gz
  • Upload date:
  • Size: 3.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for smartwaveapi-2.2.0.tar.gz
Algorithm Hash digest
SHA256 ba3339ebc68ec615ed05653509e16571f311c9d91dcb68805f73bfeeabcb59b2
MD5 8c16d707d9d967be4084bd29bb25d73c
BLAKE2b-256 42349198c932c15a37a01e022d13ba0eb6c23286c7f785f8403e3efcc08faba1

See more details on using hashes here.

File details

Details for the file smartwaveapi-2.2.0-py3-none-any.whl.

File metadata

  • Download URL: smartwaveapi-2.2.0-py3-none-any.whl
  • Upload date:
  • Size: 438.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for smartwaveapi-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 209983807ccd88f09ed1ca734aa2f5da193e5181ca7eca85803fcc19b72a5b2b
MD5 99bda9d2691ac2ef002944fcb3651560
BLAKE2b-256 26d60bb6ccf81e583025aea121a093b44100157936689d85dfbbe796293d1fea

See more details on using hashes here.

Supported by

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