From d4a496c176e814767bfaccbcfb6f279034f469ba Mon Sep 17 00:00:00 2001 From: Rob Tillaart Date: Sat, 20 Jan 2024 14:15:11 +0100 Subject: [PATCH] 0.5.0 MCP23S08 --- libraries/MCP23S08/CHANGELOG.md | 7 ++++++- libraries/MCP23S08/MCP23S08.cpp | 6 +++--- libraries/MCP23S08/MCP23S08.h | 4 ++-- libraries/MCP23S08/README.md | 7 +++++++ .../examples/MCP23S08_digitalRead/MCP23S08_digitalRead.ino | 2 +- .../MCP23S08_digitalWrite/MCP23S08_digitalWrite.ino | 2 +- .../examples/MCP23S08_performance/MCP23S08_performance.ino | 2 +- libraries/MCP23S08/library.json | 2 +- libraries/MCP23S08/library.properties | 2 +- 9 files changed, 23 insertions(+), 11 deletions(-) diff --git a/libraries/MCP23S08/CHANGELOG.md b/libraries/MCP23S08/CHANGELOG.md index 368c076b..b84a2806 100644 --- a/libraries/MCP23S08/CHANGELOG.md +++ b/libraries/MCP23S08/CHANGELOG.md @@ -6,11 +6,16 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [0.5.0] - 2024-01-20 +- Fix #14, improve handling SPI dependency. +- update examples + +---- + ## [0.4.1] - 2024-01-05 - Fix URL in examples - minor edits - ## [0.4.0] - 2023-12-01 - Fix #30, support for Arduino ESP32 S3 - breaking change - update readme.md diff --git a/libraries/MCP23S08/MCP23S08.cpp b/libraries/MCP23S08/MCP23S08.cpp index 7b8360f9..6084af24 100644 --- a/libraries/MCP23S08/MCP23S08.cpp +++ b/libraries/MCP23S08/MCP23S08.cpp @@ -1,7 +1,7 @@ // // FILE: MCP23S08.cpp // AUTHOR: Rob Tillaart -// VERSION: 0.3.1 +// VERSION: 0.5.0 // PURPOSE: Arduino library for SPI MCP23S08 8 channel port expander // DATE: 2022-01-10 // URL: https://github.com/RobTillaart/MCP23S08 @@ -51,8 +51,8 @@ bool MCP23S08::begin() if (_hwSPI) { - _mySPI->end(); - _mySPI->begin(); + // _mySPI->end(); + // _mySPI->begin(); } else { diff --git a/libraries/MCP23S08/MCP23S08.h b/libraries/MCP23S08/MCP23S08.h index 7bfbaa4a..2b371a5b 100644 --- a/libraries/MCP23S08/MCP23S08.h +++ b/libraries/MCP23S08/MCP23S08.h @@ -2,7 +2,7 @@ // // FILE: MCP23S08.h // AUTHOR: Rob Tillaart -// VERSION: 0.4.1 +// VERSION: 0.5.0 // PURPOSE: Arduino library for SPI MCP23S08 8 channel port expander // DATE: 2022-01-10 // URL: https://github.com/RobTillaart/MCP23S08 @@ -13,7 +13,7 @@ #include "MCP23S08_registers.h" -#define MCP23S08_LIB_VERSION (F("0.4.1")) +#define MCP23S08_LIB_VERSION (F("0.5.0")) // ERROR CODES #define MCP23S08_OK 0x00 diff --git a/libraries/MCP23S08/README.md b/libraries/MCP23S08/README.md index 4d69cc38..47595389 100644 --- a/libraries/MCP23S08/README.md +++ b/libraries/MCP23S08/README.md @@ -25,6 +25,13 @@ The **write1(pin, value)** is optimized. If a pin is not changed it will not be written again to save time. +#### 0.5.0 Breaking change + +Version 0.5.0 introduced a breaking change to improve handling the SPI dependency. +The user has to call **SPI.begin()** or equivalent before calling **MCP.begin()**. +Optionally the user can provide parameters to the **SPI.begin(...)** + + #### 0.4.0 Breaking change The version 0.4.0 has breaking changes in the interface. diff --git a/libraries/MCP23S08/examples/MCP23S08_digitalRead/MCP23S08_digitalRead.ino b/libraries/MCP23S08/examples/MCP23S08_digitalRead/MCP23S08_digitalRead.ino index 4d283a45..5fd9ce49 100644 --- a/libraries/MCP23S08/examples/MCP23S08_digitalRead/MCP23S08_digitalRead.ino +++ b/libraries/MCP23S08/examples/MCP23S08_digitalRead/MCP23S08_digitalRead.ino @@ -1,7 +1,6 @@ // // FILE: MCP23S08_digitalRead.ino // AUTHOR: Rob Tillaart -// DATE: 2021-12-30 // PURPOSE: test MCP23S08 library // URL: https://github.com/RobTillaart/MCP23S08 @@ -23,6 +22,7 @@ void setup() delay(100); SPI.begin(); + rv = MCP.begin(); Serial.println(rv); diff --git a/libraries/MCP23S08/examples/MCP23S08_digitalWrite/MCP23S08_digitalWrite.ino b/libraries/MCP23S08/examples/MCP23S08_digitalWrite/MCP23S08_digitalWrite.ino index 286815b1..2601ebf8 100644 --- a/libraries/MCP23S08/examples/MCP23S08_digitalWrite/MCP23S08_digitalWrite.ino +++ b/libraries/MCP23S08/examples/MCP23S08_digitalWrite/MCP23S08_digitalWrite.ino @@ -1,7 +1,6 @@ // // FILE: MCP23S08_digitalWrite.ino // AUTHOR: Rob Tillaart -// DATE: 2021-12-30 // PURPOSE: test MCP23S08 library // URL: https://github.com/RobTillaart/MCP23S08 @@ -22,6 +21,7 @@ void setup() delay(100); SPI.begin(); + bool b = MCP.begin(); Serial.print("BEGIN: "); Serial.println(b ? "true" : "false"); diff --git a/libraries/MCP23S08/examples/MCP23S08_performance/MCP23S08_performance.ino b/libraries/MCP23S08/examples/MCP23S08_performance/MCP23S08_performance.ino index 3047023c..d1507a9f 100644 --- a/libraries/MCP23S08/examples/MCP23S08_performance/MCP23S08_performance.ino +++ b/libraries/MCP23S08/examples/MCP23S08_performance/MCP23S08_performance.ino @@ -1,7 +1,6 @@ // // FILE: MCP23S08_performance.ino // AUTHOR: Rob Tillaart -// DATE: 2021-12-30 // PURPOSE: test MCP23S08 library // URL: https://github.com/RobTillaart/MCP23S08 @@ -25,6 +24,7 @@ void setup() delay(100); SPI.begin(); + bool b = MCP.begin(); Serial.print("BEGIN: "); Serial.println(b); diff --git a/libraries/MCP23S08/library.json b/libraries/MCP23S08/library.json index 01aaed8b..f7c6b3b6 100644 --- a/libraries/MCP23S08/library.json +++ b/libraries/MCP23S08/library.json @@ -15,7 +15,7 @@ "type": "git", "url": "https://github.com/RobTillaart/MCP23S08.git" }, - "version": "0.4.1", + "version": "0.5.0", "license": "MIT", "frameworks": "*", "platforms": "*", diff --git a/libraries/MCP23S08/library.properties b/libraries/MCP23S08/library.properties index bf4d9dcd..8938816e 100644 --- a/libraries/MCP23S08/library.properties +++ b/libraries/MCP23S08/library.properties @@ -1,5 +1,5 @@ name=MCP23S08 -version=0.4.1 +version=0.5.0 author=Rob Tillaart maintainer=Rob Tillaart sentence=Arduino library for SPI MCP23S08 8 channel port expander 8 IO-lines