Implementations#
pw_i2c: Cross-platform I2C API with interactive debugging
To use the pw_i2c API, you need to specify in your build system an
implementation of the pw_i2c virtual interface.
Existing implementations#
The following Pigweed modules are ready-made pw_i2c implementations that
you can use in your projects:
Name |
Status |
Description |
Languages |
|---|---|---|---|
stable |
Linux userspace implementation for pw_i2c |
C++ |
|
stable |
NXP MCUXpresso SDK implementation for pw_i2c |
C++ |
|
stable |
Raspberry Pi Pico SDK implementation for pw_i2c |
C++ |
|
experimental |
Zephyr implementation for pw_i2c |
See Quickstart for build system configuration examples.
Create your own implementation#
If the available implementations don’t meet your needs, you can create your own:
Note
pw_i2c_rp2040 uses the deprecated pw::i2c::Initiator API.
See pw_i2c_mcuxpresso and pw_i2c_mcuxpresso
for example implementations of DoTransferFor(span<Message>, ...).
Implement the pw::i2c::Initiator interface. See pw_i2c_rp2040 for an example Raspberry Pi Pico SDK implementation and common_pico.cc for example usage of
pw_i2c_rp2040.In your build system, take a dependency on the
pw_i2cAPI headers. See Quickstart for build system configuration examples.