bmp180 - Driver for BMP180 digital pressure sensor

group bmp180

ESP-IDF driver for BMP180 digital pressure sensor.

Ported from esp-open-rtos

Copyright (C) 2015 Frank Bargstedt

Copyright (C) 2018 Ruslan V. Uss

unclerus@gmail.com

MIT Licensed as described in the file LICENSE

Defines

BMP180_DEVICE_ADDRESS

I2C address.

Enums

enum bmp180_mode_t

Hardware accuracy mode.

See Table 3 of the datasheet

Values:

enumerator BMP180_MODE_ULTRA_LOW_POWER

1 sample, 4.5 ms

enumerator BMP180_MODE_STANDARD

2 samples, 7.5 ms

enumerator BMP180_MODE_HIGH_RESOLUTION

4 samples, 13.5 ms

enumerator BMP180_MODE_ULTRA_HIGH_RESOLUTION

8 samples, 25.5 ms

Functions

esp_err_t bmp180_init_desc(bmp180_dev_t *dev, i2c_port_t port, gpio_num_t sda_gpio, gpio_num_t scl_gpio)

Initialize device descriptor.

Parameters
  • dev – Device descriptor

  • port – I2C port number

  • sda_gpio – GPIO pin number for SDA

  • scl_gpio – GPIO pin number for SCL

Returns

ESP_OK on success

esp_err_t bmp180_free_desc(bmp180_dev_t *dev)

Free device descriptor.

Parameters

dev – Pointer to BMP180 device descriptor

Returns

ESP_OK on success

esp_err_t bmp180_init(bmp180_dev_t *dev)

Initialize device.

Parameters

dev – Pointer to BMP180 device descriptor

Returns

ESP_OK on success

esp_err_t bmp180_measure(bmp180_dev_t *dev, float *temperature, uint32_t *pressure, bmp180_mode_t oss)

Measure temperature and pressure.

Parameters
  • dev – Pointer to BMP180 device descriptor

  • [out] temperature – Temperature in degrees Celsius

  • [out] pressure – Pressure in Pa

  • oss – Measurement mode

Returns

ESP_OK on success

struct bmp180_dev_t
#include <bmp180.h>

BMP180 device descriptor.