A Python Library provides full access of SPI/I2C/UART settings and communication with CH347 USB-SPI/I2C/UART bridge chip in Python language.
Project description
CH347-HIDAPI Python Library
Abstract
This project is the API library of CH347 USB-SPI/I2C/UART bridge chip based on Python.
Standard USB-HID mode setting of CH347 chip supported only
This library provides full access of SPI/I2C/UART settings and communication with CH347 USB-SPI/I2C/UART bridge chip in Python language.
For demonstration and code reference please refer to the demo.py
file in source page.
Installation
pip install ch347api
Requirements
Python >= 3.7
hidapi
CAUTION
The communication protocol with CH347 through USB-HID I wrote in this project based on the official demonstration APP. In other words that it was inferred from captured HID package when APP communicates.
THUS, THIS API MAY NOT FULLY CAPABLE OF EVERY FUNCTION IN OFFICIAL API FROM CH347DLL.DLL.
Update Notes
2024-01-12
- Now with fully compatible UART (UART1 with pins TXD1/RXD1/RTS1/CTS1/DTR1) support under mode 3 (which is HID mode),
- Baudrate supports ranging from 1.2K to 9M
- Multithread receiver for UART (optional, default is on) to receive the data in parallel
2024-01-08
- Added independent I2C interface class objects (I2CDevice) and SPI interface class objects (SPIDevice)
- Added new demo file
demo.py
to demonstrate the usage of classes added above (simplified code) - Added device lock to make thread safe
2023-08-06
- Now with fully compatible I2C support, I2C clock speed level: 0 -> 20KHz, 1 -> 100KHz, 2 -> 400KHz, 3 -> 750KHz
- Added test.py for demonstration
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
Built Distribution
File details
Details for the file ch347api-0.3.1.tar.gz
.
File metadata
- Download URL: ch347api-0.3.1.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85d24eca8dcde0944f0bb1043d56b6e3791be054e4079e9ac5ac06be754cb510 |
|
MD5 | 822fe0806d5f22a0968aae9eb1d7e12a |
|
BLAKE2b-256 | a5ac93112a9d37ef08ea58202909569381bdc9acdef6981bc62798f280f0d823 |
File details
Details for the file ch347api-0.3.1-py3-none-any.whl
.
File metadata
- Download URL: ch347api-0.3.1-py3-none-any.whl
- Upload date:
- Size: 14.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61161636abdf1b1395f2a72a09c8290d8fb43af1dc6556eeb1998d1a0534f873 |
|
MD5 | 46c025da9e2a37ef34a949414e215c5f |
|
BLAKE2b-256 | 64fdb99b292c35c21949ee79552ce5a7991ee6afaab673d5f23873f7a86f9429 |