40 lines
758 B
C
40 lines
758 B
C
|
|
#ifndef __MS5611_H
|
||
|
|
#define __MS5611_H
|
||
|
|
|
||
|
|
#include "SPIDevice.h"
|
||
|
|
|
||
|
|
#define MS5611_D1_CONVERTING 1
|
||
|
|
#define MS5611_D2_CONVERTING 2
|
||
|
|
|
||
|
|
typedef struct Baro_MS5611{
|
||
|
|
const char *name;
|
||
|
|
SPI_DEV_t *_dev;
|
||
|
|
int32_t Prange;
|
||
|
|
int32_t Pmin;
|
||
|
|
|
||
|
|
uint16_t Ms5611_Cof[6];
|
||
|
|
uint16_t Ms5611_Setup;
|
||
|
|
|
||
|
|
uint32_t Ms5611_Raw_Temp;
|
||
|
|
uint32_t Ms5611_Raw_Pressure;
|
||
|
|
int PresurReadFlag;
|
||
|
|
|
||
|
|
int32_t pressure; /* Pa */
|
||
|
|
int16_t temp; /*0.01*degC -50~150 */
|
||
|
|
uint8_t status;
|
||
|
|
|
||
|
|
// statics
|
||
|
|
int cnt;
|
||
|
|
int last_cnt;
|
||
|
|
int pps;
|
||
|
|
uint8_t seq;
|
||
|
|
} Baro_MS5611_t;
|
||
|
|
|
||
|
|
int MS5611_Pressure_init(Baro_MS5611_t *Baro, const char *name, SPI_DEV_t *dev);
|
||
|
|
|
||
|
|
int MS5611_Pressure_update(Baro_MS5611_t *Baro);
|
||
|
|
|
||
|
|
void MS5611_Pressure_stats(Baro_MS5611_t *Baro);
|
||
|
|
|
||
|
|
#endif
|