Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
baro_board.c File Reference
#include "std.h"
#include "modules/sensors/baro.h"
#include "mcu_periph/i2c.h"
#include "modules/core/abi.h"
#include "led.h"
+ Include dependency graph for baro_board.c:

Go to the source code of this file.

Data Structures

struct  BaroBoard
 

Macros

#define BARO_ABS_ADDR   0x90
 
#define BARO_DIFF_ADDR   0x92
 
#define LISA_L_BARO_SENS   1.0
 
#define LISA_L_DIFF_SENS   1.0
 

Enumerations

enum  LisaBaroStatus {
  LBS_UNINITIALIZED , LBS_RESETED , LBS_INITIALIZING_ABS , LBS_INITIALIZING_ABS_1 ,
  LBS_INITIALIZING_DIFF , LBS_INITIALIZING_DIFF_1 , LBS_IDLE , LBS_READING_ABS ,
  LBS_READ_ABS , LBS_READING_DIFF , LBS_READ_DIFF
}
 

Functions

static void baro_board_send_reset (void)
 
static void baro_board_send_config_abs (void)
 
static void baro_board_send_config_diff (void)
 
static void baro_board_write_to_register (uint8_t baro_addr, uint8_t reg_addr, uint8_t val_msb, uint8_t val_lsb)
 
static void baro_board_read_from_register (uint8_t baro_addr, uint8_t reg_addr)
 
static void baro_board_set_current_register (uint8_t baro_addr, uint8_t reg_addr)
 
static void baro_board_read_from_current_register (uint8_t baro_addr)
 
void baro_init (void)
 
void baro_periodic (void)
 
void lisa_l_baro_event (void)
 

Variables

struct BaroBoard baro_board
 
struct i2c_transaction baro_trans
 

Data Structure Documentation

◆ BaroBoard

struct BaroBoard

Definition at line 43 of file baro_board.c.

Data Fields
bool running
enum LisaBaroStatus status

Macro Definition Documentation

◆ BARO_ABS_ADDR

#define BARO_ABS_ADDR   0x90

Definition at line 61 of file baro_board.c.

◆ BARO_DIFF_ADDR

#define BARO_DIFF_ADDR   0x92

Definition at line 63 of file baro_board.c.

◆ LISA_L_BARO_SENS

#define LISA_L_BARO_SENS   1.0

Definition at line 67 of file baro_board.c.

◆ LISA_L_DIFF_SENS

#define LISA_L_DIFF_SENS   1.0

Definition at line 71 of file baro_board.c.

Enumeration Type Documentation

◆ LisaBaroStatus

Enumerator
LBS_UNINITIALIZED 
LBS_RESETED 
LBS_INITIALIZING_ABS 
LBS_INITIALIZING_ABS_1 
LBS_INITIALIZING_DIFF 
LBS_INITIALIZING_DIFF_1 
LBS_IDLE 
LBS_READING_ABS 
LBS_READ_ABS 
LBS_READING_DIFF 
LBS_READ_DIFF 

Definition at line 29 of file baro_board.c.

Function Documentation

◆ baro_board_read_from_current_register()

static void baro_board_read_from_current_register ( uint8_t  baro_addr)
inlinestatic

Definition at line 217 of file baro_board.c.

Referenced by baro_periodic().

+ Here is the caller graph for this function:

◆ baro_board_read_from_register()

static void baro_board_read_from_register ( uint8_t  baro_addr,
uint8_t  reg_addr 
)
inlinestatic

◆ baro_board_send_config_abs()

static void baro_board_send_config_abs ( void  )
inlinestatic

Definition at line 157 of file baro_board.c.

References BARO_ABS_ADDR, and baro_board_write_to_register().

Referenced by baro_periodic().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ baro_board_send_config_diff()

static void baro_board_send_config_diff ( void  )
inlinestatic

Definition at line 169 of file baro_board.c.

References baro_board_write_to_register(), and BARO_DIFF_ADDR.

Referenced by baro_periodic().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ baro_board_send_reset()

static void baro_board_send_reset ( void  )
inlinestatic

Definition at line 174 of file baro_board.c.

References baro_trans, i2c_transaction::buf, i2c_submit(), I2CTransTx, i2c_transaction::len_w, i2c_transaction::slave_addr, and i2c_transaction::type.

Referenced by baro_periodic().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ baro_board_set_current_register()

static void baro_board_set_current_register ( uint8_t  baro_addr,
uint8_t  reg_addr 
)
inlinestatic

Definition at line 206 of file baro_board.c.

References baro_trans, i2c_transaction::buf, i2c_submit(), I2CTransTx, i2c_transaction::len_w, i2c_transaction::slave_addr, and i2c_transaction::type.

Referenced by baro_periodic().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ baro_board_write_to_register()

static void baro_board_write_to_register ( uint8_t  baro_addr,
uint8_t  reg_addr,
uint8_t  val_msb,
uint8_t  val_lsb 
)
inlinestatic

Definition at line 183 of file baro_board.c.

References baro_trans, i2c_transaction::buf, i2c_submit(), I2CTransTx, i2c_transaction::len_w, i2c_transaction::slave_addr, and i2c_transaction::type.

Referenced by baro_board_send_config_abs(), and baro_board_send_config_diff().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ baro_init()

void baro_init ( void  )

Definition at line 74 of file baro_board.c.

References baro_board, LBS_UNINITIALIZED, LED_OFF, BaroBoard::running, and BaroBoard::status.

◆ baro_periodic()

◆ lisa_l_baro_event()

Variable Documentation

◆ baro_board

struct BaroBoard baro_board

Definition at line 1 of file baro_board.c.

Referenced by baro_init(), baro_periodic(), and lisa_l_baro_event().

◆ baro_trans