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 descriptior.

Return

ESP_OK on success

Parameters
  • [out] dev: Pointer to device descriptor

  • port: I2C port number

  • sda_gpio: GPIO pin number for SDA

  • scl_gpio: GPIO pin number for SCL

esp_err_t bmp180_free_desc(bmp180_dev_t *dev)

Free device descriptor.

Return

ESP_OK on success

Parameters
  • dev: Pointer to BMP180 device descriptor

esp_err_t bmp180_init(bmp180_dev_t *dev)

Init bmp180 device.

Return

ESP_OK on success

Parameters
  • dev: Pointer to BMP180 device descriptor

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

Measure temperature and pressure.

Return

ESP_OK on success

Parameters
  • dev: Pointer to BMP180 device descriptor

  • [out] temperature: Temperature in degrees Celsius

  • [out] pressure: Pressure in Pa

  • oss: Measurement mode

struct bmp180_dev_t
#include <bmp180.h>

BMP180 device descriptor.