LibDriver BMP180
Loading...
Searching...
No Matches
driver_bmp180.c File Reference

driver bmp180 source file More...

#include "driver_bmp180.h"
Include dependency graph for driver_bmp180.c:

Go to the source code of this file.

Macros

#define CHIP_NAME   "Bosch BMP180"
 chip information definition
#define MANUFACTURER_NAME   "Bosch"
#define SUPPLY_VOLTAGE_MIN   1.8f
#define SUPPLY_VOLTAGE_MAX   3.6f
#define MAX_CURRENT   0.65f
#define TEMPERATURE_MIN   -40.0f
#define TEMPERATURE_MAX   85.0f
#define DRIVER_VERSION   2000
#define BMP180_ADDRESS   0xEE
 chip address definition
#define BMP180_REG_AC1_MSB   0xAA
 chip register definition
#define BMP180_REG_AC1_LSB   0xAB
#define BMP180_REG_AC2_MSB   0xAC
#define BMP180_REG_AC2_LSB   0xAD
#define BMP180_REG_AC3_MSB   0xAE
#define BMP180_REG_AC3_LSB   0xAF
#define BMP180_REG_AC4_MSB   0xB0
#define BMP180_REG_AC4_LSB   0xB1
#define BMP180_REG_AC5_MSB   0xB2
#define BMP180_REG_AC5_LSB   0xB3
#define BMP180_REG_AC6_MSB   0xB4
#define BMP180_REG_AC6_LSB   0xB5
#define BMP180_REG_B1_MSB   0xB6
#define BMP180_REG_B1_LSB   0xB7
#define BMP180_REG_B2_MSB   0xB8
#define BMP180_REG_B2_LSB   0xB9
#define BMP180_REG_MB_MSB   0xBA
#define BMP180_REG_MB_LSB   0xBB
#define BMP180_REG_MC_MSB   0xBC
#define BMP180_REG_MC_LSB   0xBD
#define BMP180_REG_MD_MSB   0xBE
#define BMP180_REG_MD_LSB   0xBF
#define BMP180_REG_CTRL_MEAS   0xF4
#define BMP180_REG_OUT_MSB   0xF6
#define BMP180_REG_OUT_LSB   0xF7
#define BMP180_REG_OUT_XLSB   0xF8
#define BMP180_REG_SOFT   0xE0
#define BMP180_REG_ID   0xD0

Functions

uint8_t bmp180_init (bmp180_handle_t *handle)
 initialize the chip
uint8_t bmp180_deinit (bmp180_handle_t *handle)
 close the chip
uint8_t bmp180_set_mode (bmp180_handle_t *handle, bmp180_mode_t mode)
 set the measurement mode
uint8_t bmp180_get_mode (bmp180_handle_t *handle, bmp180_mode_t *mode)
 get the measurement mode
uint8_t bmp180_read_pressure (bmp180_handle_t *handle, uint32_t *raw, uint32_t *pa)
 read the pressure data
uint8_t bmp180_read_temperature (bmp180_handle_t *handle, uint16_t *raw, float *c)
 read the temperature data
uint8_t bmp180_read_temperature_pressure (bmp180_handle_t *handle, uint16_t *temperature_raw, float *temperature_c, uint32_t *pressure_raw, uint32_t *pressure_pa)
 read the temperature and pressure data
uint8_t bmp180_set_reg (bmp180_handle_t *handle, uint8_t reg, uint8_t value)
 set the chip register
uint8_t bmp180_get_reg (bmp180_handle_t *handle, uint8_t reg, uint8_t *value)
 get the chip register
uint8_t bmp180_info (bmp180_info_t *info)
 get chip's information

Detailed Description

driver bmp180 source file

Copyright (c) 2015 - present LibDriver All rights reserved

The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Version
2.0.0
Author
Shifeng Li
Date
2021-02-21

history

Date Version Author Description
2021/02/21 2.0 Shifeng Li format the code
2020/10/17 1.0 Shifeng Li first upload

Definition in file driver_bmp180.c.

Macro Definition Documentation

◆ BMP180_ADDRESS

#define BMP180_ADDRESS   0xEE

chip address definition

iic device address

Definition at line 55 of file driver_bmp180.c.

◆ BMP180_REG_AC1_LSB

#define BMP180_REG_AC1_LSB   0xAB

ac1 lsb register

Definition at line 61 of file driver_bmp180.c.

◆ BMP180_REG_AC1_MSB

#define BMP180_REG_AC1_MSB   0xAA

chip register definition

ac1 msb register

Definition at line 60 of file driver_bmp180.c.

◆ BMP180_REG_AC2_LSB

#define BMP180_REG_AC2_LSB   0xAD

ac2 lsb register

Definition at line 63 of file driver_bmp180.c.

◆ BMP180_REG_AC2_MSB

#define BMP180_REG_AC2_MSB   0xAC

ac2 msb register

Definition at line 62 of file driver_bmp180.c.

◆ BMP180_REG_AC3_LSB

#define BMP180_REG_AC3_LSB   0xAF

ac3 lsb register

Definition at line 65 of file driver_bmp180.c.

◆ BMP180_REG_AC3_MSB

#define BMP180_REG_AC3_MSB   0xAE

