Paparazzi UAS  v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
baro_board.c File Reference
#include "std.h"
#include "subsystems/sensors/baro.h"
#include "mcu_periph/i2c.h"
#include "subsystems/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

struct BaroBoard

Definition at line 42 of file baro_board.h.

+ Collaboration diagram for BaroBoard:
Data Fields
int32_t absolute
struct adc_buf buf
uint16_t offset
bool running
enum BaroBoardStatus status
enum LisaBaroStatus status
uint16_t value_filtered

Macro Definition Documentation

#define BARO_ABS_ADDR   0x90

Definition at line 61 of file baro_board.c.

Referenced by baro_board_send_config_abs(), and baro_periodic().

#define BARO_DIFF_ADDR   0x92

Definition at line 63 of file baro_board.c.

Referenced by baro_board_send_config_diff(), and baro_periodic().

#define LISA_L_BARO_SENS   1.0

Definition at line 67 of file baro_board.c.

Referenced by lisa_l_baro_event().

#define LISA_L_DIFF_SENS   1.0

Definition at line 71 of file baro_board.c.

Referenced by lisa_l_baro_event().

Enumeration Type Documentation

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

static void baro_board_read_from_current_register ( uint8_t  baro_addr)
inlinestatic

Definition at line 217 of file baro_board.c.

References baro_trans, i2c_submit(), I2CTransRx, i2c_transaction::len_r, 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:

static void baro_board_read_from_register ( uint8_t  baro_addr,
uint8_t  reg_addr 
)
inlinestatic
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:

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:

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:

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:

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:

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.

Variable Documentation

struct BaroBoard baro_board

Definition at line 49 of file baro_board.c.

Referenced by baro_board_SetOffset().