ms5611 - Driver for barometic pressure sensor MS5611-01BA03

group ms5611

ESP-IDF driver for barometic pressure sensor MS5611-01BA03.

Ported from esp-open-rtos

Copyright (C) 2016 Bernhard Guillon Bernhard.Guillon@begu.org

Copyright (C) 2018 Ruslan V. Uss

unclerus@gmail.com

BSD Licensed as described in the file LICENSE

Defines

MS5611_ADDR_CSB_HIGH
MS5611_ADDR_CSB_LOW

Enums

enum ms5611_osr_t

Oversampling ratio.

Values:

enumerator MS5611_OSR_256

256 samples per measurement

enumerator MS5611_OSR_512

512 samples per measurement

enumerator MS5611_OSR_1024

1024 samples per measurement

enumerator MS5611_OSR_2048

2048 samples per measurement

enumerator MS5611_OSR_4096

4096 samples per measurement

Functions

esp_err_t ms5611_init_desc(ms5611_t *dev, uint8_t addr, i2c_port_t port, gpio_num_t sda_gpio, gpio_num_t scl_gpio)

Initialize device descriptior.

Return

ESP_OK on success

Parameters
  • dev: Device descriptor

  • addr: I2C address, MS5611_ADDR_CSB_HIGH or MS5611_ADDR_CSB_LOW

  • port: I2C port

  • sda_gpio: GPIO pin for SDA

  • scl_gpio: GPIO pin for SCL

esp_err_t ms5611_free_desc(ms5611_t *dev)

Free device descriptor.

Return

ESP_OK on success

Parameters
  • dev: Device descriptor

esp_err_t ms5611_init(ms5611_t *dev, ms5611_osr_t osr)

Init MS5611-01BA03 Reset device and read calibration data.

Return

ESP_OK on success

Parameters
  • dev: Device descriptor

  • osr: Oversampling ratio

esp_err_t ms5611_get_sensor_data(ms5611_t *dev, int32_t *pressure, float *temperature)

Measure pressure and temperature.

Return

ESP_OK on success

Parameters
  • dev: Device descriptor

  • [out] pressure: Pressure, Pa

  • [out] temperature: Temperature, degrees Celsius

struct ms5611_config_data_t
#include <ms5611.h>

Configuration data.

struct ms5611_t
#include <ms5611.h>

Device descriptor.