SPIReg-C1101 provides predefined registers for the CC1101 chip.
Project description
SPIReg-C1101
SPIReg-C1101 provides predefined register definitions for the CC1101 transceiver using the SPIReg framework.
Features
- Predefined register mappings for the CC1101 chip.
- Consistent access to register fields using the SPIReg notation.
- Supports both status and configuration registers.
- Ensures type-safe access to individual register fields.
Installation
SPIReg-C1101 uses spireg under the hood.
pip install spireg_c1101
Usage
import spidev
from spireg_c1101.status_register import PARTNUM, VERSION
from spireg_c1101.configuration_register import IOCFG2
# Initialize SPI device
spi = spidev.SpiDev()
spi.open(0, 0) # Use the appropriate SPI bus and device number
spi.max_speed_hz = 5000000 # Set the SPI clock speed
# Function to read a register
def read_register(register):
address = register.register | 0x80 # Set the read bit
response = spi.xfer2([address, 0x00])
return response[1]
# Function to write a register
def write_register(register):
address = register.register & 0x7F # Clear the read bit
spi.xfer2([address, int(register)])
# Read PARTNUM and VERSION
PARTNUM.value = read_register(PARTNUM.register)
VERSION.value = read_register(VERSION.register)
print(f"Part Number: {PARTNUM.value}")
print(f"Chip Version: {VERSION.value}")
# Read, toggle, and write IOCFG2
IOCFG2.value = read_register(IOCFG2)
IOCFG2.GDO2_INV ^= 1 # Toggle GDO2_INV
write_register(IOCFG2)
print(f"Updated IOCFG2: {IOCFG2.value}")
# Close SPI connection
spi.close()
Registers
See the C1101 documentation for all available registers.
SPI Communication
SPIReg-C1101 only defines register structures. The user is responsible for:
- Implementing SPI communication to read/write register values.
- Integrating with hardware-specific SPI drivers.
- Ensuring correct register access sequences as per the CC1101 datasheet.
License
This project is licensed under GPL-3.0-or-later.
For commercial licensing, please contact:
Daniël van den Berg
daniel@dmvandenberg.nl
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spireg_c1101-0.1.0.tar.gz.
File metadata
- Download URL: spireg_c1101-0.1.0.tar.gz
- Upload date:
- Size: 2.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9981151b815049244d74af12133e2038f83b466e81b1ce2953964bdf87fc7893
|
|
| MD5 |
41bbce061622186e8894a0e29c891b66
|
|
| BLAKE2b-256 |
73504a8bb3fbb3d1c64473f755af76d568e6e39bbfe09c50bef33c195e7f8e11
|
File details
Details for the file spireg_c1101-0.1.0-py2.py3-none-any.whl.
File metadata
- Download URL: spireg_c1101-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 29.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8746684f5809ab1a2ba6d4943389bfd0ac4331aee72262bae7a24caba84af296
|
|
| MD5 |
707bf3a85376b347ff79cd913b26663f
|
|
| BLAKE2b-256 |
c06a322579c44e7e4c4e24e389aa0be62ef0b950cf48189f1ba069ea7a9d9404
|