Skip to content

Commit

Permalink
Fix URL examples + minor edits (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
RobTillaart authored Jan 5, 2024
1 parent 9b8e47b commit e30bdd4
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 15 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).


## [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
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022-2023 Rob Tillaart
Copyright (c) 2022-2024 Rob Tillaart

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion 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.0
// VERSION: 0.3.1
// PURPOSE: Arduino library for SPI MCP23S08 8 channel port expander
// DATE: 2022-01-10
// URL: https://github.com/RobTillaart/MCP23S08
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.0
// VERSION: 0.4.1
// 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.0"))
#define MCP23S08_LIB_VERSION (F("0.4.1"))

// ERROR CODES
#define MCP23S08_OK 0x00
Expand Down
6 changes: 3 additions & 3 deletions examples/MCP23S08_digitalRead/MCP23S08_digitalRead.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
// FILE: MCP23S08_digitalRead.ino
// AUTHOR: Rob Tillaart
// DATE: 2021-12-30
// PUPROSE: test MCP23017 library
// PURPOSE: test MCP23S08 library
// URL: https://github.com/RobTillaart/MCP23S08


#include "MCP23S08.h"
#include "SPI.h"


MCP23S08 MCP(10);
Expand All @@ -26,7 +26,7 @@ void setup()
rv = MCP.begin();
Serial.println(rv);

rv = MCP.pinMode8(0xFF); // CHECK
rv = MCP.pinMode8(0xFF); // CHECK
Serial.println(rv);


Expand Down
5 changes: 3 additions & 2 deletions examples/MCP23S08_digitalWrite/MCP23S08_digitalWrite.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
// FILE: MCP23S08_digitalWrite.ino
// AUTHOR: Rob Tillaart
// DATE: 2021-12-30
// PUPROSE: test MCP23017 library
// PURPOSE: test MCP23S08 library
// URL: https://github.com/RobTillaart/MCP23S08


#include "MCP23S08.h"
#include "SPI.h"


MCP23S08 MCP(10, 5, 6, 7); // SW SPI address 0x00

Expand Down
9 changes: 5 additions & 4 deletions examples/MCP23S08_performance/MCP23S08_performance.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
// FILE: MCP23S08_performance.ino
// AUTHOR: Rob Tillaart
// DATE: 2021-12-30
// PUPROSE: test MCP23017 library
// PURPOSE: test MCP23S08 library
// URL: https://github.com/RobTillaart/MCP23S08


#include "MCP23S08.h"
#include "SPI.h"


// MCP23S08 MCP(10, 12, 11, 13); // SW SPI address 0x00
MCP23S08 MCP(10); // HW SPI address 0x00
Expand Down Expand Up @@ -42,7 +43,7 @@ void setup()
start = micros();
for (int i = 0; i < 8; i++)
{
MCP.write1(0, i & 0x01); // alternating HIGH/LOW
MCP.write1(0, i & 0x01); // alternating HIGH/LOW
}
stop = micros();
Serial.println((stop - start) / 8.0);
Expand Down Expand Up @@ -103,4 +104,4 @@ void loop()
}


// -- END OF FILE --
// -- END OF FILE --
32 changes: 32 additions & 0 deletions examples/MCP23S08_performance/performance_0.4.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@


# Performance test

Test sketch MCP23S08_performance.ino

Max clock frequency 10 MHz, for an UNO this is 8 MHz (divider of CPU clock)

### Library version: 0.4.1


| Action | SW SPI | HW 1 MHz | HW 2 MHz | HW 4 MHz | HW 8 MHz |
|:-------------------------|--------:|---------:|---------:|---------:|---------:|
| TEST write1(0, value) | xx.xx | xx.xx | xx.xx | xx.xx | 35.50 |
| TEST write1(pin, value) | xx.xx | xx.xx | xx.xx | xx.xx | 35.50 |
| TEST read1(pin) | xx.xx | xx.xx | xx.xx | xx.xx | 24.50 |
| | | | | | |
| TEST write8(port, mask) | xx.xx | xx.xx | xx.xx | xx.xx | 28.00 |
| TEST read8(port) | xx.xx | xx.xx | xx.xx | xx.xx | 24.00 |


### Notes

Performance as expected, no showstoppers.


### Future

- test ESP32 and other platforms
- register based IO version for the SW SPI on AVR ?


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.0",
"version": "0.4.1",
"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.0
version=0.4.1
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 e30bdd4

Please sign in to comment.