Paparazzi UAS  v5.2.2_stable-0-gd6b9f29
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
baro_board.c
Go to the documentation of this file.
1  /*
2  * Copyright (C) 2010 Christoph Niemann
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  */
22 
27 #include "std.h"
28 #include "baro_board.h"
30 #include "peripherals/bmp085.h"
32 #include "subsystems/abi.h"
33 #include "led.h"
34 
36 
37 void baro_init( void ) {
39 #ifdef BARO_LED
40  LED_OFF(BARO_LED);
41 #endif
42 }
43 
44 void baro_periodic( void ) {
47  }
48  else {
50  }
51 }
52 
53 void bmp_baro_event(void) {
55 
57  float pressure = (float)baro_bmp085.pressure;
58  AbiSendMsgBARO_ABS(BARO_BOARD_SENDER_ID, &pressure);
60 #ifdef BARO_LED
61  RunOnceEvery(10,LED_TOGGLE(BARO_LED));
62 #endif
63  }
64 }
void bmp_baro_event(void)
Definition: baro_board.c:53
Common barometric sensor implementation.
Main include for ABI (AirBorneInterface).
struct Bmp085 baro_bmp085
Definition: baro_board.c:35
void baro_init(void)
Definition: baro_board.c:68
int32_t pressure
pressure in Pascal
Definition: bmp085.h:73
#define FALSE
Definition: imu_chimu.h:141
void baro_periodic(void)
Definition: baro_board.c:76
Bosch BMP085 driver interface.
#define BMP085_SLAVE_ADDR
Definition: bmp085_regs.h:57
void bmp085_read_eeprom_calib(struct Bmp085 *bmp)
Definition: bmp085.c:73
bool_t initialized
config done flag
Definition: bmp085.h:67
#define BARO_BOARD_SENDER_ID
default onboard baro
volatile bool_t data_available
data ready flag
Definition: bmp085.h:68
Definition: bmp085.h:62
#define LED_TOGGLE(i)
Definition: led_hw.h:30
void bmp085_init(struct Bmp085 *bmp, struct i2c_periph *i2c_p, uint8_t addr)
Definition: bmp085.c:83
Bosch BMP085 register definitions.
#define LED_OFF(i)
Definition: led_hw.h:29
arch independent LED (Light Emitting Diodes) API
Baro board interface for Bosch BMP085 on HBmini I2C1 with EOC check.
void bmp085_periodic(struct Bmp085 *bmp)
Start new measurement if idle or read temp/pressure.
Definition: bmp085.c:108
void bmp085_event(struct Bmp085 *bmp)
Definition: bmp085.c:142