stm32气压传感器 带探头的_bmp085气压传感器与STM32F031的I2C代码调试结果

/* Includes ------------------------------------------------------------------*/

#include "bmp085.h"

/* Private typedef -----------------------------------------------------------*/

/* Private define ------------------------------------------------------------*/

/* Private macro -------------------------------------------------------------*/

/* Private variables ---------------------------------------------------------*/

//uint8_t oss;

int16_t ac1, ac2, ac3, b1, b2, mb, mc, md;

uint16_t ac4, ac5, ac6;

int32_t ut, up, BMP085_Temperature, BMP085_Pressure;

BMP085_OSS_TypeDef oss;

/* Private function prototypes -----------------------------------------------*/

/* Private functions ---------------------------------------------------------*/

/**

* @brief  BMP085¶á¼ÆËãÏμêyoˉêy£¬òÔ±ã½øDD¼ÆËãÕæÕyμÄζèoíÑ1Ç¿

* @param  ÎT

* @retval ÎT

*/

void BMP085_Read_Calibration_Data(void)

{

uint8_t BMP085_Calibration_Data_Buffer[BMP085_CAL_COE_NUMBER];

if(I2C1_Read_NBytes(BMP085_ADDR, BMP085_CAL_COE_STA_ADDR, BMP085_CAL_COE_NUMBER, BMP085_Calibration_Data_Buffer) == I2C_FAIL)

{

BMP085_TIMEOUT_UserCallback();

}

ac1 = (((int16_t)BMP085_Calibration_Data_Buffer[0]) << 8) + BMP085_Calibration_Data_Buffer[1];

ac2 = (((int16_t)BMP085_Calibration_Data_Buffer[2]) << 8) + BMP085_Calibration_Data_Buffer[3];

ac3 = (((int16_t)BMP085_Calibration_Data_Buffer[4]) << 8) + BMP085_Calibration_Data_Buffer[5];

ac4 = (((uint16_t)BMP085_Calibration_Data_Buffer[6]) << 8) + BMP085_Calibration_Data_Buffer[7];

ac5 = (((uint16_t)BMP085_Calibration_Data_Buffer[8]) << 8) + BMP085_Calibration_Data_Buffer[9];

ac6 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值