| 数据搜索系统,热门电子元器件搜索 |
|
BMP280 数据表(PDF) 22 Page - Bosch Sensortec GmbH |
|
|
|||||||||||||||||||||||||||||
BMP280 数据表(HTML) 22 Page - Bosch Sensortec GmbH |
|
22 / 49 page ![]() Bosch Sensortec | BMP280 Data sheet 22 | 49 Modifications reserved | Data subject to change without notice Document number: BST-BMP280-DS001-26 Revision_1.26_102021 The data type “BMP280_S32_t” should define a 32 bit signed integer variable type and can usually be defined as “long signed int”. The data type “BMP280_U32_t” should define a 32 bit unsigned integer variable type and can usually be defined as “long unsigned int”. For best possible calculation accuracy, 64 bit integer support is needed. If this is not possible on your platform, please see appendix 8.2 for a 32 bit alternative. The data type “BMP280_S64_t” should define a 64 bit signed integer variable type, which on most supporting platforms can be defined as “long long signed int”. The revision of the code is rev.1.1. // Returns temperature in DegC, resolution is 0.01 DegC. Output value of “5123” equals 51.23 DegC. // t_fine carries fine temperature as global value BMP280_S32_t t_fine; BMP280_S32_t bmp280_compensate_T_int32(BMP280_S32_t adc_T) { BMP280_S32_t var1, var2, T; var1 = ((((adc_T>>3) – ((BMP280_S32_t)dig_T1<<1))) * ((BMP280_S32_t)dig_T2)) >> 11; var2 = (((((adc_T>>4) – ((BMP280_S32_t)dig_T1)) * ((adc_T>>4) – ((BMP280_S32_t)dig_T1))) >> 12) * ((BMP280_S32_t)dig_T3)) >> 14; t_fine = var1 + var2; T = (t_fine * 5 + 128) >> 8; return T; } “”– // Returns pressure in Pa as unsigned 32 bit integer in Q24.8 format (24 integer bits and 8 fractional bits). // Output value of “24674867” represents 24674867/256 = 96386.2 Pa = 963.862 hPa BMP280_U32_t bmp280_compensate_P_int64(BMP280_S32_t adc_P) { BMP280_S64_t var1, var2, p; var1 = ((BMP280_S64_t)t_fine) – 128000; var2 = var1 * var1 * (BMP280_S64_t)dig_P6; var2 = var2 + ((var1*(BMP280_S64_t)dig_P5)<<17); var2 = var2 + (((BMP280_S64_t)dig_P4)<<35); var1 = ((var1 * var1 * (BMP280_S64_t)dig_P3)>>8) + ((var1 * (BMP280_S64_t)dig_P2)<<12); var1 = (((((BMP280_S64_t)1)<<47)+var1))*((BMP280_S64_t)dig_P1)>>33; if (var1 == 0) { return 0; // avoid exception caused by division by zero } p = 1048576-adc_P; p = (((p<<31)-var2)*3125)/var1; var1 = (((BMP280_S64_t)dig_P9) * (p>>13) * (p>>13)) >> 25; var2 = (((BMP280_S64_t)dig_P8) * p) >> 19; p = ((p + var1 + var2) >> 8) + (((BMP280_S64_t)dig_P7)<<4); return (BMP280_U32_t)p; 3.12 Calculating pressure and temperature The following figure shows the detailed algorithm for pressure and temperature measurement. This algorithm is available to customers as reference C source code (“BMP28x_ API”) from Bosch Sensortec and via its sales and distribution partners. |
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |