33#ifndef BARO_NO_DOWNLINK
56#define STATUS_MEASURE_PRESSURE 4
57#define STATUS_MEASURE_TEMPERATURE 5
64#define InitStatus() (status <= STATUS_INIT4)
66#define NextStatus() { \
67 if (status_read_data) { \
68 status++; if (status > STATUS_MEASURE_TEMPERATURE) status = STATUS_MEASURE_PRESSURE; \
70 status_read_data = !status_read_data; \
66#define NextStatus() { \ …
74#define CMD_MEASUREMENT 0x0F
80#define CMD_PRESSURE 0x40
81#define CMD_TEMPERATURE 0x20
90#define Uint16(buf_input) (buf_input[0] << 8 | buf_input[1])
95#define PWM_PRESCALER 1
99#define PWM_PRESCALER 2
102#if (PCLK == 60000000)
103#define PWM_PRESCALER 4
106#error unknown PCLK frequency
111#define MS5534A_MCLK 32768
112#define PWM_PERIOD ((PCLK / PWM_PRESCALER) / MS5534A_MCLK)
113#define PWM_DUTY (PWM_PERIOD / 2)
136#ifdef BARO_MS5534A_W1
178 for (i = 0; i < 3; i++) {
216 ut1 = (
c5 << 3) + 20224;
218#ifndef BARO_NO_DOWNLINK
220 for (
int i=0; i<4; i++){
244 uint16_t x = (sens * (
d1 - 7168)) / (1 << 14) - off;
Main include for ABI (AirBorneInterface).
#define BARO_MS5534A_SENDER_ID
void baro_MS5534A_event_task(void)
void baro_MS5534A_event(void)
uint16_t baro_MS5534A_temp
void baro_MS5534A_send(void)
static uint8_t buf_input[3]
void baro_MS5534A_init(void)
float baro_MS5534A_sigma2
#define STATUS_MEASURE_TEMPERATURE
bool baro_MS5534A_do_reset
uint32_t baro_MS5534A_pressure
#define Uint16(buf_input)
void baro_MS5534A_reset(void)
static void calibration(void)
bool baro_MS5534A_available
static bool status_read_data
static uint8_t buf_output[3]
#define STATUS_MEASURE_PRESSURE
uint32_t baro_MS5534A_ground_pressure
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
float ground_alt
size == nb_waypoint, waypoint 0 is a dummy waypoint
Common code for AP and FBW telemetry.
Handling of the MS5534a pressure sensor.
Fixedwing Navigation library.
Architecture independent SPI (Serial Peripheral Interface) API.
API to get/set the generic vehicle states.
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
short int16_t
Typedef defining 16 bit short type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.