11 fprintf(stderr, "%s:%d: %s\n", __FILE__, __LINE__, #c); \
16#define kProm fake_baro_datasheet_prom
38 memset(f.
prom, 0xFF,
sizeof(f.
prom));
93 puts(
"ms5611: all tests passed");
int ms5611_read_adc(const dev_bus_t *bus, uint32_t *raw)
uint8_t ms5611_crc4(const ms5611_prom_t *prom)
int ms5611_start(const dev_bus_t *bus, ms5611_conversion_t which)
int ms5611_read_prom(const dev_bus_t *bus, ms5611_prom_t *prom)
void ms5611_compensate(const ms5611_prom_t *prom, uint32_t d1, uint32_t d2, int32_t *temp_c100, int32_t *pressure_pa)
dev_bus_t fake_baro_bus(fake_baro_t *f)
static void test_prom_read_and_crc(void)
static void test_prom_crc_mismatch_and_blank_are_rejected(void)
static void compensate(uint32_t d1, uint32_t d2, int32_t *t, int32_t *p)
static void test_conversion_commands_and_adc(void)
static void test_datasheet_worked_example(void)
static void test_second_order_below_20c(void)