From 4d40c33c0b61e4e4ef829e26c0082e95d547cd72 Mon Sep 17 00:00:00 2001 From: rob tillaart Date: Sat, 4 Feb 2023 14:40:35 +0100 Subject: [PATCH] 0.1.3 MCP23008 --- .../.github/workflows/arduino-lint.yml | 2 +- .../.github/workflows/arduino_test_runner.yml | 2 +- .../MCP23008/.github/workflows/jsoncheck.yml | 2 +- libraries/MCP23008/CHANGELOG.md | 8 +++++++- libraries/MCP23008/LICENSE | 2 +- libraries/MCP23008/MCP23008.cpp | 12 +++++------ libraries/MCP23008/MCP23008.h | 8 ++++---- libraries/MCP23008/README.md | 20 +++++++++++++++++++ libraries/MCP23008/library.json | 2 +- libraries/MCP23008/library.properties | 2 +- libraries/MCP23008/test/unit_test_001.cpp | 12 ++++++----- 11 files changed, 50 insertions(+), 22 deletions(-) diff --git a/libraries/MCP23008/.github/workflows/arduino-lint.yml b/libraries/MCP23008/.github/workflows/arduino-lint.yml index b2ca058c..8a26f14a 100644 --- a/libraries/MCP23008/.github/workflows/arduino-lint.yml +++ b/libraries/MCP23008/.github/workflows/arduino-lint.yml @@ -6,7 +6,7 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: arduino/arduino-lint-action@v1 with: library-manager: update diff --git a/libraries/MCP23008/.github/workflows/arduino_test_runner.yml b/libraries/MCP23008/.github/workflows/arduino_test_runner.yml index 096b975b..fadfa904 100644 --- a/libraries/MCP23008/.github/workflows/arduino_test_runner.yml +++ b/libraries/MCP23008/.github/workflows/arduino_test_runner.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ruby/setup-ruby@v1 with: ruby-version: 2.6 diff --git a/libraries/MCP23008/.github/workflows/jsoncheck.yml b/libraries/MCP23008/.github/workflows/jsoncheck.yml index 04603d08..37a11298 100644 --- a/libraries/MCP23008/.github/workflows/jsoncheck.yml +++ b/libraries/MCP23008/.github/workflows/jsoncheck.yml @@ -10,7 +10,7 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: json-syntax-check uses: limitusus/json-syntax-check@v1 with: diff --git a/libraries/MCP23008/CHANGELOG.md b/libraries/MCP23008/CHANGELOG.md index d5d8c5ae..2f304dda 100644 --- a/libraries/MCP23008/CHANGELOG.md +++ b/libraries/MCP23008/CHANGELOG.md @@ -6,13 +6,19 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [0.1.3] - 2023-02-04 +- update readme.md +- update GitHub actions +- update license 2023 +- minor edits + + ## [0.1.2] - 2022-11-17 - add RP2040 in build-CI - add changelog.md - minor edit readme.md - update datasheet page numbers of registers MCP23008.cpp - ## [0.1.1] - 2022-09-28 - optimize digitalWrite() - as that is the most used one diff --git a/libraries/MCP23008/LICENSE b/libraries/MCP23008/LICENSE index cb502675..7ff52579 100644 --- a/libraries/MCP23008/LICENSE +++ b/libraries/MCP23008/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2022-2022 Rob Tillaart +Copyright (c) 2022-2023 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 diff --git a/libraries/MCP23008/MCP23008.cpp b/libraries/MCP23008/MCP23008.cpp index dd083fd2..3d064461 100644 --- a/libraries/MCP23008/MCP23008.cpp +++ b/libraries/MCP23008/MCP23008.cpp @@ -1,7 +1,7 @@ // // FILE: MCP23008.cpp // AUTHOR: Rob Tillaart -// VERSION: 0.1.2 +// VERSION: 0.1.3 // PURPOSE: Arduino library for I2C MCP23008 8 channel port expander // DATE: 2019-10-12 // URL: https://github.com/RobTillaart/MCP23008 @@ -97,7 +97,7 @@ bool MCP23008::pinMode(uint8_t pin, uint8_t mode) return false; } uint8_t mask = 1 << pin; - // only work with valid + // only work with valid if ((mode == INPUT) || (mode == INPUT_PULLUP)) { val |= mask; @@ -106,7 +106,7 @@ bool MCP23008::pinMode(uint8_t pin, uint8_t mode) { val &= ~mask; } - // other values won't change val .... + // other values won't change val .... writeReg(dataDirectionRegister, val); if (_error != MCP23008_OK) { @@ -362,8 +362,8 @@ int MCP23008::lastError() //////////////////////////////////////////////////// // -// PRIVATE -// +// PRIVATE +// bool MCP23008::writeReg(uint8_t reg, uint8_t value) { @@ -403,5 +403,5 @@ uint8_t MCP23008::readReg(uint8_t reg) } -// -- END OF FILE -- +// -- END OF FILE -- diff --git a/libraries/MCP23008/MCP23008.h b/libraries/MCP23008/MCP23008.h index 1552467a..1974cd2f 100644 --- a/libraries/MCP23008/MCP23008.h +++ b/libraries/MCP23008/MCP23008.h @@ -2,8 +2,8 @@ // // FILE: MCP23008.h // AUTHOR: Rob Tillaart -// VERSION: 0.1.2 -// PURPOSE: Arduino library for I2C MCP23008 16 channel port expander +// VERSION: 0.1.3 +// PURPOSE: Arduino library for I2C MCP23008 8 channel port expander // DATE: 2022-01-10 // URL: https://github.com/RobTillaart/MCP23008 @@ -12,7 +12,7 @@ #include "Wire.h" -#define MCP23008_LIB_VERSION (F("0.1.2")) +#define MCP23008_LIB_VERSION (F("0.1.3")) #define MCP23008_OK 0x00 #define MCP23008_PIN_ERROR 0x81 @@ -72,5 +72,5 @@ private: }; -// -- END OF FILE -- +// -- END OF FILE -- diff --git a/libraries/MCP23008/README.md b/libraries/MCP23008/README.md index d18531ec..eac9bc19 100644 --- a/libraries/MCP23008/README.md +++ b/libraries/MCP23008/README.md @@ -22,8 +22,28 @@ Since 0.1.1 the **digitalWrite(pin, value)** is optimized. If a pin is not changed it will not be written again to save time. +#### Related + +16 bit port expanders + +- https://github.com/RobTillaart/MCP23017_RT +- https://github.com/RobTillaart/MCP23S17 +- https://github.com/RobTillaart/PCF8575 + + +8 bit port expanders + +- https://github.com/RobTillaart/MCP23008 +- https://github.com/RobTillaart/MCP23S08 +- https://github.com/RobTillaart/PCF8574 + + ## Interface +```cpp +#include "MCP23008.h" +``` + ### Constructor - **MCP23008(uint8_t address, TwoWire \*wire = &Wire)** constructor, with default Wire interface. diff --git a/libraries/MCP23008/library.json b/libraries/MCP23008/library.json index be9a4e87..fcf43ef8 100644 --- a/libraries/MCP23008/library.json +++ b/libraries/MCP23008/library.json @@ -15,7 +15,7 @@ "type": "git", "url": "https://github.com/RobTillaart/MCP23008.git" }, - "version": "0.1.2", + "version": "0.1.3", "license": "MIT", "frameworks": "arduino", "platforms": "*", diff --git a/libraries/MCP23008/library.properties b/libraries/MCP23008/library.properties index abe50ae5..6b1bdc53 100644 --- a/libraries/MCP23008/library.properties +++ b/libraries/MCP23008/library.properties @@ -1,5 +1,5 @@ name=MCP23008 -version=0.1.2 +version=0.1.3 author=Rob Tillaart maintainer=Rob Tillaart sentence=Arduino library for I2C MCP23008 8 channel port expander 8 IO-lines diff --git a/libraries/MCP23008/test/unit_test_001.cpp b/libraries/MCP23008/test/unit_test_001.cpp index dece2d06..1c8f5eb0 100644 --- a/libraries/MCP23008/test/unit_test_001.cpp +++ b/libraries/MCP23008/test/unit_test_001.cpp @@ -58,7 +58,7 @@ unittest(test_constants) } -// TODO more tests if godmode->wire works +// TODO more tests if godmode->wire works unittest(test_constructor) { Wire.resetMocks(); @@ -67,7 +67,7 @@ unittest(test_constructor) assertFalse(Wire.didBegin()); MCP.begin(); - // in fact invalid ... + // in fact invalid ... assertTrue(Wire.didBegin()); assertTrue(MCP.isConnected()); } @@ -81,7 +81,7 @@ unittest(test_lastError) MCP.begin(); assertEqual(MCP23008_OK, MCP.lastError()); - // MCP23008_PIN_ERROR + // MCP23008_PIN_ERROR MCP.pinMode(8, INPUT); assertEqual(MCP23008_PIN_ERROR, MCP.lastError()); assertEqual(MCP23008_OK, MCP.lastError()); @@ -95,7 +95,7 @@ unittest(test_lastError) assertEqual(MCP23008_OK, MCP.lastError()); - // MCP23008_VALUE_ERROR - 3 is not INPUT, INPUT_PULLUP, OUTPUT) + // MCP23008_VALUE_ERROR - 3 is not INPUT, INPUT_PULLUP, OUTPUT) MCP.pinMode(0, 3); assertEqual(MCP23008_VALUE_ERROR, MCP.lastError()); assertEqual(MCP23008_OK, MCP.lastError()); @@ -104,4 +104,6 @@ unittest(test_lastError) unittest_main() -// -------- + +// --END OF FILE -- +