NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
barometer.c File Reference
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include <math.h>
#include <platform.h>
#include "build_config.h"
#include "common/maths.h"
#include "drivers/barometer.h"
#include "drivers/system.h"
#include "config/config.h"
#include "sensors/barometer.h"
Include dependency graph for barometer.c:

Macros

#define CALIBRATING_BARO_CYCLES   200
 
#define PRESSURE_SAMPLES_MEDIAN   3
 
#define PRESSURE_SAMPLE_COUNT   (config_get_profile(self->config)->baro.baro_sample_count - 1)
 

Enumerations

enum  barometerState_e { BAROMETER_NEEDS_SAMPLES = 0, BAROMETER_NEEDS_CALCULATION }
 

Functions

bool isBaroCalibrationComplete (void)
 
void baroSetCalibrationCycles (uint16_t calibrationCyclesRequired)
 
void baro_init (struct baro *self, const struct config *config)
 
bool isBaroReady (void)
 
uint32_t baro_update (struct baro *self)
 
int32_t baro_calc_altitude (struct baro *self)
 
void performBaroCalibrationCycle (struct baro *self)
 

Variables

baro_t baro
 
uint16_t calibratingB = 0
 
uint32_t baroPressure = 0
 
int32_t baroTemperature = 0
 
int32_t BaroAlt = 0
 

Macro Definition Documentation

#define CALIBRATING_BARO_CYCLES   200
#define PRESSURE_SAMPLE_COUNT   (config_get_profile(self->config)->baro.baro_sample_count - 1)
#define PRESSURE_SAMPLES_MEDIAN   3

Enumeration Type Documentation

Enumerator
BAROMETER_NEEDS_SAMPLES 
BAROMETER_NEEDS_CALCULATION 

Function Documentation

int32_t baro_calc_altitude ( struct baro self)

Here is the call graph for this function:

void baro_init ( struct baro self,
const struct config config 
)
uint32_t baro_update ( struct baro self)

Here is the call graph for this function:

void baroSetCalibrationCycles ( uint16_t  calibrationCyclesRequired)
bool isBaroCalibrationComplete ( void  )
bool isBaroReady ( void  )
void performBaroCalibrationCycle ( struct baro self)

Variable Documentation

int32_t BaroAlt = 0
uint32_t baroPressure = 0
int32_t baroTemperature = 0
uint16_t calibratingB = 0