diff --git a/libraries/INA3221_RT/CHANGELOG.md b/libraries/INA3221_RT/CHANGELOG.md index 9d0e4080..ec0f3601 100644 --- a/libraries/INA3221_RT/CHANGELOG.md +++ b/libraries/INA3221_RT/CHANGELOG.md @@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [0.3.0] - 2024-08-14 +- Fix #6 setCriticalCurrent() +- add array example +- update keywords.txt +- update readme.md + +---- + ## [0.2.0] - 2024-04-15 - Fix #2, reimplement several functions - makes 0.1.0 obsolete @@ -14,6 +22,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - add **INA3221_tests.ino** example - sort of unit test. +---- ## [0.1.0] - 2024-02-05 - initial version. diff --git a/libraries/INA3221_RT/INA3221.cpp b/libraries/INA3221_RT/INA3221.cpp index 73f3685f..4f9ecc8d 100644 --- a/libraries/INA3221_RT/INA3221.cpp +++ b/libraries/INA3221_RT/INA3221.cpp @@ -1,6 +1,6 @@ // FILE: INA3221.cpp // AUTHOR: Rob Tillaart -// VERSION: 0.2.0 +// VERSION: 0.3.0 // DATE: 2024-02-05 // PURPOSE: Arduino library for the I2C INA3221 3 channel voltage and current sensor. // URL: https://github.com/RobTillaart/INA3221_RT @@ -162,7 +162,7 @@ uint32_t INA3221::getWarningAlert(uint8_t channel) // mA wrappers -int INA3221::setCriticalCurrect(uint8_t channel, float milliAmpere) +int INA3221::setCriticalCurrent(uint8_t channel, float milliAmpere) { return setCriticalAlert(channel, 1000.0 * milliAmpere * _shunt[channel]); } diff --git a/libraries/INA3221_RT/INA3221.h b/libraries/INA3221_RT/INA3221.h index e295ea6a..1e8ee1bb 100644 --- a/libraries/INA3221_RT/INA3221.h +++ b/libraries/INA3221_RT/INA3221.h @@ -1,7 +1,7 @@ #pragma once // FILE: INA3221.h // AUTHOR: Rob Tillaart -// VERSION: 0.2.0 +// VERSION: 0.3.0 // DATE: 2024-02-05 // PURPOSE: Arduino library for the I2C INA3221 3 channel voltage and current sensor. // URL: https://github.com/RobTillaart/INA3221_RT @@ -13,7 +13,7 @@ #include "Wire.h" -#define INA3221_LIB_VERSION "0.2.0" +#define INA3221_LIB_VERSION "0.3.0" class INA3221 @@ -58,7 +58,7 @@ public: // Wrappers using milliAmpere (Shunt must be set correctly!). // NOTE: LSB = 40 uV so milliAmpere should be >= 0.4 mA (assume R = 0.1) - int setCriticalCurrect(uint8_t channel, float milliAmpere); + int setCriticalCurrent(uint8_t channel, float milliAmpere); float getCriticalCurrent(uint8_t channel); int setWarningCurrent(uint8_t channel, float milliAmpere); float getWarningCurrent(uint8_t channel); diff --git a/libraries/INA3221_RT/README.md b/libraries/INA3221_RT/README.md index 897dff51..4ae4450b 100644 --- a/libraries/INA3221_RT/README.md +++ b/libraries/INA3221_RT/README.md @@ -41,6 +41,11 @@ Some important maxima, see datasheet for all details. | current | 1.63 | Ampere | I = U/R +#### 0.3.0 breaking changes. + +Renamed setCriticalCurrect() ==> setCriticalCurrent() to fix typo. + + #### 0.2.0 breaking changes. Several functions have been reimplemented after issue #2. @@ -72,6 +77,9 @@ As always feedback is welcome, please open an issue on GitHub. - https://github.com/RobTillaart/INA219 - https://github.com/RobTillaart/INA226 +- https://github.com/RobTillaart/INA228 +- https://github.com/RobTillaart/INA3221_RT + ## I2C @@ -120,7 +128,7 @@ Four most important calls. All parameters channels are zero based => so numbered 0 , 1 or 2. Using channels > 2 are not handled (correctly). -#### Constructor +### Constructor - **INA3221(const uint8_t address, TwoWire \*wire = Wire)** Constructor to set the address and optional Wire interface. @@ -131,7 +139,7 @@ Note: one needs to set **Wire.begin()** before calling **begin()**. - **uint8_t getAddress()** returns the address set in the constructor. -#### Core Functions +### Core Functions Note the power and the current are not meaningful without calibrating the sensor. Also the value is not meaningful if there is no shunt connected. @@ -160,7 +168,7 @@ Wrapper functions for the micro scale. - **float getPower_uW(uint8_t channel)** idem, in microWatt. -#### Shunt Resistor +### Shunt Resistor The shunt resistor is typical in the order of 0.100 Ohm. @@ -168,7 +176,7 @@ The shunt resistor is typical in the order of 0.100 Ohm. - **float getShuntR(uint8_t channel)** returns value in Ohm. -#### Shunt Alerts, warning and critical +### Shunt Alerts, warning and critical (not tested) Read datasheet! @@ -193,7 +201,7 @@ Wrappers using milliAmpere (assuming Shunt is set correctly!). These are often more intuitive from user perspective. NOTE: LSB = 40 uV so milliAmpere should be >= 0.4 mA (assume Shunt = 0.1 Ohm) -- **int setCriticalCurrect(uint8_t channel, float milliAmpere)** +- **int setCriticalCurrent(uint8_t channel, float milliAmpere)** sets the critical alert level in milliAmpere. - **float getCriticalCurrent(uint8_t channel)** returns milliAmpere - **int setWarningCurrent(uint8_t channel, float milliAmpere)** @@ -201,7 +209,7 @@ sets the warning alert level in milliAmpere. - **float getWarningCurrent(uint8_t channel)** returns milliAmpere -#### Shunt voltage sum +### Shunt voltage sum (not tested) Read datasheet! @@ -211,7 +219,7 @@ Read datasheet! - **int16_t getShuntVoltageSumLimit()** returns set value in microVolt. -#### Configuration +### Configuration (partially tested) Read datasheet for bit pattern of the mask. @@ -273,7 +281,7 @@ Note: In combination with average the total conversion time can take up to 1024 x 8.3 ms almost 9 seconds (+ 10% deviation ==> 10 seconds) -#### Operating mode +### Operating mode (not tested) See datasheet! @@ -301,7 +309,7 @@ Descriptive mode functions (convenience wrappers). - **int setModeShuntBusContinuous()** mode 7 - default - (only one tested) -#### Mask / enable register +### Mask / enable register (not tested) See datasheet! @@ -316,7 +324,7 @@ TODO: convenience wrappers - 9 x getters -#### Power Limit +### Power Limit (not tested) See datasheet! @@ -329,7 +337,7 @@ To guard the BUS voltage, max value 32760 - **int16_t getPowerLowerLimit()** -#### Meta information +### Meta information (tested) @@ -337,7 +345,7 @@ To guard the BUS voltage, max value 32760 - **uint16_t getDieID()** should return 0x2260, mine returns 0x3220. -#### Debugging +### Debugging - **uint16_t getRegister(uint8_t reg)** fetch registers directly, for debugging only. - **uint16_t putRegister(uint8_t reg, uint16_t value)** load registers directly, for debugging only. diff --git a/libraries/INA3221_RT/keywords.txt b/libraries/INA3221_RT/keywords.txt index 88c05ce5..d1c73e6d 100644 --- a/libraries/INA3221_RT/keywords.txt +++ b/libraries/INA3221_RT/keywords.txt @@ -33,7 +33,7 @@ getCriticalAlert KEYWORD2 setWarningAlert KEYWORD2 getWarningAlert KEYWORD2 -setCriticalCurrect KEYWORD2 +setCriticalCurrent KEYWORD2 getCriticalCurrent KEYWORD2 setWarningCurrent KEYWORD2 getWarningCurrent KEYWORD2 diff --git a/libraries/INA3221_RT/library.json b/libraries/INA3221_RT/library.json index 844806ba..091ca863 100644 --- a/libraries/INA3221_RT/library.json +++ b/libraries/INA3221_RT/library.json @@ -15,7 +15,7 @@ "type": "git", "url": "https://github.com/RobTillaart/INA3221_RT.git" }, - "version": "0.2.0", + "version": "0.3.0", "license": "MIT", "frameworks": "*", "platforms": "*", diff --git a/libraries/INA3221_RT/library.properties b/libraries/INA3221_RT/library.properties index af903c2a..15cb6100 100644 --- a/libraries/INA3221_RT/library.properties +++ b/libraries/INA3221_RT/library.properties @@ -1,5 +1,5 @@ name=INA3221_RT -version=0.2.0 +version=0.3.0 author=Rob Tillaart maintainer=Rob Tillaart sentence=Arduino library for the I2C INA3221 3 channel voltage and current sensor.