Skip to main content

CH347-HIDAPI Python Library

+ CH347-HIDAPI Github Page +

license pypi python

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.

CH347-Chip Official Site

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

  1. Now with fully compatible UART (UART1 with pins TXD1/RXD1/RTS1/CTS1/DTR1) support under mode 3 (which is HID mode),
  2. Baudrate supports ranging from 1.2K to 9M
  3. Multithread receiver for UART (optional, default is on) to receive the data in parallel

2024-01-08

  1. Added independent I2C interface class objects (I2CDevice) and SPI interface class objects (SPIDevice)
  2. Added new demo file demo.py to demonstrate the usage of classes added above (simplified code)
  3. Added device lock to make thread safe

2023-08-06

  1. Now with fully compatible I2C support, I2C clock speed level: 0 -> 20KHz, 1 -> 100KHz, 2 -> 400KHz, 3 -> 750KHz
  2. Added test.py for demonstration

Metadata

Release files for ch347api 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ch347api 0.3.2
File Size Uploaded Provenance
ch347api-0.3.2.tar.gz 11.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ch347api 0.3.2
File Interpreter ABI Platform
ch347api-0.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 25.9 kB

Release files / ch347api-0.3.2.tar.gz

Download URL ch347api-0.3.2.tar.gz
Size 11.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c826780c15ea2db55e5f30d02a11b09dae37eb53f1d54e69140a336e6d6b3035
BLAKE2b-256 checksum
How to use checksums
f1b6dd2de1c15c73e8df161e90b71ce32f0b45767f525c7c8853e261f77b7e6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.7.9

Release files / ch347api-0.3.2-py3-none-any.whl

Download URL ch347api-0.3.2-py3-none-any.whl
Size 14.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a4dc81ceeb3eef282fe11dfbf7dee7d2d18ae7d3f90421a02695b67bee16cec3
BLAKE2b-256 checksum
How to use checksums
3c1707d9cbb5ade53b739bbcc29fad9695b472bc6ca18944bb320b34aa6518b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.7.9

Security for ch347api 0.3.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page