diff --git a/CHANGELOG.md b/CHANGELOG.md index 050904f..effecdb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,16 +4,23 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - ## [Unreleased] +## [1.0.0] + ### Added -Example how to change I2C address for SLF3x sensors +* Example how to change I2C address for SLF3x sensors ### Changed -Names of defines for I2C addresses in SensirionI2cSf06Lf.h changed +* Names of defines for I2C addresses in SensirionI2cSf06Lf.h changed +* Added prefix to enum definitions in SensirionI2cSf06Lf.h + (InvFlowScaleFactors -> I2cSf06LfInvFlowScaleFactors, CmdId -> I2cSf06LfCmdId) ## [0.1.0] - 2022-03-30 Initial release + +[Unreleased]: https://github.com/Sensirion/arduino-i2c-sf06-lf/compare/1.0.0...HEAD +[1.0.0]: https://github.com/Sensirion/arduino-i2c-sf06-lf/compare/0.1.0...1.0.0 +[0.1.0]: https://github.com/Sensirion/arduino-i2c-sf06-lf/releases/tag/0.1.0 \ No newline at end of file diff --git a/src/SensirionI2cSf06Lf.cpp b/src/SensirionI2cSf06Lf.cpp index b926f35..e8353e1 100644 --- a/src/SensirionI2cSf06Lf.cpp +++ b/src/SensirionI2cSf06Lf.cpp @@ -44,8 +44,8 @@ static uint8_t communication_buffer[18] = {0}; SensirionI2cSf06Lf::SensirionI2cSf06Lf() { } -float SensirionI2cSf06Lf::signalFlow(int16_t rawFlow, - InvFlowScaleFactors invFlowScaleFactor) { +float SensirionI2cSf06Lf::signalFlow( + int16_t rawFlow, Sf06LfInvFlowScaleFactors invFlowScaleFactor) { float flow = 0.0; flow = (float)(rawFlow); flow = flow / (int)(invFlowScaleFactor); @@ -71,10 +71,9 @@ SensirionI2cSf06Lf::signalThermalConductivity(int16_t rawThermalConductivity) { return thermalConductivity; } -int16_t -SensirionI2cSf06Lf::readMeasurementData(InvFlowScaleFactors invFlowScaleFactor, - float& aFlow, float& aTemperature, - uint16_t& aSignalingFlags) { +int16_t SensirionI2cSf06Lf::readMeasurementData( + Sf06LfInvFlowScaleFactors invFlowScaleFactor, float& aFlow, + float& aTemperature, uint16_t& aSignalingFlags) { int16_t rawFlow = 0; int16_t rawTemp = 0; uint16_t signalingFlags = 0u; diff --git a/src/SensirionI2cSf06Lf.h b/src/SensirionI2cSf06Lf.h index f56d8f0..22e4069 100644 --- a/src/SensirionI2cSf06Lf.h +++ b/src/SensirionI2cSf06Lf.h @@ -60,7 +60,7 @@ typedef enum { EXIT_SLEEP_CMD_ID = 0x0, READ_PRODUCT_IDENTIFIER_PREPARE_CMD_ID = 0x367c, READ_PRODUCT_IDENTIFIER_CMD_ID = 0xe102, -} CmdId; +} Sf06LfCmdId; typedef enum { INV_FLOW_SCALE_FACTORS_SLF3C_1300F = 500, @@ -69,7 +69,7 @@ typedef enum { INV_FLOW_SCALE_FACTORS_SLF3S_0600F = 10, INV_FLOW_SCALE_FACTORS_LD20_0600L = 1200, INV_FLOW_SCALE_FACTORS_LD20_2600B = 20, -} InvFlowScaleFactors; +} Sf06LfInvFlowScaleFactors; class SensirionI2cSf06Lf { public: @@ -102,7 +102,7 @@ class SensirionI2cSf06Lf { * * @return error_code 0 on success, an error code otherwise. */ - int16_t readMeasurementData(InvFlowScaleFactors invFlowScaleFactor, + int16_t readMeasurementData(Sf06LfInvFlowScaleFactors invFlowScaleFactor, float& aFlow, float& aTemperature, uint16_t& aSignalingFlags); @@ -351,7 +351,8 @@ class SensirionI2cSf06Lf { * raw value is converted by: flow = raw_flow / inv_flow_scale_factor * Resulting unit depends on your specific sensor type. */ - float signalFlow(int16_t rawFlow, InvFlowScaleFactors invFlowScaleFactor); + float signalFlow(int16_t rawFlow, + Sf06LfInvFlowScaleFactors invFlowScaleFactor); /** * @brief signalTemperature