Paparazzi UAS  v5.15_devel-112-g521f3cf
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
ms5611_regs.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 Piotr Esden-Tempski
3  *
4  * This file is part of paparazzi.
5  *
6  * paparazzi is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * paparazzi is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with paparazzi; see the file COPYING. If not, write to
18  * the Free Software Foundation, 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21 
27 #ifndef MS5611_REGS_H
28 #define MS5611_REGS_H
29 
34 #define MS5611_I2C_SLAVE_ADDR 0xEE
35 #define MS5611_I2C_SLAVE_ADDR_ALT 0xEC
36 
37 /* Number of 16bit calibration coefficients */
38 #define PROM_NB 8
39 
40 /* OSR definitions */
41 #define MS5611_OSR256 0x02
42 #define MS5611_OSR512 0x02
43 #define MS5611_OSR1024 0x04
44 #define MS5611_OSR2048 0x06
45 #define MS5611_OSR4096 0x08
46 
47 /* D1 Register defines */
48 #define MS5611_REG_D1R 0x40 // Request D1 (pressure) conversion
49 #define MS5611_REG_D1(_osr) (MS5611_REG_D1R | _osr)
50 #define MS5611_REG_D1OSR256 MS5611_REG_D1(MS5611_ORS256)
51 #define MS5611_REG_D1OSR512 MS5611_REG_D1(MS5611_OSR512)
52 #define MS5611_REG_D1OSR1024 MS5611_REG_D1(MS5611_OSR1024)
53 #define MS5611_REG_D1OSR2048 MS5611_REG_D1(MS5611_OSR2048)
54 #define MS5611_REG_D1OSR4096 MS5611_REG_D1(MS5611_OSR4096)
55 
56 /* D2 register defines */
57 #define MS5611_REG_D2R 0x50 // Request D2 (temperature) conversion
58 #define MS5611_REG_D2(_osr) (MS5611_REG_D2R | _osr)
59 #define MS5611_REG_D2OSR256 MS5611_REG_D2(MS5611_ORS256)
60 #define MS5611_REG_D2OSR512 MS5611_REG_D2(MS5611_OSR512)
61 #define MS5611_REG_D2OSR1024 MS5611_REG_D2(MS5611_OSR1024)
62 #define MS5611_REG_D2OSR2048 MS5611_REG_D2(MS5611_OSR2048)
63 #define MS5611_REG_D2OSR4096 MS5611_REG_D2(MS5611_OSR4096)
64 
65 /* Commands */
66 #define MS5611_ADC_READ 0x00 // Read converted value
67 #define MS5611_SOFT_RESET 0x1E // Reset command
68 #define MS5611_PROM_READ 0xA0 // Start reading PROM
69 #define MS5611_START_CONV_D1 MS5611_REG_D1OSR4096 /* we use OSR=4096 for maximum resolution */
70 #define MS5611_START_CONV_D2 MS5611_REG_D2OSR4096 /* we use OSR=4096 for maximum resolution */
71 
72 #endif /* MS5611_REGS_H */