6 #ifndef IOA_PLATFORMDETERMINATIONWIRE_H
7 #define IOA_PLATFORMDETERMINATIONWIRE_H
9 #include "PlatformDetermination.h"
10 #include <SimpleSpinLock.h>
17 typedef I2C* WireType;
18 void ioaWireBegin(I2C* pI2cToUse);
19 # define IOA_USE_MBED_WIRE
20 #elif defined(IOA_USE_AVR_TWI_DIRECT) && defined(__AVR__) && defined(IOA_DEVELOPMENT_EXPERIMENTAL)
22 typedef AvrTwiManager* WireType;
23 extern WireType AvrTwi;
25 #elif defined(BUILD_FOR_PICO_CMAKE)
26 #define IOA_USE_PICOSDK_I2C
27 #include "pico/i2cWrapper.h"
29 typedef PicoI2cWrapper* WireType;
30 void ioaWireBegin(i2c_inst_t* toUse);
32 # define IOA_USE_ARDUINO_WIRE
34 typedef TwoWire* WireType;
38 extern WireType defaultWireTypePtr;
47 bool ioaWireRead(WireType wire,
int address, uint8_t* buffer,
size_t len);
61 bool ioaWireWriteWithRetry(WireType pI2c,
int address,
const uint8_t* buffer,
size_t len,
int retriesAllowed = 0,
bool sendStop =
true);
68 void ioaWireSetSpeed(WireType pI2c,
long frequency);
75 bool ioaWireReady(WireType wire,
int address);
81 extern SimpleSpinLock i2cLock;