ac3 msb register

Definition at line 64 of file driver_bmp180.c.

◆ BMP180_REG_AC4_LSB

#define BMP180_REG_AC4_LSB   0xB1

ac4 lsb register

Definition at line 67 of file driver_bmp180.c.

◆ BMP180_REG_AC4_MSB

#define BMP180_REG_AC4_MSB   0xB0

ac4 msb register

Definition at line 66 of file driver_bmp180.c.

◆ BMP180_REG_AC5_LSB

#define BMP180_REG_AC5_LSB   0xB3

ac5 lsb register

Definition at line 69 of file driver_bmp180.c.

◆ BMP180_REG_AC5_MSB

#define BMP180_REG_AC5_MSB   0xB2

ac5 msb register

Definition at line 68 of file driver_bmp180.c.

◆ BMP180_REG_AC6_LSB

#define BMP180_REG_AC6_LSB   0xB5

ac6 lsb register

Definition at line 71 of file driver_bmp180.c.

◆ BMP180_REG_AC6_MSB

#define BMP180_REG_AC6_MSB   0xB4

ac6 msb register

Definition at line 70 of file driver_bmp180.c.

◆ BMP180_REG_B1_LSB

#define BMP180_REG_B1_LSB   0xB7

b1 lsb register

Definition at line 73 of file driver_bmp180.c.

◆ BMP180_REG_B1_MSB

#define BMP180_REG_B1_MSB   0xB6

b1 msb register

Definition at line 72 of file driver_bmp180.c.

◆ BMP180_REG_B2_LSB

#define BMP180_REG_B2_LSB   0xB9

b2 lsb register

Definition at line 75 of file driver_bmp180.c.

◆ BMP180_REG_B2_MSB

#define BMP180_REG_B2_MSB   0xB8

b2 msb register

Definition at line 74 of file driver_bmp180.c.

◆ BMP180_REG_CTRL_MEAS

#define BMP180_REG_CTRL_MEAS   0xF4

ctrl meas register

Definition at line 82 of file driver_bmp180.c.

◆ BMP180_REG_ID

#define BMP180_REG_ID   0xD0

chip id register

Definition at line 87 of file driver_bmp180.c.

◆ BMP180_REG_MB_LSB

#define BMP180_REG_MB_LSB   0xBB

mb lsb register

Definition at line 77 of file driver_bmp180.c.

◆ BMP180_REG_MB_MSB

#define BMP180_REG_MB_MSB   0xBA

mb msb register

Definition at line 76 of file driver_bmp180.c.

◆ BMP180_REG_MC_LSB

#define BMP180_REG_MC_LSB   0xBD

mc lsb register

Definition at line 79 of file driver_bmp180.c.

◆ BMP180_REG_MC_MSB

#define BMP180_REG_MC_MSB   0xBC

mc msb register

Definition at line 78 of file driver_bmp180.c.

◆ BMP180_REG_MD_LSB

#define BMP180_REG_MD_LSB   0xBF

md lsb register

Definition at line 81 of file driver_bmp180.c.

◆ BMP180_REG_MD_MSB

#define BMP180_REG_MD_MSB   0xBE

md msb register

Definition at line 80 of file driver_bmp180.c.

◆ BMP180_REG_OUT_LSB

#define BMP180_REG_OUT_LSB   0xF7

data out lsb register

Definition at line 84 of file driver_bmp180.c.

◆ BMP180_REG_OUT_MSB

#define BMP180_REG_OUT_MSB   0xF6

data out msb register

Definition at line 83 of file driver_bmp180.c.

◆ BMP180_REG_OUT_XLSB

#define BMP180_REG_OUT_XLSB   0xF8

data xlsb register

Definition at line 85 of file driver_bmp180.c.

◆ BMP180_REG_SOFT

#define BMP180_REG_SOFT   0xE0

soft reset register

Definition at line 86 of file driver_bmp180.c.

◆ CHIP_NAME

#define CHIP_NAME   "Bosch BMP180"

chip information definition

chip name

Definition at line 43 of file driver_bmp180.c.

◆ DRIVER_VERSION

#define DRIVER_VERSION   2000

driver version

Definition at line 50 of file driver_bmp180.c.

◆ MANUFACTURER_NAME

#define MANUFACTURER_NAME   "Bosch"

manufacturer name

Definition at line 44 of file driver_bmp180.c.

◆ MAX_CURRENT

#define MAX_CURRENT   0.65f

chip max current

Definition at line 47 of file driver_bmp180.c.

◆ SUPPLY_VOLTAGE_MAX

#define SUPPLY_VOLTAGE_MAX   3.6f

chip max supply voltage

Definition at line 46 of file driver_bmp180.c.

◆ SUPPLY_VOLTAGE_MIN

#define SUPPLY_VOLTAGE_MIN   1.8f

chip min supply voltage

Definition at line 45 of file driver_bmp180.c.

◆ TEMPERATURE_MAX

#define TEMPERATURE_MAX   85.0f

chip max operating temperature

Definition at line 49 of file driver_bmp180.c.

◆ TEMPERATURE_MIN

#define TEMPERATURE_MIN   -40.0f

chip min operating temperature

Definition at line 48 of file driver_bmp180.c.