STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
fake_baro.h
Go to the documentation of this file.
1#ifndef STAR_FAKE_BARO_H
2#define STAR_FAKE_BARO_H
3
4/*
5 * A pretend MS5611 behind a dev_bus_t: PROM words, D1/D2 values, and the
6 * datasheet rule that an ADC read with no conversion pending returns 0.
7 */
8
9#include <stdint.h>
10
11#include "dev_bus.h"
12
13typedef struct {
14 uint16_t prom[8];
15 uint32_t d1, d2;
16 uint8_t pending; /* 0x48 / 0x58 / 0 */
17 int fail; /* every transfer fails while set */
18 unsigned transfers;
19 uint8_t last_cmd;
21
23
24/* Datasheet coefficients C1..C6 (p.8); word 0 and the serial part of word 7
25 * made up, CRC nibble 3 computed independently with AN520. */
26extern const uint16_t fake_baro_datasheet_prom[8];
27
28#endif
const uint16_t fake_baro_datasheet_prom[8]
Definition fake_baro.c:5
dev_bus_t fake_baro_bus(fake_baro_t *f)
Definition fake_baro.c:41
uint32_t d2
Definition fake_baro.h:15
uint16_t prom[8]
Definition fake_baro.h:14
uint8_t pending
Definition fake_baro.h:16
uint8_t last_cmd
Definition fake_baro.h:19
unsigned transfers
Definition fake_baro.h:18
uint32_t d1
Definition fake_baro.h:15