https://github.com/qqqlab/esp32_softwire
ESP32 fast bit-bang I2C library for Arduino, drop in replacement for Wire.h
https://github.com/qqqlab/esp32_softwire
arduino-library esp32 esp32-arduino i2c i2c-master
Last synced: about 1 month ago
JSON representation
ESP32 fast bit-bang I2C library for Arduino, drop in replacement for Wire.h
- Host: GitHub
- URL: https://github.com/qqqlab/esp32_softwire
- Owner: qqqlab
- License: mit
- Created: 2023-12-04T05:35:40.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-21T08:49:41.000Z (9 months ago)
- Last Synced: 2025-03-28T03:38:14.136Z (about 2 months ago)
- Topics: arduino-library, esp32, esp32-arduino, i2c, i2c-master
- Language: C++
- Homepage:
- Size: 46.9 KB
- Stars: 16
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ESP32_SoftWire
ESP32 fast bit-bang I2C library for Arduino, drop in replacement for Wire.h
The library reaches up to 3 MHz I2C clock speed. No fancy bits and bobs: no timeouts, no clock stretching, blocking only... Made for fast IMU sensor reading were an occasional missed read does not matter, but bus hangups do matter.
Tested on ESP32, probably works on ESP32-S3 and ESP32-C3, might work on other ESP32 variants.
Limitation: pins 0-31 only
## Background
As of December 2023 the official [arduino-esp32 Wire](https://github.com/espressif/arduino-esp32/tree/master/libraries/Wire) library has some nasty bugs. In particular, there is a *1 second* timeout which hangs the bus on a bad read, and this timeout can not be lowered without changing the source code, see https://github.com/espressif/esp-idf/issues/4999 and https://github.com/espressif/arduino-esp32/issues/5934. So occasionally (a couple times per minute) 1000 samples are missed when you are reading a sensor at 1 kHz.