Skip to content
Snippets Groups Projects
Commit 1c41236f authored by Gregory Nutt's avatar Gregory Nutt
Browse files

Merged in paulpatience/nuttx (pull request #18)

Added support for other MS58XX altimeters.
parents 8f7453b5 3303ef8c
No related branches found
No related tags found
No related merge requests found
......@@ -31,12 +31,16 @@ config MB7040
---help---
Enable driver support for the MaxBotix MB7040 sonar.
config MS5805
bool "MEAS MS5805 Altimeter support"
config MS58XX
bool "MEAS MS58XX Altimeter support"
default n
select I2C
---help---
Enable driver support for the MEAS MS5805 altimeter.
Enable driver support for MEAS MS58XX altimeters.
config MS58XX_VDD
int "MEAS MS58XX VDD"
default 30
config MPL115A
bool "Freescale MPL115A Barometer Sensor support"
......
......@@ -73,8 +73,8 @@ ifeq ($(CONFIG_MB7040),y)
CSRCS += mb7040.c
endif
ifeq ($(CONFIG_MS5805),y)
CSRCS += ms5805.c
ifeq ($(CONFIG_MS58XX),y)
CSRCS += ms58xx.c
endif
endif # CONFIG_I2C
......
This diff is collapsed.
/****************************************************************************
* include/nuttx/sensors/ms5805.h
* include/nuttx/sensors/ms58xx.h
*
* Copyright (C) 2015 Omni Hoverboards Inc. All rights reserved.
* Author: Paul Alexander Patience <paul-a.patience@polymtl.ca>
......@@ -33,8 +33,8 @@
*
****************************************************************************/
#ifndef __INCLUDE_NUTTX_SENSORS_MS5805
#define __INCLUDE_NUTTX_SENSORS_MS5805
#ifndef __INCLUDE_NUTTX_SENSORS_MS58XX
#define __INCLUDE_NUTTX_SENSORS_MS58XX
/****************************************************************************
* Included Files
......@@ -43,7 +43,7 @@
#include <nuttx/config.h>
#include <nuttx/fs/ioctl.h>
#if defined(CONFIG_I2C) && defined(CONFIG_MS5805)
#if defined(CONFIG_I2C) && defined(CONFIG_MS58XX)
/****************************************************************************
* Pre-processor Definitions
......@@ -53,8 +53,9 @@
*
* CONFIG_I2C
* Enables support for I2C drivers
* CONFIG_MS5805
* Enables support for the MS5805 driver
* CONFIG_MS58XX
* Enables support for the MS58XX driver
* CONFIG_MS58XX_VDD
*/
/* IOCTL Commands ***********************************************************/
......@@ -65,10 +66,27 @@
#define SNIOC_RESET _SNIOC(0x0004) /* Arg: None */
#define SNIOC_OVERSAMPLING _SNIOC(0x0005) /* Arg: uint16_t value */
/* I2C Address **************************************************************/
#define MS58XX_ADDR0 0x76
#define MS58XX_ADDR1 0x77
/****************************************************************************
* Public Types
****************************************************************************/
enum ms58xx_model_e
{
MS58XX_MODEL_MS5803_02 = 0,
MS58XX_MODEL_MS5803_05 = 1,
MS58XX_MODEL_MS5803_07 = 2,
MS58XX_MODEL_MS5803_14 = 3,
MS58XX_MODEL_MS5803_30 = 4,
MS58XX_MODEL_MS5805_02 = 5,
MS58XX_MODEL_MS5806_02 = 6,
MS58XX_MODEL_MS5837_30 = 7
};
struct i2c_dev_s;
/****************************************************************************
......@@ -84,28 +102,30 @@ extern "C"
#endif
/****************************************************************************
* Name: ms5805_register
* Name: ms58xx_register
*
* Description:
* Register the MS5805 character device as 'devpath'.
* Register the MS58XX character device as 'devpath'.
*
* Input Parameters:
* devpath - The full path to the driver to register, e.g., "/dev/press0".
* i2c - An I2C driver instance.
* addr - The I2C address of the MS58XX.
* osr - The oversampling ratio.
* model - The MS58XX model.
*
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
*
****************************************************************************/
int ms5805_register(FAR const char *devpath, FAR struct i2c_dev_s *i2c,
uint16_t osr);
int ms58xx_register(FAR const char *devpath, FAR struct i2c_dev_s *i2c,
uint8_t addr, uint16_t osr, enum ms58xx_model_e model);
#undef EXTERN
#ifdef __cplusplus
}
#endif
#endif /* CONFIG_I2C && CONFIG_MS5805 */
#endif /* __INCLUDE_NUTTX_SENSORS_MS5805 */
#endif /* CONFIG_I2C && CONFIG_MS58XX */
#endif /* __INCLUDE_NUTTX_SENSORS_MS58XX */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment