2011-11-27 07:36:01 +01:00
|
|
|
/**
|
|
|
|
******************************************************************************
|
|
|
|
* @addtogroup PIOS PIOS Core hardware abstraction layer
|
|
|
|
* @{
|
2012-01-05 02:29:29 +01:00
|
|
|
* @addtogroup PIOS_MS5611 MS5611 Functions
|
2011-11-27 07:36:01 +01:00
|
|
|
* @brief Hardware functions to deal with the altitude pressure sensor
|
|
|
|
* @{
|
|
|
|
*
|
2013-05-19 16:37:30 +02:00
|
|
|
* @file pios_ms5611.h
|
2012-01-05 02:29:29 +01:00
|
|
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
|
2011-11-27 07:36:01 +01:00
|
|
|
* @brief MS5611 functions header.
|
|
|
|
* @see The GNU Public License (GPL) Version 3
|
|
|
|
*
|
|
|
|
*****************************************************************************/
|
2013-05-19 16:37:30 +02:00
|
|
|
/*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2011-11-27 07:36:01 +01:00
|
|
|
* (at your option) any later version.
|
2013-05-19 16:37:30 +02:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
|
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
2011-11-27 07:36:01 +01:00
|
|
|
* for more details.
|
2013-05-19 16:37:30 +02:00
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
2011-11-27 07:36:01 +01:00
|
|
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PIOS_MS5611_H
|
|
|
|
#define PIOS_MS5611_H
|
2014-12-29 12:54:02 +01:00
|
|
|
#include <pios_sensors.h>
|
2011-11-27 07:36:01 +01:00
|
|
|
/* BMP085 Addresses */
|
2013-05-19 16:37:30 +02:00
|
|
|
#define MS5611_I2C_ADDR 0x77
|
|
|
|
#define MS5611_RESET 0x1E
|
|
|
|
#define MS5611_CALIB_ADDR 0xA2 /* First sample is factory stuff */
|
|
|
|
#define MS5611_CALIB_LEN 16
|
|
|
|
#define MS5611_ADC_READ 0x00
|
|
|
|
#define MS5611_PRES_ADDR 0x40
|
|
|
|
#define MS5611_TEMP_ADDR 0x50
|
|
|
|
#define MS5611_ADC_MSB 0xF6
|
2011-11-27 07:36:01 +01:00
|
|
|
|
|
|
|
struct pios_ms5611_cfg {
|
2013-05-19 16:37:30 +02:00
|
|
|
uint32_t oversampling;
|
2011-11-27 07:36:01 +01:00
|
|
|
};
|
|
|
|
|
2012-02-13 08:49:54 +01:00
|
|
|
enum pios_ms5611_osr {
|
2013-05-19 16:37:30 +02:00
|
|
|
MS5611_OSR_256 = 0,
|
|
|
|
MS5611_OSR_512 = 2,
|
|
|
|
MS5611_OSR_1024 = 4,
|
|
|
|
MS5611_OSR_2048 = 6,
|
|
|
|
MS5611_OSR_4096 = 8,
|
2012-02-13 08:49:54 +01:00
|
|
|
};
|
|
|
|
|
2011-11-27 07:36:01 +01:00
|
|
|
/* Public Functions */
|
2013-05-19 16:37:30 +02:00
|
|
|
extern void PIOS_MS5611_Init(const struct pios_ms5611_cfg *cfg, int32_t i2c_device);
|
2014-12-29 12:54:02 +01:00
|
|
|
extern const PIOS_SENSORS_Driver PIOS_MS5611_Driver;
|
|
|
|
void PIOS_MS5611_Register();
|
2011-11-27 07:36:01 +01:00
|
|
|
|
|
|
|
#endif /* PIOS_MS5611_H */
|
|
|
|
|
2013-05-19 16:37:30 +02:00
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
* @}
|
|
|
|
*/
|