diff --git a/cores/arduino/mbed-bridge b/cores/arduino/mbed-bridge index 63a8d6b3..42f0e69e 160000 --- a/cores/arduino/mbed-bridge +++ b/cores/arduino/mbed-bridge @@ -1 +1 @@ -Subproject commit 63a8d6b3d8f57999b7af867ceb93a6f7367ca12a +Subproject commit 42f0e69e2eab69e98b62b9a97d9b7fd934c7ca4e diff --git a/libraries/Apollo3/examples/Example1_DigitalWrite/Example1_DigitalWrite.ino b/libraries/Apollo3/examples/Example01_DigitalWrite/Example01_DigitalWrite.ino similarity index 100% rename from libraries/Apollo3/examples/Example1_DigitalWrite/Example1_DigitalWrite.ino rename to libraries/Apollo3/examples/Example01_DigitalWrite/Example01_DigitalWrite.ino diff --git a/libraries/Apollo3/examples/Example2_AnalogRead/Example2_AnalogRead.ino b/libraries/Apollo3/examples/Example02_AnalogRead/Example02_AnalogRead.ino similarity index 100% rename from libraries/Apollo3/examples/Example2_AnalogRead/Example2_AnalogRead.ino rename to libraries/Apollo3/examples/Example02_AnalogRead/Example02_AnalogRead.ino diff --git a/libraries/Apollo3/examples/Example3_AnalogWrite/Example3_AnalogWrite.ino b/libraries/Apollo3/examples/Example03_AnalogWrite/Example03_AnalogWrite.ino similarity index 100% rename from libraries/Apollo3/examples/Example3_AnalogWrite/Example3_AnalogWrite.ino rename to libraries/Apollo3/examples/Example03_AnalogWrite/Example03_AnalogWrite.ino diff --git a/libraries/Apollo3/examples/Example4_Serial/Example4_Serial.ino b/libraries/Apollo3/examples/Example04_Serial/Example04_Serial.ino similarity index 100% rename from libraries/Apollo3/examples/Example4_Serial/Example4_Serial.ino rename to libraries/Apollo3/examples/Example04_Serial/Example04_Serial.ino diff --git a/libraries/Apollo3/examples/Example5_Wire_I2C/Example5_Wire_I2C.ino b/libraries/Apollo3/examples/Example05_Wire_I2C/Example05_Wire_I2C.ino similarity index 100% rename from libraries/Apollo3/examples/Example5_Wire_I2C/Example5_Wire_I2C.ino rename to libraries/Apollo3/examples/Example05_Wire_I2C/Example05_Wire_I2C.ino diff --git a/libraries/Apollo3/examples/Example6_SPI/Example6_SPI.ino b/libraries/Apollo3/examples/Example06_SPI/Example06_SPI.ino similarity index 100% rename from libraries/Apollo3/examples/Example6_SPI/Example6_SPI.ino rename to libraries/Apollo3/examples/Example06_SPI/Example06_SPI.ino diff --git a/libraries/Apollo3/examples/Example7_Threads/Example7_Threads.ino b/libraries/Apollo3/examples/Example07_Threads/Example07_Threads.ino similarity index 100% rename from libraries/Apollo3/examples/Example7_Threads/Example7_Threads.ino rename to libraries/Apollo3/examples/Example07_Threads/Example07_Threads.ino diff --git a/libraries/Apollo3/examples/Example8_AttachInterrupt/Example8_AttachInterrupt.ino b/libraries/Apollo3/examples/Example08_AttachInterrupt/Example08_AttachInterrupt.ino similarity index 100% rename from libraries/Apollo3/examples/Example8_AttachInterrupt/Example8_AttachInterrupt.ino rename to libraries/Apollo3/examples/Example08_AttachInterrupt/Example08_AttachInterrupt.ino diff --git a/libraries/Apollo3/examples/Example9_DetachInterrupt/Example9_DetachInterrupt.ino b/libraries/Apollo3/examples/Example09_DetachInterrupt/Example09_DetachInterrupt.ino similarity index 100% rename from libraries/Apollo3/examples/Example9_DetachInterrupt/Example9_DetachInterrupt.ino rename to libraries/Apollo3/examples/Example09_DetachInterrupt/Example09_DetachInterrupt.ino diff --git a/libraries/SPI/src/SPI.h b/libraries/SPI/src/SPI.h index 2f1c7c60..93693966 100644 --- a/libraries/SPI/src/SPI.h +++ b/libraries/SPI/src/SPI.h @@ -7,7 +7,7 @@ #define _APOLLO3_LIBRARIES_SPI_H_ #include "Arduino.h" - +#include "core-api/api/HardwareSPI.h" #include "drivers/SPI.h" namespace arduino { diff --git a/libraries/Wire/src/Wire.cpp b/libraries/Wire/src/Wire.cpp index 3168014c..9a20e1b2 100644 --- a/libraries/Wire/src/Wire.cpp +++ b/libraries/Wire/src/Wire.cpp @@ -66,7 +66,7 @@ uint8_t arduino::MbedI2C::endTransmission(bool stopBit) { return 2; } -uint8_t arduino::MbedI2C::requestFrom(uint8_t address, size_t len, bool stopBit) { +size_t arduino::MbedI2C::requestFrom(uint8_t address, size_t len, bool stopBit) { char buf[256]; int ret = master->read(address << 1, buf, len, !stopBit); if (ret != 0) { @@ -78,7 +78,7 @@ uint8_t arduino::MbedI2C::requestFrom(uint8_t address, size_t len, bool stopBit) return len; } -uint8_t arduino::MbedI2C::requestFrom(uint8_t address, size_t len) { +size_t arduino::MbedI2C::requestFrom(uint8_t address, size_t len) { return requestFrom(address, len, true); } diff --git a/libraries/Wire/src/Wire.h b/libraries/Wire/src/Wire.h index 881571c0..8c9041d5 100644 --- a/libraries/Wire/src/Wire.h +++ b/libraries/Wire/src/Wire.h @@ -7,6 +7,7 @@ #define _APOLLO3_LIBRARIES_WIRE_H_ #include "Arduino.h" +#include "core-api/api/HardwareI2C.h" #include "drivers/I2C.h" #include "drivers/I2CSlave.h" #include "rtos.h" @@ -32,8 +33,8 @@ class MbedI2C : public HardwareI2C virtual uint8_t endTransmission(bool stopBit); virtual uint8_t endTransmission(void); - virtual uint8_t requestFrom(uint8_t address, size_t len, bool stopBit); - virtual uint8_t requestFrom(uint8_t address, size_t len); + virtual size_t requestFrom(uint8_t address, size_t len, bool stopBit); + virtual size_t requestFrom(uint8_t address, size_t len); virtual void onReceive(void(*)(int)); virtual void onRequest(void(*)(void)); diff --git a/variants/SFE_ARTEMIS_MODULE/variant.h b/variants/SFE_ARTEMIS_MODULE/variant.h index eb03d890..ced95960 100644 --- a/variants/SFE_ARTEMIS_MODULE/variant.h +++ b/variants/SFE_ARTEMIS_MODULE/variant.h @@ -10,7 +10,13 @@ #include "config/pins.h" -#define VARIANT_SPI_INTFCS 0 -#define VARIANT_WIRE_INTFCS 0 +#define VARIANT_SPI_INTFCS 0 +#define VARIANT_WIRE_INTFCS 1 + +// Add a default wire pin so that Wire is available to libraries and sketches +// Since this is just a module no pins are labeled I2C/Wire/Qwiic by default +// 2 pins have been chosen here arbitrarily +#define VARIANT_Wire_SDA 9 +#define VARIANT_Wire_SCL 8 #endif // _VARIANT_H_