From 398210be46ddb6c2893f4d07c20a49addd6575f4 Mon Sep 17 00:00:00 2001 From: caternuson Date: Mon, 27 Sep 2021 11:26:21 -0700 Subject: [PATCH 1/6] update chunk --- Adafruit_I2CDevice.cpp | 66 +++++++++++++++--------------------------- library.properties | 2 +- 2 files changed, 25 insertions(+), 43 deletions(-) diff --git a/Adafruit_I2CDevice.cpp b/Adafruit_I2CDevice.cpp index 414880d..0e3622f 100644 --- a/Adafruit_I2CDevice.cpp +++ b/Adafruit_I2CDevice.cpp @@ -77,10 +77,19 @@ bool Adafruit_I2CDevice::detected(void) { bool Adafruit_I2CDevice::write(const uint8_t *buffer, size_t len, bool stop, const uint8_t *prefix_buffer, size_t prefix_len) { + if ((len + prefix_len) > maxBufferSize()) { + // currently not guaranteed to work if more than 32 bytes! + // we will need to find out if some platforms have larger + // I2C buffer sizes :/ +#ifdef DEBUG_SERIAL + DEBUG_SERIAL.println(F("\tI2CDevice could not write such a large buffer")); +#endif + return false; + } + _wire->beginTransmission(_addr); // Write the prefix data (usually an address) - // This is required to be less than _maxBufferSize, so no need to chunkify if ((prefix_len != 0) && (prefix_buffer != NULL)) { if (_wire->write(prefix_buffer, prefix_len) != prefix_len) { #ifdef DEBUG_SERIAL @@ -90,32 +99,14 @@ bool Adafruit_I2CDevice::write(const uint8_t *buffer, size_t len, bool stop, } } - // Write the data itself, chunkify if needed - size_t bufferSize = maxBufferSize(); - if (bufferSize >= len) { - // can just write - if (_wire->write(buffer, len) != len) { + // Write the data itself + if (_wire->write(buffer, len) != len) { #ifdef DEBUG_SERIAL - DEBUG_SERIAL.println(F("\tI2CDevice failed to write")); + DEBUG_SERIAL.println(F("\tI2CDevice failed to write")); #endif - return false; - } - } else { - // must chunkify - size_t pos = 0; - uint8_t write_buffer[bufferSize]; - while (pos < len) { - size_t write_len = len - pos > bufferSize ? bufferSize : len - pos; - for (size_t i = 0; i < write_len; i++) - write_buffer[i] = buffer[pos++]; - if (_wire->write(write_buffer, write_len) != write_len) { -#ifdef DEBUG_SERIAL - DEBUG_SERIAL.println(F("\tI2CDevice failed to write")); -#endif - return false; - } - } + return false; } + #ifdef DEBUG_SERIAL DEBUG_SERIAL.print(F("\tI2CWRITE @ 0x")); @@ -146,7 +137,7 @@ bool Adafruit_I2CDevice::write(const uint8_t *buffer, size_t len, bool stop, if (_wire->endTransmission(stop) == 0) { #ifdef DEBUG_SERIAL - DEBUG_SERIAL.println("Sent!"); + // DEBUG_SERIAL.println("Sent!"); #endif return true; } else { @@ -166,24 +157,15 @@ bool Adafruit_I2CDevice::write(const uint8_t *buffer, size_t len, bool stop, * @return True if read was successful, otherwise false. */ bool Adafruit_I2CDevice::read(uint8_t *buffer, size_t len, bool stop) { - size_t bufferSize = maxBufferSize(); - if (bufferSize >= len) { - // can just read - return _read(buffer, len, stop); - } else { - // must chunkify - size_t pos = 0; - uint8_t read_buffer[bufferSize]; - while (pos < len) { - size_t read_len = len - pos > bufferSize ? bufferSize : len - pos; - if (!_read(read_buffer, read_len, false)) { - return false; - } - for (size_t i = 0; i < read_len; i++) - buffer[pos++] = read_buffer[i]; - } - return true; + size_t pos = 0; + while (pos < len) { + size_t read_len = len - pos > maxBufferSize() ? maxBufferSize() : len - pos; + bool read_stop = pos < (len - read_len) ? false : stop; + if (!_read(buffer + pos, read_len, read_stop)) + return false; + pos += read_len; } + return true; } bool Adafruit_I2CDevice::_read(uint8_t *buffer, size_t len, bool stop) { diff --git a/library.properties b/library.properties index b9dbd20..9203197 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Adafruit BusIO -version=1.9.1 +version=1.9.2 author=Adafruit maintainer=Adafruit sentence=This is a library for abstracting away UART, I2C and SPI interfacing From 418887036ba721af167da0a329325650962e27b2 Mon Sep 17 00:00:00 2001 From: caternuson Date: Mon, 27 Sep 2021 12:04:14 -0700 Subject: [PATCH 2/6] add parens --- Adafruit_I2CDevice.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Adafruit_I2CDevice.cpp b/Adafruit_I2CDevice.cpp index 0e3622f..1f72dbd 100644 --- a/Adafruit_I2CDevice.cpp +++ b/Adafruit_I2CDevice.cpp @@ -159,8 +159,9 @@ bool Adafruit_I2CDevice::write(const uint8_t *buffer, size_t len, bool stop, bool Adafruit_I2CDevice::read(uint8_t *buffer, size_t len, bool stop) { size_t pos = 0; while (pos < len) { - size_t read_len = len - pos > maxBufferSize() ? maxBufferSize() : len - pos; - bool read_stop = pos < (len - read_len) ? false : stop; + size_t read_len = + ((len - pos) > maxBufferSize()) ? maxBufferSize() : (len - pos); + bool read_stop = (pos < (len - read_len)) ? false : stop; if (!_read(buffer + pos, read_len, read_stop)) return false; pos += read_len; From a819f24d00ca34541333eb7d6280b1187d6000a8 Mon Sep 17 00:00:00 2001 From: caternuson Date: Tue, 28 Sep 2021 12:15:40 -0700 Subject: [PATCH 3/6] fix spi preproc guards --- Adafruit_SPIDevice.cpp | 5 ++--- library.properties | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Adafruit_SPIDevice.cpp b/Adafruit_SPIDevice.cpp index f39627a..f560756 100644 --- a/Adafruit_SPIDevice.cpp +++ b/Adafruit_SPIDevice.cpp @@ -1,9 +1,8 @@ +#if (defined(SPI_INTERFACES_COUNT) && (SPI_INTERFACES_COUNT > 0)) + #include #include -#if !defined(SPI_INTERFACES_COUNT) || \ - (defined(SPI_INTERFACES_COUNT) && (SPI_INTERFACES_COUNT > 0)) - //#define DEBUG_SERIAL Serial /*! diff --git a/library.properties b/library.properties index 9203197..4e726a3 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Adafruit BusIO -version=1.9.2 +version=1.9.3 author=Adafruit maintainer=Adafruit sentence=This is a library for abstracting away UART, I2C and SPI interfacing From c6965bd471b8bca3d4084459008f1ef463a2b243 Mon Sep 17 00:00:00 2001 From: caternuson Date: Tue, 28 Sep 2021 14:31:23 -0700 Subject: [PATCH 4/6] selectively remove spi --- Adafruit_BusIO_Register.cpp | 13 ++++++++----- Adafruit_BusIO_Register.h | 7 ++++++- Adafruit_SPIDevice.cpp | 5 +++-- Adafruit_SPIDevice.h | 2 ++ 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/Adafruit_BusIO_Register.cpp b/Adafruit_BusIO_Register.cpp index f802525..bd42a54 100644 --- a/Adafruit_BusIO_Register.cpp +++ b/Adafruit_BusIO_Register.cpp @@ -1,8 +1,5 @@ #include -#if !defined(SPI_INTERFACES_COUNT) || \ - (defined(SPI_INTERFACES_COUNT) && (SPI_INTERFACES_COUNT > 0)) - /*! * @brief Create a register we access over an I2C Device (which defines the * bus and address) @@ -21,7 +18,9 @@ Adafruit_BusIO_Register::Adafruit_BusIO_Register(Adafruit_I2CDevice *i2cdevice, uint8_t byteorder, uint8_t address_width) { _i2cdevice = i2cdevice; +#ifdef HAS_SPI _spidevice = NULL; +#endif _addrwidth = address_width; _address = reg_addr; _byteorder = byteorder; @@ -42,6 +41,7 @@ Adafruit_BusIO_Register::Adafruit_BusIO_Register(Adafruit_I2CDevice *i2cdevice, * @param address_width The width of the register address itself, defaults * to 1 byte */ +#ifdef HAS_SPI Adafruit_BusIO_Register::Adafruit_BusIO_Register(Adafruit_SPIDevice *spidevice, uint16_t reg_addr, Adafruit_BusIO_SPIRegType type, @@ -87,6 +87,7 @@ Adafruit_BusIO_Register::Adafruit_BusIO_Register( _byteorder = byteorder; _width = width; } +#endif /*! * @brief Write a buffer of data to the register location @@ -103,6 +104,7 @@ bool Adafruit_BusIO_Register::write(uint8_t *buffer, uint8_t len) { if (_i2cdevice) { return _i2cdevice->write(buffer, len, true, addrbuffer, _addrwidth); } +#ifdef HAS_SPI if (_spidevice) { if (_spiregtype == ADDRESSED_OPCODE_BIT0_LOW_TO_WRITE) { // very special case! @@ -129,6 +131,7 @@ bool Adafruit_BusIO_Register::write(uint8_t *buffer, uint8_t len) { } return _spidevice->write(buffer, len, addrbuffer, _addrwidth); } +#endif return false; } @@ -205,6 +208,7 @@ bool Adafruit_BusIO_Register::read(uint8_t *buffer, uint8_t len) { if (_i2cdevice) { return _i2cdevice->write_then_read(addrbuffer, _addrwidth, buffer, len); } +#ifdef HAS_SPI if (_spidevice) { if (_spiregtype == ADDRESSED_OPCODE_BIT0_LOW_TO_WRITE) { // very special case! @@ -230,6 +234,7 @@ bool Adafruit_BusIO_Register::read(uint8_t *buffer, uint8_t len) { } return _spidevice->write_then_read(addrbuffer, _addrwidth, buffer, len); } +#endif return false; } @@ -361,5 +366,3 @@ void Adafruit_BusIO_Register::setAddress(uint16_t address) { void Adafruit_BusIO_Register::setAddressWidth(uint16_t address_width) { _addrwidth = address_width; } - -#endif // SPI exists diff --git a/Adafruit_BusIO_Register.h b/Adafruit_BusIO_Register.h index 8454b21..4227824 100644 --- a/Adafruit_BusIO_Register.h +++ b/Adafruit_BusIO_Register.h @@ -4,6 +4,8 @@ #if !defined(SPI_INTERFACES_COUNT) || \ (defined(SPI_INTERFACES_COUNT) && (SPI_INTERFACES_COUNT > 0)) +#define HAS_SPI +#endif // SPI exists #ifndef Adafruit_BusIO_Register_h #define Adafruit_BusIO_Register_h @@ -45,6 +47,7 @@ public: uint8_t width = 1, uint8_t byteorder = LSBFIRST, uint8_t address_width = 1); +#ifdef HAS_SPI Adafruit_BusIO_Register(Adafruit_SPIDevice *spidevice, uint16_t reg_addr, Adafruit_BusIO_SPIRegType type, uint8_t width = 1, uint8_t byteorder = LSBFIRST, @@ -55,6 +58,7 @@ public: Adafruit_BusIO_SPIRegType type, uint16_t reg_addr, uint8_t width = 1, uint8_t byteorder = LSBFIRST, uint8_t address_width = 1); +#endif bool read(uint8_t *buffer, uint8_t len); bool read(uint8_t *value); @@ -75,7 +79,9 @@ public: private: Adafruit_I2CDevice *_i2cdevice; +#ifdef HAS_SPI Adafruit_SPIDevice *_spidevice; +#endif Adafruit_BusIO_SPIRegType _spiregtype; uint16_t _address; uint8_t _width, _addrwidth, _byteorder; @@ -102,4 +108,3 @@ private: #endif // BusIO_Register_h -#endif // SPI exists diff --git a/Adafruit_SPIDevice.cpp b/Adafruit_SPIDevice.cpp index f560756..f39627a 100644 --- a/Adafruit_SPIDevice.cpp +++ b/Adafruit_SPIDevice.cpp @@ -1,8 +1,9 @@ -#if (defined(SPI_INTERFACES_COUNT) && (SPI_INTERFACES_COUNT > 0)) - #include #include +#if !defined(SPI_INTERFACES_COUNT) || \ + (defined(SPI_INTERFACES_COUNT) && (SPI_INTERFACES_COUNT > 0)) + //#define DEBUG_SERIAL Serial /*! diff --git a/Adafruit_SPIDevice.h b/Adafruit_SPIDevice.h index 1170e21..921030a 100644 --- a/Adafruit_SPIDevice.h +++ b/Adafruit_SPIDevice.h @@ -1,3 +1,5 @@ +#include + #if !defined(SPI_INTERFACES_COUNT) || \ (defined(SPI_INTERFACES_COUNT) && (SPI_INTERFACES_COUNT > 0)) From 6ffc223ad35baffe9c8081637e8c7ad3885e4225 Mon Sep 17 00:00:00 2001 From: caternuson Date: Tue, 28 Sep 2021 14:41:43 -0700 Subject: [PATCH 5/6] clang --- Adafruit_BusIO_Register.h | 1 - LICENSE | 42 +++++++++++++++++++++++---------------- README.md | 14 ++++++++----- 3 files changed, 34 insertions(+), 23 deletions(-) diff --git a/Adafruit_BusIO_Register.h b/Adafruit_BusIO_Register.h index 4227824..2d8bf3d 100644 --- a/Adafruit_BusIO_Register.h +++ b/Adafruit_BusIO_Register.h @@ -107,4 +107,3 @@ private: }; #endif // BusIO_Register_h - diff --git a/LICENSE b/LICENSE index 860e3e2..03a25dc 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,29 @@ -The MIT License (MIT) +The MIT License(MIT) -Copyright (c) 2017 Adafruit Industries + Copyright(c) 2017 Adafruit Industries -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: + Permission is hereby granted, + free of charge, + to any person obtaining a copy of this software and associated documentation + files(the "Software"), + to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish + , + distribute, sublicense, and / or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions : -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. + The above copyright notice and this permission notice shall be included in + all copies + or + substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file + THE SOFTWARE IS PROVIDED "AS IS", + WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index 771cd13..1c01a0e 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,12 @@ -# Adafruit Bus IO Library [![Build Status](https://github.com/adafruit/Adafruit_BusIO/workflows/Arduino%20Library%20CI/badge.svg)](https://github.com/adafruit/Adafruit_BusIO/actions) +#Adafruit Bus IO Library[![Build Status]( \ + https \ + : // github.com/adafruit/Adafruit_BusIO/workflows/Arduino%20Library%20CI/badge.svg)](https://github.com/adafruit/Adafruit_BusIO/actions) +This is a helper libary to abstract away I2C &SPI transactions and registers -This is a helper libary to abstract away I2C & SPI transactions and registers + Adafruit invests time and resources providing this open source code, + please support Adafruit and open - + source hardware by purchasing products from Adafruit ! -Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit! - -MIT license, all text above must be included in any redistribution + MIT license, + all text above must be included in any redistribution From 4ccef6ae1935459cb2302fb5191b28e596db267f Mon Sep 17 00:00:00 2001 From: caternuson Date: Tue, 28 Sep 2021 15:11:01 -0700 Subject: [PATCH 6/6] revert register logic --- Adafruit_BusIO_Register.cpp | 13 +++++------- Adafruit_BusIO_Register.h | 8 ++----- LICENSE | 42 +++++++++++++++---------------------- README.md | 14 +++++-------- 4 files changed, 29 insertions(+), 48 deletions(-) diff --git a/Adafruit_BusIO_Register.cpp b/Adafruit_BusIO_Register.cpp index bd42a54..f802525 100644 --- a/Adafruit_BusIO_Register.cpp +++ b/Adafruit_BusIO_Register.cpp @@ -1,5 +1,8 @@ #include +#if !defined(SPI_INTERFACES_COUNT) || \ + (defined(SPI_INTERFACES_COUNT) && (SPI_INTERFACES_COUNT > 0)) + /*! * @brief Create a register we access over an I2C Device (which defines the * bus and address) @@ -18,9 +21,7 @@ Adafruit_BusIO_Register::Adafruit_BusIO_Register(Adafruit_I2CDevice *i2cdevice, uint8_t byteorder, uint8_t address_width) { _i2cdevice = i2cdevice; -#ifdef HAS_SPI _spidevice = NULL; -#endif _addrwidth = address_width; _address = reg_addr; _byteorder = byteorder; @@ -41,7 +42,6 @@ Adafruit_BusIO_Register::Adafruit_BusIO_Register(Adafruit_I2CDevice *i2cdevice, * @param address_width The width of the register address itself, defaults * to 1 byte */ -#ifdef HAS_SPI Adafruit_BusIO_Register::Adafruit_BusIO_Register(Adafruit_SPIDevice *spidevice, uint16_t reg_addr, Adafruit_BusIO_SPIRegType type, @@ -87,7 +87,6 @@ Adafruit_BusIO_Register::Adafruit_BusIO_Register( _byteorder = byteorder; _width = width; } -#endif /*! * @brief Write a buffer of data to the register location @@ -104,7 +103,6 @@ bool Adafruit_BusIO_Register::write(uint8_t *buffer, uint8_t len) { if (_i2cdevice) { return _i2cdevice->write(buffer, len, true, addrbuffer, _addrwidth); } -#ifdef HAS_SPI if (_spidevice) { if (_spiregtype == ADDRESSED_OPCODE_BIT0_LOW_TO_WRITE) { // very special case! @@ -131,7 +129,6 @@ bool Adafruit_BusIO_Register::write(uint8_t *buffer, uint8_t len) { } return _spidevice->write(buffer, len, addrbuffer, _addrwidth); } -#endif return false; } @@ -208,7 +205,6 @@ bool Adafruit_BusIO_Register::read(uint8_t *buffer, uint8_t len) { if (_i2cdevice) { return _i2cdevice->write_then_read(addrbuffer, _addrwidth, buffer, len); } -#ifdef HAS_SPI if (_spidevice) { if (_spiregtype == ADDRESSED_OPCODE_BIT0_LOW_TO_WRITE) { // very special case! @@ -234,7 +230,6 @@ bool Adafruit_BusIO_Register::read(uint8_t *buffer, uint8_t len) { } return _spidevice->write_then_read(addrbuffer, _addrwidth, buffer, len); } -#endif return false; } @@ -366,3 +361,5 @@ void Adafruit_BusIO_Register::setAddress(uint16_t address) { void Adafruit_BusIO_Register::setAddressWidth(uint16_t address_width) { _addrwidth = address_width; } + +#endif // SPI exists diff --git a/Adafruit_BusIO_Register.h b/Adafruit_BusIO_Register.h index 2d8bf3d..8454b21 100644 --- a/Adafruit_BusIO_Register.h +++ b/Adafruit_BusIO_Register.h @@ -4,8 +4,6 @@ #if !defined(SPI_INTERFACES_COUNT) || \ (defined(SPI_INTERFACES_COUNT) && (SPI_INTERFACES_COUNT > 0)) -#define HAS_SPI -#endif // SPI exists #ifndef Adafruit_BusIO_Register_h #define Adafruit_BusIO_Register_h @@ -47,7 +45,6 @@ public: uint8_t width = 1, uint8_t byteorder = LSBFIRST, uint8_t address_width = 1); -#ifdef HAS_SPI Adafruit_BusIO_Register(Adafruit_SPIDevice *spidevice, uint16_t reg_addr, Adafruit_BusIO_SPIRegType type, uint8_t width = 1, uint8_t byteorder = LSBFIRST, @@ -58,7 +55,6 @@ public: Adafruit_BusIO_SPIRegType type, uint16_t reg_addr, uint8_t width = 1, uint8_t byteorder = LSBFIRST, uint8_t address_width = 1); -#endif bool read(uint8_t *buffer, uint8_t len); bool read(uint8_t *value); @@ -79,9 +75,7 @@ public: private: Adafruit_I2CDevice *_i2cdevice; -#ifdef HAS_SPI Adafruit_SPIDevice *_spidevice; -#endif Adafruit_BusIO_SPIRegType _spiregtype; uint16_t _address; uint8_t _width, _addrwidth, _byteorder; @@ -107,3 +101,5 @@ private: }; #endif // BusIO_Register_h + +#endif // SPI exists diff --git a/LICENSE b/LICENSE index 03a25dc..860e3e2 100644 --- a/LICENSE +++ b/LICENSE @@ -1,29 +1,21 @@ -The MIT License(MIT) +The MIT License (MIT) - Copyright(c) 2017 Adafruit Industries +Copyright (c) 2017 Adafruit Industries - Permission is hereby granted, - free of charge, - to any person obtaining a copy of this software and associated documentation - files(the "Software"), - to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, publish - , - distribute, sublicense, and / or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions : +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: - The above copyright notice and this permission notice shall be included in - all copies - or - substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. - THE SOFTWARE IS PROVIDED "AS IS", - WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index 1c01a0e..3fc8a1f 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,8 @@ -#Adafruit Bus IO Library[![Build Status]( \ - https \ - : // github.com/adafruit/Adafruit_BusIO/workflows/Arduino%20Library%20CI/badge.svg)](https://github.com/adafruit/Adafruit_BusIO/actions) +# Adafruit Bus IO Library [![Build Status](https://github.com/adafruit/Adafruit_BusIO/workflows/Arduino%20Library%20CI/badge.svg)](https://github.com/adafruit/Adafruit_BusIO/actions) -This is a helper libary to abstract away I2C &SPI transactions and registers - Adafruit invests time and resources providing this open source code, - please support Adafruit and open - - source hardware by purchasing products from Adafruit ! +This is a helper libary to abstract away I2C & SPI transactions and registers - MIT license, - all text above must be included in any redistribution +Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit! + +MIT license, all text above must be included in any redistribution