STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
test_ms5611.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "dev_ms5611.h"
#include "fake_baro.h"
Include dependency graph for test_ms5611.c:

Go to the source code of this file.

Macros

#define CHECK(c)
#define kProm   fake_baro_datasheet_prom

Functions

static void test_prom_read_and_crc (void)
static void test_prom_crc_mismatch_and_blank_are_rejected (void)
static void test_conversion_commands_and_adc (void)
static void compensate (uint32_t d1, uint32_t d2, int32_t *t, int32_t *p)
static void test_datasheet_worked_example (void)
static void test_second_order_below_20c (void)
int main (void)

Macro Definition Documentation

◆ CHECK

#define CHECK ( c)
Value:
do { \
if (!(c)) { \
fprintf(stderr, "%s:%d: %s\n", __FILE__, __LINE__, #c); \
exit(1); \
} \
} while (0)

Definition at line 8 of file test_ms5611.c.

Referenced by test_conversion_commands_and_adc(), test_datasheet_worked_example(), test_prom_crc_mismatch_and_blank_are_rejected(), test_prom_read_and_crc(), and test_second_order_below_20c().

◆ kProm

Function Documentation

◆ compensate()

void compensate ( uint32_t d1,
uint32_t d2,
int32_t * t,
int32_t * p )
static

◆ main()

◆ test_conversion_commands_and_adc()

◆ test_datasheet_worked_example()

void test_datasheet_worked_example ( void )
static

Definition at line 67 of file test_ms5611.c.

References CHECK, compensate(), and p.

Referenced by main().

◆ test_prom_crc_mismatch_and_blank_are_rejected()

void test_prom_crc_mismatch_and_blank_are_rejected ( void )
static

Definition at line 29 of file test_ms5611.c.

References CHECK, DEV_ERR_DATA, fake_baro_bus(), kProm, ms5611_read_prom(), p, and fake_baro_t::prom.

Referenced by main().

◆ test_prom_read_and_crc()

void test_prom_read_and_crc ( void )
static

◆ test_second_order_below_20c()

void test_second_order_below_20c ( void )
static

Definition at line 75 of file test_ms5611.c.

References CHECK, compensate(), and p.

Referenced by main().