Skip to content

Commit

Permalink
- Added chapter for Sensor data's units
Browse files Browse the repository at this point in the history
- humidity_max value updated in "compensate_humidity" API integer version
- Removed changelog
  • Loading branch information
BST-Github-Admin committed Feb 26, 2018
1 parent 18260d6 commit 958cef6
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 57 deletions.
27 changes: 24 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ The sensor driver package includes bme280.c, bme280.h and bme280_defs.h files.
## Version
File | Version | Date
--------------|---------|------------
bme280.c | 3.3.2 | 22 Nov 2017
bme280.h | 3.3.2 | 22 Nov 2017
bme280_defs.h | 3.3.2 | 22 Nov 2017
bme280.c | 3.3.4 | 14 Feb 2018
bme280.h | 3.3.4 | 14 Feb 2018
bme280_defs.h | 3.3.4 | 14 Feb 2018

## Integration details
* Integrate bme280.h, bme280_defs.h and bme280.c file in to the project.
Expand Down Expand Up @@ -74,6 +74,27 @@ In integer compensation functions, we also have below two implementations for pr
By default, 64 bit variant is used in the API. If the user wants 32 bit variant, the user can disable the
macro BME280_64BIT_ENABLE in bme280_defs.h file.

### Sensor data units
> The sensor data units depends on the following macros being enabled or not,
> (in bme280_defs.h file or as compiler macros)
> * BME280_FLOAT_ENABLE
> * BME280_64BIT_ENABLE
In case of the macro "BME280_FLOAT_ENABLE" enabled,
The outputs are in double and the units are

- °C for temperature
- % relative humidity
- Pascal for pressure

In case if "BME280_FLOAT_ENABLE" is not enabled, then it is

- int32_t for temperature with the units 100 * °C
- uint32_t for humidity with the units 1024 * % relative humidity
- uint32_t for pressure
If macro "BME280_64BIT_ENABLE" is enabled, which it is by default, the unit is 100 * Pascal
If this macro is disabled, Then the unit is in Pascal

### Stream sensor data
#### Stream sensor data in forced mode

Expand Down
8 changes: 4 additions & 4 deletions bme280.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
* patent rights of the copyright holder.
*
* File bme280.c
* Date 22 Nov 2017
* Version 3.3.2
* Date 14 Feb 2018
* Version 3.3.4
*
*/

Expand Down Expand Up @@ -440,7 +440,7 @@ int8_t bme280_set_regs(uint8_t *reg_addr, const uint8_t *reg_data, uint8_t len,
/* Interleave register address w.r.t data for
burst write*/
interleave_reg_addr(reg_addr, temp_buff, reg_data, len);
temp_len = len * 2;
temp_len = ((len * 2) - 1);
} else {
temp_len = len;
}
Expand Down Expand Up @@ -1114,7 +1114,7 @@ static uint32_t compensate_humidity(const struct bme280_uncomp_data *uncomp_data
int32_t var4;
int32_t var5;
uint32_t humidity;
uint32_t humidity_max = 100000;
uint32_t humidity_max = 102400;

var1 = calib_data->t_fine - ((int32_t)76800);
var2 = (int32_t)(uncomp_data->humidity * 16384);
Expand Down
4 changes: 2 additions & 2 deletions bme280.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
* patent rights of the copyright holder.
*
* @file bme280.h
* @date 22 Nov 2017
* @version 3.3.2
* @date 14 Feb 2018
* @version 3.3.4
* @brief
*
*/
Expand Down
4 changes: 2 additions & 2 deletions bme280_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
* patent rights of the copyright holder.
*
* @file bme280_defs.h
* @date 22 Nov 2017
* @version 3.3.2
* @date 14 Feb 2018
* @version 3.3.4
* @brief
*
*/
Expand Down
46 changes: 0 additions & 46 deletions changelog.md

This file was deleted.

0 comments on commit 958cef6

Please sign in to comment.