Paparazzi UAS  v4.2.2_stable-4-gcc32f65
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
baro_board.h
Go to the documentation of this file.
1 #ifndef BOARDS_BOOZ_BARO_H
2 #define BOARDS_BOOZ_BARO_H
3 
4 #include "std.h"
5 
7 #include "mcu_periph/adc.h"
8 #include "mcu_periph/dac.h"
9 
10 
11 struct BaroBoard {
15  struct adc_buf buf;
16 };
17 
18 extern struct BaroBoard baro_board;
19 
20 extern void baro_board_calibrate(void);
21 
22 #define BaroEvent(_b_abs_handler, _b_diff_handler) { \
23  if (baro_board.data_available) { \
24  _b_abs_handler(); \
25  baro_board.data_available = FALSE; \
26  } \
27  }
28 
29 static inline void baro_board_SetOffset(uint16_t _o) {
30  baro_board.offset = _o;
31  DACSet(_o);
32 }
33 
34 
35 #endif /* BOARDS_BOOZ_BARO_H */
unsigned short uint16_t
Definition: types.h:16
void baro_board_calibrate(void)
Definition: baro_board.c:68
uint16_t offset
Definition: baro_board.h:12
arch independent ADC (Analog to Digital Converter) API
static void baro_board_SetOffset(uint16_t _o)
Definition: baro_board.h:29
struct BaroBoard baro_board
Definition: baro_board.c:35
uint16_t value_filtered
Definition: baro_board.h:13
Generic interface for all ADC hardware drivers, independent from microcontroller architecture.
Definition: adc.h:60
bool_t data_available
Definition: baro_board.h:14
static void DACSet(uint16_t x)
Definition: dac_arch.h:7
struct adc_buf buf
Definition: baro_board.h:15