Skip to main content

Micropython library to interact with registers and individual bits of devices connected to SPI.

Project description

Pico Register

Micropython library that provides a convenient and efficient way to interact with registers and individual bits of devices connected to the Serial Peripheral Interface (SPI).

Access and control the values of registers, perform read and write operations, and manipulate specific bits within a register.

The library abstracts the low-level details of SPI communication, allowing users to focus on working with registers and bits.

Key Features

  • Simple and intuitive API
  • Read and write operations on registers
  • Bit-level manipulation and access within registers

Installation

pip install pico-register

## Usage

from register import Register, Bits

# Address of the register as specified in the device datasheet
WHO_AM_I = 0x0F
CTRL_REG = 0x10
PRESS_OUT_LSB = 0x28
PRESS_OUT_MSB = 0x29

# Create the registers objects
reg_device_id = Register(WHO_AM_I)
reg_pressure = Register(PRESS_OUT_LSB, 2)

# or the bits
data_ready = Bits(CTRL_REG, 0)
low_pass_filter = Bits(CTRL_REG, 3, 2)

# write values
low_pass_filter = 3

# Read the values
if data_ready:
  print(reg_pressure)

Contributing

Contributions to this project are welcome. If you find any issues, have suggestions for improvements, or want to add new features, feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License. Feel free to use, modify, and distribute the code in accordance with the terms of the license.

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

pico-register-0.1.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

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

pico_register-0.1.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file pico-register-0.1.0.tar.gz.

File metadata

  • Download URL: pico-register-0.1.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for pico-register-0.1.0.tar.gz
Algorithm Hash digest
SHA256 00dc0059e6d6e6219cf6bf9334e2ee633c3b6e5cd5786c640db0a6f4b55f2ea9
MD5 3b3f487cdd6eee8032db106233d5a116
BLAKE2b-256 298314830d5a37ba5b01b3464e6510522e61892d1443cf1aa74414e028b81909

See more details on using hashes here.

File details

Details for the file pico_register-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pico_register-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for pico_register-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 02ea6a7ff0e45ff87cbca917169e01c9e5bec91804a07a62249abfac0aa96e66
MD5 04a0f922f0f1a0cfb043ea50f97f238c
BLAKE2b-256 3d8f7f8e4b92f240a3d06cd9f14c54b41a2278b2ae1e45016f45a01d17e660cc

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