Added support for other MS58XX altimeters.

This commit is contained in:
Paul A. Patience
2015-08-14 13:47:18 -04:00
parent eb19e0c0e2
commit 3303ef8c85
5 changed files with 1083 additions and 732 deletions
+7 -3
View File
@@ -31,12 +31,16 @@ config MB7040
---help--- ---help---
Enable driver support for the MaxBotix MB7040 sonar. Enable driver support for the MaxBotix MB7040 sonar.
config MS5805 config MS58XX
bool "MEAS MS5805 Altimeter support" bool "MEAS MS58XX Altimeter support"
default n default n
select I2C select I2C
---help--- ---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 config MPL115A
bool "Freescale MPL115A Barometer Sensor support" bool "Freescale MPL115A Barometer Sensor support"
+2 -2
View File
@@ -73,8 +73,8 @@ ifeq ($(CONFIG_MB7040),y)
CSRCS += mb7040.c CSRCS += mb7040.c
endif endif
ifeq ($(CONFIG_MS5805),y) ifeq ($(CONFIG_MS58XX),y)
CSRCS += ms5805.c CSRCS += ms58xx.c
endif endif
endif # CONFIG_I2C endif # CONFIG_I2C
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -1,5 +1,5 @@
/**************************************************************************** /****************************************************************************
* include/nuttx/sensors/ms5805.h * include/nuttx/sensors/ms58xx.h
* *
* Copyright (C) 2015 Omni Hoverboards Inc. All rights reserved. * Copyright (C) 2015 Omni Hoverboards Inc. All rights reserved.
* Author: Paul Alexander Patience <paul-a.patience@polymtl.ca> * Author: Paul Alexander Patience <paul-a.patience@polymtl.ca>
@@ -33,8 +33,8 @@
* *
****************************************************************************/ ****************************************************************************/
#ifndef __INCLUDE_NUTTX_SENSORS_MS5805 #ifndef __INCLUDE_NUTTX_SENSORS_MS58XX
#define __INCLUDE_NUTTX_SENSORS_MS5805 #define __INCLUDE_NUTTX_SENSORS_MS58XX
/**************************************************************************** /****************************************************************************
* Included Files * Included Files
@@ -43,7 +43,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <nuttx/fs/ioctl.h> #include <nuttx/fs/ioctl.h>
#if defined(CONFIG_I2C) && defined(CONFIG_MS5805) #if defined(CONFIG_I2C) && defined(CONFIG_MS58XX)
/**************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
@@ -53,8 +53,9 @@
* *
* CONFIG_I2C * CONFIG_I2C
* Enables support for I2C drivers * Enables support for I2C drivers
* CONFIG_MS5805 * CONFIG_MS58XX
* Enables support for the MS5805 driver * Enables support for the MS58XX driver
* CONFIG_MS58XX_VDD
*/ */
/* IOCTL Commands ***********************************************************/ /* IOCTL Commands ***********************************************************/
@@ -65,10 +66,27 @@
#define SNIOC_RESET _SNIOC(0x0004) /* Arg: None */ #define SNIOC_RESET _SNIOC(0x0004) /* Arg: None */
#define SNIOC_OVERSAMPLING _SNIOC(0x0005) /* Arg: uint16_t value */ #define SNIOC_OVERSAMPLING _SNIOC(0x0005) /* Arg: uint16_t value */
/* I2C Address **************************************************************/
#define MS58XX_ADDR0 0x76
#define MS58XX_ADDR1 0x77
/**************************************************************************** /****************************************************************************
* Public Types * 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; struct i2c_dev_s;
/**************************************************************************** /****************************************************************************
@@ -84,28 +102,30 @@ extern "C"
#endif #endif
/**************************************************************************** /****************************************************************************
* Name: ms5805_register * Name: ms58xx_register
* *
* Description: * Description:
* Register the MS5805 character device as 'devpath'. * Register the MS58XX character device as 'devpath'.
* *
* Input Parameters: * Input Parameters:
* devpath - The full path to the driver to register, e.g., "/dev/press0". * devpath - The full path to the driver to register, e.g., "/dev/press0".
* i2c - An I2C driver instance. * i2c - An I2C driver instance.
* addr - The I2C address of the MS58XX.
* osr - The oversampling ratio. * osr - The oversampling ratio.
* model - The MS58XX model.
* *
* Returned Value: * Returned Value:
* Zero (OK) on success; a negated errno value on failure. * Zero (OK) on success; a negated errno value on failure.
* *
****************************************************************************/ ****************************************************************************/
int ms5805_register(FAR const char *devpath, FAR struct i2c_dev_s *i2c, int ms58xx_register(FAR const char *devpath, FAR struct i2c_dev_s *i2c,
uint16_t osr); uint8_t addr, uint16_t osr, enum ms58xx_model_e model);
#undef EXTERN #undef EXTERN
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* CONFIG_I2C && CONFIG_MS5805 */ #endif /* CONFIG_I2C && CONFIG_MS58XX */
#endif /* __INCLUDE_NUTTX_SENSORS_MS5805 */ #endif /* __INCLUDE_NUTTX_SENSORS_MS58XX */