Paparazzi UAS
v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
|
#include "std.h"
#include "subsystems/sensors/baro.h"
#include "mcu_periph/i2c.h"
#include "subsystems/abi.h"
#include "led.h"
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 |
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 |
struct BaroBoard |
Definition at line 42 of file baro_board.h.
Data Fields | ||
---|---|---|
int32_t | absolute | |
struct adc_buf | buf | |
uint16_t | offset | |
bool | running | |
enum BaroBoardStatus | status | |
enum LisaBaroStatus | status | |
uint16_t | value_filtered |
#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().
enum 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.
|
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().
Definition at line 194 of file baro_board.c.
References baro_trans, i2c_transaction::buf, i2c_submit(), I2CTransTxRx, i2c_transaction::len_r, i2c_transaction::len_w, i2c_transaction::slave_addr, and i2c_transaction::type.
|
inlinestatic |
Definition at line 157 of file baro_board.c.
References BARO_ABS_ADDR, and baro_board_write_to_register().
Referenced by baro_periodic().
|
inlinestatic |
Definition at line 169 of file baro_board.c.
References baro_board_write_to_register(), and BARO_DIFF_ADDR.
Referenced by baro_periodic().
|
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().
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().
|
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().
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.
void baro_periodic | ( | void | ) |
Definition at line 84 of file baro_board.c.
References BARO_ABS_ADDR, baro_board, baro_board_read_from_current_register(), baro_board_send_config_abs(), baro_board_send_config_diff(), baro_board_send_reset(), baro_board_set_current_register(), BARO_DIFF_ADDR, i2c_idle(), LBS_INITIALIZING_ABS, LBS_INITIALIZING_ABS_1, LBS_INITIALIZING_DIFF, LBS_INITIALIZING_DIFF_1, LBS_READ_ABS, LBS_READ_DIFF, LBS_READING_ABS, LBS_READING_DIFF, LBS_RESETED, LBS_UNINITIALIZED, LED_ON, LED_TOGGLE, BaroBoard::running, BaroBoard::status, and TRUE.
void lisa_l_baro_event | ( | void | ) |
Definition at line 135 of file baro_board.c.
References baro_board, BARO_BOARD_SENDER_ID, baro_trans, i2c_transaction::buf, get_sys_time_usec(), I2CTransPending, I2CTransSuccess, LBS_READ_ABS, LBS_READ_DIFF, LBS_READING_ABS, LBS_READING_DIFF, LISA_L_BARO_SENS, LISA_L_DIFF_SENS, BaroBoard::status, and i2c_transaction::status.
struct BaroBoard baro_board |
Definition at line 49 of file baro_board.c.
Referenced by baro_board_SetOffset().
struct i2c_transaction baro_trans |
Definition at line 50 of file baro_board.c.
Referenced by baro_board_read_from_current_register(), baro_board_read_from_register(), baro_board_send_reset(), baro_board_set_current_register(), baro_board_write_to_register(), and lisa_l_baro_event().