diff --git a/libraries/LTC2991/CHANGELOG.md b/libraries/LTC2991/CHANGELOG.md index 89349475..d54e5737 100644 --- a/libraries/LTC2991/CHANGELOG.md +++ b/libraries/LTC2991/CHANGELOG.md @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [0.1.6] - 2023-09-23 +- add Wire1 support for ESP32 +- update readme.md +- add defines for readability + + ## [0.1.5] - 2023-03-06 - fix examples default address to 0x48 - add getAddress() function diff --git a/libraries/LTC2991/LTC2991.cpp b/libraries/LTC2991/LTC2991.cpp index 23579da5..1ddac86d 100644 --- a/libraries/LTC2991/LTC2991.cpp +++ b/libraries/LTC2991/LTC2991.cpp @@ -1,7 +1,7 @@ // // FILE: LTC2991.cpp // AUTHOR: Rob Tillaart -// VERSION: 0.1.5 +// VERSION: 0.1.6 // DATE: 2021-05-10 // PURPOSE: Library for LTC2991 temperature and voltage control IC // URL: https://github.com/RobTillaart/LTC2991 @@ -72,7 +72,6 @@ LTC2991::LTC2991(const int8_t address, TwoWire *wire) #if defined (ESP8266) || defined(ESP32) bool LTC2991::begin(const uint8_t sda, const uint8_t scl) { - _wire = &Wire; _wire->begin(sda, scl); if (! isConnected()) return false; return true; @@ -107,7 +106,7 @@ uint8_t LTC2991::getAddress() bool LTC2991::new_data(uint8_t channel) { uint8_t x = _readRegister(STATUS_LOW); - // LTC2991_NEW_DATA / NONE + // LTC2991_NEW_DATA / NONE return (x & (1 << (channel - 1))) > 0; } @@ -317,7 +316,7 @@ uint8_t LTC2991::get_differential_mode(uint8_t n) } uint8_t mask = 0x01; if (n > 1) mask = 0x10; - // LTC2991_VOLTAGE_MODE_DIFFERENTIAL / NORMAL ??? + // LTC2991_VOLTAGE_DIFF / NORMAL ??? if (_getRegisterMask(reg, mask) > 0) return 1; return 0; } @@ -407,7 +406,7 @@ void LTC2991::invert_PWM(bool invert) bool LTC2991::is_inverted_PWM() { - // LTC2991_PWM_INVERTED / LTC2991_PWM_NORMAL + // LTC2991_PWM_INVERTED / LTC2991_PWM_NORMAL return _getRegisterMask(PWM_THRESHOLD_LSB, 0x40) > 0; } @@ -507,9 +506,9 @@ char LTC2991::get_temp_scale_Tintern() { if (_getRegisterMask(PWM_THRESHOLD_LSB, 0x04) > 0) { - return 'K'; // LTC2991_TEMPSCALE_KELVIN + return 'K'; // LTC2991_KELVIN } - return 'C'; // LTC2991_TEMPSCALE_CELSIUS + return 'C'; // LTC2991_CELSIUS } diff --git a/libraries/LTC2991/LTC2991.h b/libraries/LTC2991/LTC2991.h index bb308d04..54216486 100644 --- a/libraries/LTC2991/LTC2991.h +++ b/libraries/LTC2991/LTC2991.h @@ -2,7 +2,7 @@ // // FILE: LTC2991.h // AUTHOR: Rob Tillaart -// VERSION: 0.1.5 +// VERSION: 0.1.6 // DATE: 2021-05-10 // PURPOSE: Library for LTC2991 temperature and voltage control IC // URL: https://github.com/RobTillaart/LTC2991 @@ -12,7 +12,43 @@ #include "Wire.h" -#define LTC2991_LIB_VERSION (F("0.1.5")) +#define LTC2991_LIB_VERSION (F("0.1.6")) + +// +// DEFINES for readability +// +#define LTC2991_NEW_DATA 0x01 +#define LTC2991_NO_DATA 0x00 + +#define LTC2991_BUSY 0x01 +#define LTC2991_IDLE 0x00 + +#define LTC2991_TRIGGER_ENABLED 0x01 +#define LTC2991_TRIGGER_DISABLED 0x00 + +#define LTC2991_FILTER_ENABLED 0x01 +#define LTC2991_FILTER_DISABLED 0x00 + +#define LTC2991_VOLTAGE_DIFF 0x01 +#define LTC2991_VOLTAGE_NORMAL 0x00 + +#define LTC2991_PWM_INVERTED 0x01 +#define LTC2991_PWM_NORMAL 0x00 + +#define LTC2991_PWM_ENABLED 0x01 +#define LTC2991_PWM_DISABLED 0x00 + +#define LTC2991_MODE_REPEAT 0x01 +#define LTC2991_MODE_SINGLE 0x00 + +#define LTC2991_TINTERN_ENABLED 0x01 +#define LTC2991_TINTERN_DISABLED 0x00 + +#define LTC2991_TINTERN_FILTER_ENABLED 0x01 +#define LTC2991_TINTERN_FILTER_DISABLED 0x00 + +#define LTC2991_KELVIN 0x01 +#define LTC2991_CELSIUS 0x00 class LTC2991 diff --git a/libraries/LTC2991/README.md b/libraries/LTC2991/README.md index eb728d94..d3c03364 100644 --- a/libraries/LTC2991/README.md +++ b/libraries/LTC2991/README.md @@ -2,8 +2,11 @@ [![Arduino CI](https://github.com/RobTillaart/LTC2991/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci) [![Arduino-lint](https://github.com/RobTillaart/LTC2991/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/LTC2991/actions/workflows/arduino-lint.yml) [![JSON check](https://github.com/RobTillaart/LTC2991/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/LTC2991/actions/workflows/jsoncheck.yml) +[![GitHub issues](https://img.shields.io/github/issues/RobTillaart/LTC2991.svg)](https://github.com/RobTillaart/LTC2991/issues) + [![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/LTC2991/blob/master/LICENSE) [![GitHub release](https://img.shields.io/github/release/RobTillaart/LTC2991.svg?maxAge=3600)](https://github.com/RobTillaart/LTC2991/releases) +[![PlatformIO Registry](https://badges.registry.platformio.org/packages/robtillaart/library/LTC2991.svg)](https://registry.platformio.org/libraries/robtillaart/LTC2991) # LTC2991 @@ -25,6 +28,7 @@ As the IC has only 8 inputs available one has to choose what. Read the datasheet for the details. + #### Address From datasheet - table 1 @@ -189,3 +193,12 @@ if you happen to have performance figures, please share them in an issue. - would interface # functions increase too much? - == > Users can do this conversion. + +## Support + +If you appreciate my libraries, you can support the development and maintenance. +Improve the quality of the libraries by providing issues and Pull Requests, or +donate through PayPal or GitHub sponsors. + +Thank you, + diff --git a/libraries/LTC2991/library.json b/libraries/LTC2991/library.json index ec71c787..5b5c6e67 100644 --- a/libraries/LTC2991/library.json +++ b/libraries/LTC2991/library.json @@ -15,9 +15,9 @@ "type": "git", "url": "https://github.com/RobTillaart/LTC2991.git" }, - "version": "0.1.5", + "version": "0.1.6", "license": "MIT", - "frameworks": "arduino", + "frameworks": "*", "platforms": "*", "headers": "LTC2991.h" } diff --git a/libraries/LTC2991/library.properties b/libraries/LTC2991/library.properties index cfcac552..eb5e31bf 100644 --- a/libraries/LTC2991/library.properties +++ b/libraries/LTC2991/library.properties @@ -1,5 +1,5 @@ name=LTC2991 -version=0.1.5 +version=0.1.6 author=Rob Tillaart maintainer=Rob Tillaart sentence=Arduino library for LTC2991