Skip to main content

Library to access various I2C/SPI/GPIO-accessible chips over Cypress CY7C65211/3/5 USB-to-UART/I2C/SPI/GPIO bridge.

Project description

Python library to access Cypress CY7C6521x (CY7C65211, CY7C65213, or CY7C65215) USB-Serial bridge (USB to UART/I2C/SPI/GPIO) chip. Also includes library to access various chips over I2C/SPI. Currently includes driver for

  • Nordic nRF24L01 wireless tranceiver (SPI)

  • InvenSense MPU-6050 3-axis accelerometer + 3-axis gyroscope (I2C)

  • Honeywell HMC5883L 3-axis magnetometer (I2C)

  • Si4702 FM radio receiver (I2C for now, additional SPI-mode ongoing)

## Usage (CY7C6521x)

>>> from ucdev.cy7c65211 import CyUSBSerial, CyGPIO, CySPI
>>>
>>> # load DLL provided by Cypress
>>> lib = CyUSBSerial(lib="cyusbserial")
>>>
>>> # use first device found
>>> dev = lib.find().next()
>>>
>>> # access GPIO
>>> gpio = CyGPIO(dev)
>>> gpio.set(3, 1)
>>> ret = gpio.get(3)
>>>
>>> # access each GPIO pin
>>> pin = gpio.pin(3)
>>> pin.set(1)
>>> ret = pin.get()
>>>
>>> # access SPI
>>> spi = CySPI(dev)
>>> ret = spi.send("any-data-to-be-clocked-out")

## Usage (nRF24L01)

>>> from ucdev.nrf24 import *
>>>
>>> tx = nRF24(CySPI(dev), CE=CyGPIO(dev).pin(0))
>>> tx.reset(MODE_SB|DIR_SEND)
>>> tx.TX_ADDR = tx.RX_ADDR_P0 = 0xB3B4B5B6C2
>>> tx.send("some-payload-len-of-max-32-bytes")
>>>
>>> print tx.FIFO_STATUS.TX_EMPTY
>>> print tx.CONFIG

## Note This requires cyusbserial.dll (or libcyusbserial.so) library provided by Cypress.

Current development focuses on GPIO and SPI features to use Nordic nRF24 wireless tranceiver chip. See sample scripts under bin/ folder for the detail.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

ucdev-0.0.3-py2-none-any.whl (28.4 kB view details)

Uploaded Python 2

File details

Details for the file ucdev-0.0.3-py2-none-any.whl.

File metadata

File hashes

Hashes for ucdev-0.0.3-py2-none-any.whl
Algorithm Hash digest
SHA256 6aa297bd8e391bd837413baf16dddec12832014b39dbbbc471b6271affdf52d1
MD5 19eb8293389f8744cb8777285d76ad07
BLAKE2b-256 fa9e8e65c9052350c02b3eb48ebf406c23ba5e23eb087aa36dee55475315ef9b

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