From d1abfb5f75b3e6fb8771309b750d116c6c27d00a Mon Sep 17 00:00:00 2001 From: Renzo Date: Fri, 21 Sep 2018 11:36:04 +0200 Subject: [PATCH 1/4] Adding integration for Arduino SMT32 #8 --- PCF8574.cpp | 8 ++++---- PCF8574.h | 10 ++++++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/PCF8574.cpp b/PCF8574.cpp index 9a235b0..1813f7e 100644 --- a/PCF8574.cpp +++ b/PCF8574.cpp @@ -22,7 +22,7 @@ PCF8574::PCF8574(uint8_t address, uint8_t interruptPin, void (*interruptFunctio _usingInterrupt = true; }; -#ifndef __AVR +#if !defined(__AVR) && !defined(STM32F1) /** * Constructor * @param address: i2c address @@ -59,16 +59,16 @@ PCF8574::PCF8574(uint8_t address, uint8_t interruptPin, void (*interruptFunctio * wake up i2c controller */ void PCF8574::begin(){ - #ifndef __AVR + #if !defined(__AVR) && !defined(STM32F1) Wire.begin(_sda, _scl); #else - // Default pin for AVR some problem on software emulation + // Default pin for AVR and Arduino STM32 some problem on software emulation // #define SCL_PIN _scl // #define SDA_PIN _sda Wire.begin(); #endif - // Che if there are pins to set low + // Check if there are pins to set low if (writeMode>0 || readMode>0){ DEBUG_PRINTLN("Set write mode"); Wire.beginTransmission(_address); diff --git a/PCF8574.h b/PCF8574.h index 87036e4..449c7c4 100644 --- a/PCF8574.h +++ b/PCF8574.h @@ -91,8 +91,14 @@ public: private: uint8_t _address; - uint8_t _sda = SDA; - uint8_t _scl = SCL; + + #if !defined(__AVR) && !defined(STM32F1) + uint8_t _sda; + uint8_t _scl; + #else + uint8_t _sda = SDA; + uint8_t _scl = SCL; + #endif bool _usingInterrupt = false; uint8_t _interruptPin = 2; From f996b2945876549c0a783ff9b115d7a8f75bb836 Mon Sep 17 00:00:00 2001 From: Renzo Date: Sun, 23 Sep 2018 19:31:56 +0200 Subject: [PATCH 2/4] Fix SMT32 pathc --- PCF8574.cpp | 4 ++-- PCF8574.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/PCF8574.cpp b/PCF8574.cpp index 1813f7e..c6f6bf7 100644 --- a/PCF8574.cpp +++ b/PCF8574.cpp @@ -22,7 +22,7 @@ PCF8574::PCF8574(uint8_t address, uint8_t interruptPin, void (*interruptFunctio _usingInterrupt = true; }; -#if !defined(__AVR) && !defined(STM32F1) +#if !defined(__AVR) && !defined(__STM32F1__) /** * Constructor * @param address: i2c address @@ -59,7 +59,7 @@ PCF8574::PCF8574(uint8_t address, uint8_t interruptPin, void (*interruptFunctio * wake up i2c controller */ void PCF8574::begin(){ - #if !defined(__AVR) && !defined(STM32F1) + #if !defined(__AVR) && !defined(__STM32F1__) Wire.begin(_sda, _scl); #else // Default pin for AVR and Arduino STM32 some problem on software emulation diff --git a/PCF8574.h b/PCF8574.h index 449c7c4..0291908 100644 --- a/PCF8574.h +++ b/PCF8574.h @@ -92,7 +92,7 @@ public: private: uint8_t _address; - #if !defined(__AVR) && !defined(STM32F1) + #if defined(__AVR) || defined(__STM32F1__) uint8_t _sda; uint8_t _scl; #else From d86313e749e391014befeb155a628ad8914d1360 Mon Sep 17 00:00:00 2001 From: Renzo Mischianti Date: Sun, 27 Jan 2019 16:33:32 +0100 Subject: [PATCH 3/4] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index b9d7761..652cb66 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +You can find docoment update at www.mischianti.org + Library to use i2c analog IC with arduino and esp8266. Can read and write digital value with only 2 wire (perfect for ESP-01). Tutorial: From e23aa93d9f0f0ddad5b326d71541b2dd9dd20deb Mon Sep 17 00:00:00 2001 From: Renzo Mischianti Date: Sun, 24 Feb 2019 08:58:52 +0100 Subject: [PATCH 4/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 652cb66..86266f4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -You can find docoment update at www.mischianti.org +You can find document update at www.mischianti.org Library to use i2c analog IC with arduino and esp8266. Can read and write digital value with only 2 wire (perfect for ESP-01).