diff --git a/library.json b/library.json index 1c69c8d..9ba4602 100644 --- a/library.json +++ b/library.json @@ -6,7 +6,7 @@ "type": "git", "url": "https://github.com/firmata/ConfigurableFirmata.git" }, - "version": "3.1.0", + "version": "3.2.0", "exclude": [ "extras", "test" diff --git a/library.properties b/library.properties index fe1b2b5..9b9f5d8 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=ConfigurableFirmata -version=3.1.0 +version=3.2.0 author=Firmata Developers maintainer=https://github.com/firmata/ConfigurableFirmata sentence=This library implements the Firmata protocol as a set of plugins that can be used to create applications to remotely interface with an Arduino board. diff --git a/src/ConfigurableFirmata.h b/src/ConfigurableFirmata.h index c20d4a8..332b5bc 100644 --- a/src/ConfigurableFirmata.h +++ b/src/ConfigurableFirmata.h @@ -32,7 +32,7 @@ * Query using the REPORT_FIRMWARE message. */ #define FIRMATA_FIRMWARE_MAJOR_VERSION 3 // for non-compatible changes -#define FIRMATA_FIRMWARE_MINOR_VERSION 1 // for backwards compatible changes +#define FIRMATA_FIRMWARE_MINOR_VERSION 2 // for backwards compatible changes #define FIRMATA_FIRMWARE_BUGFIX_VERSION 0 // for bugfix releases #ifdef LARGE_MEM_DEVICE diff --git a/src/I2CFirmata.h b/src/I2CFirmata.h index f948665..5d876a8 100644 --- a/src/I2CFirmata.h +++ b/src/I2CFirmata.h @@ -26,14 +26,14 @@ #include "FirmataFeature.h" #include "FirmataReporting.h" -#define I2C_WRITE B00000000 -#define I2C_READ B00001000 -#define I2C_READ_CONTINUOUSLY B00010000 -#define I2C_STOP_READING B00011000 -#define I2C_READ_WRITE_MODE_MASK B00011000 -#define I2C_10BIT_ADDRESS_MODE_MASK B00100000 -#define I2C_END_TX_MASK B01000000 -#define I2C_10BIT_ADDRESS_MASK B00000111 +#define I2C_WRITE 0B00000000 +#define I2C_READ 0B00001000 +#define I2C_READ_CONTINUOUSLY 0B00010000 +#define I2C_STOP_READING 0B00011000 +#define I2C_READ_WRITE_MODE_MASK 0B00011000 +#define I2C_10BIT_ADDRESS_MODE_MASK 0B00100000 +#define I2C_END_TX_MASK 0B01000000 +#define I2C_10BIT_ADDRESS_MASK 0B00000111 #define I2C_STOP_TX 1 #define I2C_RESTART_TX 0 #define I2C_MAX_QUERIES 8 diff --git a/src/utility/Boards.h b/src/utility/Boards.h index 352c318..960d32f 100644 --- a/src/utility/Boards.h +++ b/src/utility/Boards.h @@ -134,6 +134,7 @@ writePort(port, value, bitmask): Write an 8 bit port. #define digitalPinHasPWM(p) IS_PIN_DIGITAL(p) #endif +#undef IS_PIN_INTERRUPT #if defined(digitalPinToInterrupt) && defined(NOT_AN_INTERRUPT) #define IS_PIN_INTERRUPT(p) (digitalPinToInterrupt(p) > NOT_AN_INTERRUPT) #else @@ -797,6 +798,30 @@ static inline void attachInterrupt(pin_size_t interruptNumber, voidFuncPtr callb #define PIN_TO_PWM(p) (p) #define PIN_TO_SERVO(p) (p) +// Arduino UNO R4 Minima and Wifi +// The pinout is the same as for the classical UNO R3 +#elif defined(ARDUINO_UNOR4_MINIMA) || defined(ARDUINO_UNOR4_WIFI) +#if defined(NUM_ANALOG_INPUTS) && NUM_ANALOG_INPUTS == 6 +#define TOTAL_ANALOG_PINS 6 +#define TOTAL_PINS 20 // 14 digital + 6 analog +#else +#define TOTAL_ANALOG_PINS 8 +#define TOTAL_PINS 22 // 14 digital + 8 analog +#endif +// These have conflicting(?) definitions in the core for this CPU +#undef IS_PIN_PWM +#undef IS_PIN_ANALOG +#define VERSION_BLINK_PIN 13 +#define IS_PIN_DIGITAL(p) ((p) >= 2 && (p) <= 19) +#define IS_PIN_ANALOG(p) ((p) >= 14 && (p) < 14 + TOTAL_ANALOG_PINS) +#define IS_PIN_PWM(p) digitalPinHasPWM(p) +#define IS_PIN_SERVO(p) (IS_PIN_DIGITAL(p) && (p) - 2 < MAX_SERVOS) +#define IS_PIN_I2C(p) ((p) == 18 || (p) == 19) +#define IS_PIN_SPI(p) ((p) == SS || (p) == MOSI || (p) == MISO || (p) == SCK) +#define PIN_TO_DIGITAL(p) (p) +#define PIN_TO_ANALOG(p) ((p) - 14) +#define PIN_TO_PWM(p) PIN_TO_DIGITAL(p) +#define PIN_TO_SERVO(p) ((p) - 2) // anything else #else