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
13
typedef
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
;
20
}
fake_baro_t
;
21
22
dev_bus_t
fake_baro_bus
(
fake_baro_t
* f);
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. */
26
extern
const
uint16_t
fake_baro_datasheet_prom
[8];
27
28
#endif
dev_bus.h
fake_baro_datasheet_prom
const uint16_t fake_baro_datasheet_prom[8]
Definition
fake_baro.c:5
fake_baro_bus
dev_bus_t fake_baro_bus(fake_baro_t *f)
Definition
fake_baro.c:41
dev_bus_t
Definition
dev_bus.h:26
fake_baro_t
Definition
fake_baro.h:13
fake_baro_t::d2
uint32_t d2
Definition
fake_baro.h:15
fake_baro_t::prom
uint16_t prom[8]
Definition
fake_baro.h:14
fake_baro_t::pending
uint8_t pending
Definition
fake_baro.h:16
fake_baro_t::last_cmd
uint8_t last_cmd
Definition
fake_baro.h:19
fake_baro_t::transfers
unsigned transfers
Definition
fake_baro.h:18
fake_baro_t::d1
uint32_t d1
Definition
fake_baro.h:15
fake_baro_t::fail
int fail
Definition
fake_baro.h:17
firmware
Flight_Computer
tests
fakes
fake_baro.h
Generated by
1.15.0