44 for (i = 0; i < 8; i++) {
54 for (i = 0; i < 16; i++) {
56 res ^= ((
prom[i >> 1]) & 0x00FF);
59 res ^= (
prom[i >> 1] >> 8);
61 for (
j = 8;
j > 0;
j--) {
70 if (crc == ((res >> 12) & 0xF)) {
92 sens = ((
int64_t)ms->
c[1] * (1 << 15)) + ((
int64_t)ms->
c[3] * dt) / (1 << 8);
95 t2 = (dt * dt) / (1 << 31);
110 if ((
tempms > -4000) && (
tempms < 8500) && (
p > 1000) && (
p < 120000)) {
133 off = ((
int64_t)ms->
c[2] * (1 << 17)) + ((
int64_t)ms->
c[4] * dt) / (1 << 6);
135 sens = ((
int64_t)ms->
c[1] * (1 << 16)) + ((
int64_t)ms->
c[3] * dt) / (1 << 7);
138 t2 = (dt * dt) / (1 << 31);
153 if ((
tempms > -4000) && (
tempms < 8500) && (
p > 1000) && (
p < 120000)) {
bool ms5607_calc(struct Ms5611Data *ms)
Calculate temperature and compensated pressure for MS5607.
bool ms5611_prom_crc_ok(uint16_t *prom)
Check if CRC of PROM data is OK.
bool ms5611_calc(struct Ms5611Data *ms)
Calculate temperature and compensated pressure for MS5611.
MS5611 barometer driver common interface (I2C and SPI).
uint32_t pressure
pressure in Pascal (0.01mbar)
int32_t temperature
temperature with 0.01 degrees Celsius resolution
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
int int32_t
Typedef defining 32 bit int type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.