Skip to content

Commit

Permalink
Fix #14, improve SPI dependency (#15)
Browse files Browse the repository at this point in the history
- Fix #14, improve handling SPI dependency.
- update examples
  • Loading branch information
RobTillaart authored Jan 20, 2024
1 parent e30bdd4 commit 66c805f
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 11 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions MCP23S08.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -51,8 +51,8 @@ bool MCP23S08::begin()

if (_hwSPI)
{
_mySPI->end();
_mySPI->begin();
// _mySPI->end();
// _mySPI->begin();
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions MCP23S08.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion examples/MCP23S08_digitalRead/MCP23S08_digitalRead.ino
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -23,6 +22,7 @@ void setup()
delay(100);

SPI.begin();

rv = MCP.begin();
Serial.println(rv);

Expand Down
2 changes: 1 addition & 1 deletion examples/MCP23S08_digitalWrite/MCP23S08_digitalWrite.ino
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -22,6 +21,7 @@ void setup()
delay(100);

SPI.begin();

bool b = MCP.begin();
Serial.print("BEGIN: ");
Serial.println(b ? "true" : "false");
Expand Down
2 changes: 1 addition & 1 deletion examples/MCP23S08_performance/MCP23S08_performance.ino
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -25,6 +24,7 @@ void setup()
delay(100);

SPI.begin();

bool b = MCP.begin();
Serial.print("BEGIN: ");
Serial.println(b);
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "*",
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=MCP23S08
version=0.4.1
version=0.5.0
author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=Arduino library for SPI MCP23S08 8 channel port expander 8 IO-lines
Expand Down

0 comments on commit 66c805f

Please sign in to comment.