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:
pw_i2c_linux for Linux userspace.
pw_i2c_mcuxpresso for the NXP MCUXpresso SDK.
pw_i2c_rp2040 for the Raspberry Pi Pico SDK.
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 ofpw_i2c_rp2040
.In your build system, take a dependency on the
pw_i2c
API headers. See Quickstart for build system configuration examples.