Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
baro_board.h
Go to the documentation of this file.
1 
2 /*
3  * board specific fonctions for the lisa_l board
4  *
5  */
6 
7 #ifndef BOARDS_LISA_L_BARO_H
8 #define BOARDS_LISA_L_BARO_H
9 
10 #include "std.h"
11 #include "mcu_periph/i2c.h"
12 
25 };
26 
27 struct BaroBoard {
29 };
30 
31 extern struct BaroBoard baro_board;
32 extern struct i2c_transaction baro_trans;
33 
34 extern void baro_board_send_reset(void);
35 extern void baro_board_send_config_abs(void);
36 extern void baro_board_send_config_diff(void);
37 
38 #define BaroEvent(_b_abs_handler, _b_diff_handler) { \
39  if (baro_board.status == LBS_READING_ABS && \
40  baro_trans.status != I2CTransPending) { \
41  baro_board.status = LBS_READ_ABS; \
42  if (baro_trans.status == I2CTransSuccess) { \
43  int16_t tmp = baro_trans.buf[0]<<8 | baro_trans.buf[1]; \
44  baro.absolute = tmp; \
45  _b_abs_handler(); \
46  } \
47  } \
48  else if (baro_board.status == LBS_READING_DIFF && \
49  baro_trans.status != I2CTransPending) { \
50  baro_board.status = LBS_READ_DIFF; \
51  if (baro_trans.status == I2CTransSuccess) { \
52  int16_t tmp = baro_trans.buf[0]<<8 | baro_trans.buf[1]; \
53  baro.differential = tmp; \
54  _b_diff_handler(); \
55  } \
56  } \
57  }
58 
59 
60 
61 
62 #endif /* BOARDS_LISA_L_BARO_H */
LisaBaroStatus
Definition: baro_board.h:13
struct BaroBoard baro_board
Definition: baro_board.c:35
void baro_board_send_config_diff(void)
Definition: baro_board.c:80
void baro_board_send_reset(void)
Definition: baro_board.c:84
void baro_board_send_config_abs(void)
Definition: baro_board.c:69
struct i2c_transaction baro_trans
Definition: baro_board.c:6
enum LisaBaroStatus status
Definition: baro_board.h:28
Architecture independent I2C (Inter-Integrated Circuit Bus) API.