# CH347-HIDAPI
**Repository Path**: lonerlin/CH347-HIDAPI
## Basic Information
- **Project Name**: CH347-HIDAPI
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2024-05-17
- **Last Updated**: 2024-05-17
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# CH347-HIDAPI Python Library
_+ [CH347-HIDAPI Github Page](https://github.com/i2cy/ch347-hidapi) +_
## 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](https://github.com/i2cy/CH347-HIDAPI/blob/master/demo.py).__
[CH347-Chip Official Site](https://www.wch.cn/products/CH347.html)
## 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