Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
baro_dps310.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2026 OpenUAS
3 *
4 * This file is part of paparazzi.
5 *
6 * paparazzi is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
10 *
11 * paparazzi is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with paparazzi; see the file COPYING. If not, see
18 * <http://www.gnu.org/licenses/>.
19 *
20 */
21
28
29#include "baro_dps310.h"
30#include "modules/core/abi.h"
31#include "mcu_periph/sys_time.h"
32
33
35#ifndef DPS310_SLAVE_ADDR
36 #define DPS310_SLAVE_ADDR DPS310_I2C_ADDR
37#endif
38
40
42{
44}
45
50
52{
54
55 if (baro_dps310.data_available) {
56 uint32_t now_ts = get_sys_time_usec();
57 // send ABI message
58 AbiSendMsgBARO_ABS_RAW(BARO_DPS310_SENDER_ID, now_ts, baro_dps310.pressure);
59 AbiSendMsgTEMPERATURE_RAW(BARO_DPS310_SENDER_ID, now_ts, baro_dps310.temperature, TEMPERATURE_TYPE_BARO);
60 baro_dps310.data_available = false;
61 }
62}
Main include for ABI (AirBorneInterface).
#define TEMPERATURE_TYPE_BARO
barometer die
Definition abi_common.h:91
#define BARO_DPS310_SENDER_ID
void baro_dps310_periodic(void)
Definition baro_dps310.c:46
struct Dps310_I2c baro_dps310
Definition baro_dps310.c:39
#define DPS310_SLAVE_ADDR
default slave address
Definition baro_dps310.c:36
void baro_dps310_event(void)
Definition baro_dps310.c:51
void baro_dps310_init(void)
Definition baro_dps310.c:41
Infineon DPS310 I2C sensor interface.
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
void dps310_i2c_event(struct Dps310_I2c *dps)
Consume finished I2C transactions and advance the state machine.
Definition dps310_i2c.c:290
void dps310_i2c_periodic(struct Dps310_I2c *dps)
Run the driver state machine, submitting at most one I2C transaction.
Definition dps310_i2c.c:199
void dps310_i2c_init(struct Dps310_I2c *dps, struct i2c_periph *i2c_p, uint8_t addr)
Initialize the driver instance (no bus traffic yet).
Definition dps310_i2c.c:174
Architecture independent timing functions.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.