linux-wire is a minimal Linux-native I2C abstraction that mirrors Arduino's Wire API. It ships a tiny C shim over /dev/i2c-* plus a TwoWire C++ class so Arduino-style sketches can run on Raspberry Pi-class systems without heavyweight dependencies.
cmake --preset dev
cmake --build --preset dev
ctest --preset devOther canonical builds:
# optimized full build
cmake --preset release
cmake --build --preset release
ctest --preset release
# lean consumer-style build
cmake --preset minimal
cmake --build --preset minimalUse cmake --install build/dev to install the default preset build, or pass --prefix as needed. Downstream CMake projects can then find_package(linux_wire CONFIG REQUIRED) and link against linux_wire::linux_wire.
Presets require CMake 3.20 or newer. If you are on an older CMake, the raw cmake -S . -B build flow remains supported as a fallback.
Example binaries for the default contributor build live under build/dev/ after compiling.
- Docs index – architecture overview, API examples, CI info
- API reference – detailed class and method documentation
- Testing guide – running mock-based unit tests and suggested hardware validation steps
- Arduino companion – ready-made Nano sketch for loopback testing
GPL-3.0-or-later. See LICENSE.