BlueNinja BSP  0.5
Cerevo BlueNinja(CDP-TZ01B) Board Support Packageリファレンスマニュアル
BMP280.h ファイル

Airpressure sensor(BOSH BMP280) driver for TZ10xx. [詳解]

#include <stdint.h>
#include <stdbool.h>
#include "Driver_I2C.h"

[ソースコード]

マクロ定義

#define BMP280_I2C_ADDR   (0x76)
 
BMP280 register addresses
#define BMP280_REG_CALIB00   (0x88)
 
#define BMP280_REG_CALIB25   (0xa1)
 
#define BMP280_REG_ID   (0xd0)
 
#define BMP280_REG_RESET   (0xe0)
 
#define BMP280_REG_STATUS   (0xf3)
 
#define BMP280_REG_CTRL_MEAS   (0xf4)
 
#define BMP280_REG_CONFIG   (0xf5)
 
#define BMP280_REG_PRESS_MSB   (0xf7)
 
#define BMP280_REG_PRESS_LSB   (0xf8)
 
#define BMP280_REG_PRESS_XLSB   (0xf9)
 
#define BMP280_REG_TEMP_MSB   (0xfa)
 
#define BMP280_REG_TEMP_LSB   (0xfb)
 
#define BMP280_REG_TEMP_XLSB   (0xfc)
 
BMP280 register bit pattern
#define BMP280_BIT_RESET   (0xb6)
 

関数

bool BMP280_drv_reset (void)
 Reset BMP280. [詳解]
 
uint8_t BMP280_drv_id_get (void)
 Read from ID register. [詳解]
 
uint8_t BMP280_drv_status_get (void)
 Read from STATUS register. [詳解]
 
bool BMP280_drv_ctrl_meas_set (uint8_t val)
 Write to MEAS register. [詳解]
 
uint8_t BMP280_drv_ctrl_meas_get (void)
 Read from MEAS register. [詳解]
 
bool BMP280_drv_config_set (uint8_t val)
 Write to CONFIG register. [詳解]
 
uint8_t BMP280_drv_config_get (void)
 Read from CONFIG register. [詳解]
 
uint32_t BMP280_drv_press_get (void)
 Read from maesured value of Airpressure. [詳解]
 
int32_t BMP280_drv_temp_get (void)
 Read from maesured value of temperature. [詳解]
 
bool BMP280_drv_init (ARM_DRIVER_I2C *i2c_drv)
 Initialize BMP280 driver. [詳解]
 

詳解

Airpressure sensor(BOSH BMP280) driver for TZ10xx.

著者
Cerevo Inc.

マクロ定義詳解

#define BMP280_BIT_RESET   (0xb6)

Reset

#define BMP280_I2C_ADDR   (0x76)

I2C address.

#define BMP280_REG_CALIB00   (0x88)

CALIB00 register

#define BMP280_REG_CALIB25   (0xa1)

CALIB25 register

#define BMP280_REG_CONFIG   (0xf5)

CONFIG register

#define BMP280_REG_CTRL_MEAS   (0xf4)

CTRL_MEAS register

#define BMP280_REG_ID   (0xd0)

ID register

#define BMP280_REG_PRESS_LSB   (0xf8)

PRESS_LSB register

#define BMP280_REG_PRESS_MSB   (0xf7)

PRESS_MSB register

#define BMP280_REG_PRESS_XLSB   (0xf9)

PRESS_XLSB register

#define BMP280_REG_RESET   (0xe0)

RESET register

#define BMP280_REG_STATUS   (0xf3)

STATUS register

#define BMP280_REG_TEMP_LSB   (0xfb)

TEMP_LSB register

#define BMP280_REG_TEMP_MSB   (0xfa)

TEMP_MSB register

#define BMP280_REG_TEMP_XLSB   (0xfc)

TEMP_XLSB register

関数詳解

uint8_t BMP280_drv_config_get ( void  )

Read from CONFIG register.

戻り値
Read value.
bool BMP280_drv_config_set ( uint8_t  val)

Write to CONFIG register.

引数
[in]valWrite value;
戻り値
Write result.
戻り値
trueSuccess.
falseFailed.
uint8_t BMP280_drv_ctrl_meas_get ( void  )

Read from MEAS register.

戻り値
read value.
bool BMP280_drv_ctrl_meas_set ( uint8_t  val)

Write to MEAS register.

引数
[in]valWrite value;
戻り値
Write result.
戻り値
trueSuccess.
falseFailed.
uint8_t BMP280_drv_id_get ( void  )

Read from ID register.

戻り値
read value.
bool BMP280_drv_init ( ARM_DRIVER_I2C *  i2c_drv)

Initialize BMP280 driver.

引数
[in]i2c_drvTZ10xx I2C driver information
戻り値
Initialize result.
戻り値
trueSuccess.
falseFailed.
uint32_t BMP280_drv_press_get ( void  )

Read from maesured value of Airpressure.

戻り値
Read value.
bool BMP280_drv_reset ( void  )

Reset BMP280.

戻り値
Result
戻り値
trueSuccess
falseFailed
uint8_t BMP280_drv_status_get ( void  )

Read from STATUS register.

戻り値
read value.
int32_t BMP280_drv_temp_get ( void  )

Read from maesured value of temperature.

戻り値
Read value.