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.1.3.tar.gz (79.7 MB view details)

Uploaded Source

Built Distribution

smartwaveapi-2.1.3-py3-none-any.whl (438.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: smartwaveapi-2.1.3.tar.gz
  • Upload date:
  • Size: 79.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.13

File hashes

Hashes for smartwaveapi-2.1.3.tar.gz
Algorithm Hash digest
SHA256 6ce43089967bdd4d32eea111482f346d78fd4ac345015b8e0a4f8fb9ebdd3a12
MD5 751ad210423c173b26860e67ccba1136
BLAKE2b-256 9e496017be3381178e453b3ac802ecaa5e47fc069bfa75e89db053e9df0fa4e8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: smartwaveapi-2.1.3-py3-none-any.whl
  • Upload date:
  • Size: 438.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.13

File hashes

Hashes for smartwaveapi-2.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2bd8ab64fb806abc7487dc0c7003bdfa751b300fe74c77c7c26a46a5452a1bae
MD5 77198598e6db4f53c2d4353a62342d6b
BLAKE2b-256 cb2036f7393a32d4c8902f2d4e0baa5c92680638d4bfa6f363faf9450e4f9b08

See more details on using hashes here.

Supported by

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