Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
airspeed_sdp3x.c File Reference

Airspeed driver for the SDP3X pressure sensor via I2C. More...

#include "std.h"
#include "mcu_periph/i2c.h"
#include "modules/sensors/airspeed_sdp3x.h"
#include "modules/core/abi.h"
#include "mcu_periph/sys_time.h"
Include dependency graph for airspeed_sdp3x.c:

Go to the source code of this file.

Macros

#define SDP3X_SCALE_TEMPERATURE   200.0f
 Commands and scales.
#define SDP3X_RESET_ADDR   0x00
#define SDP3X_RESET_CMD   0x06
#define SDP3X_CONT_MEAS_AVG_MODE   0x3615
#define SDP3X_CONT_NONE_MODE   0x361E
#define SDP3X_SCALE_PRESSURE_SDP31   60
#define SDP3X_SCALE_PRESSURE_SDP32   240
#define SDP3X_SCALE_PRESSURE_SDP33   20
#define SDP3X_I2C_ADDR   0x42
 Sensor I2C slave address (existing defaults 0x42, 0x44 and 0x46).
#define SDP3X_MODE   SDP3X_CONT_MEAS_AVG_MODE
 Default operation mode.
#define SDP3X_PRESSURE_SCALE   SDP3X_SCALE_PRESSURE_SDP31
 Default scale for SDP31.

Functions

static bool sdp3x_crc (const uint8_t data[], unsigned size, uint8_t checksum)
void sdp3x_init (void)
void sdp3x_periodic (void)
void sdp3x_event (void)

Variables

struct AirspeedSdp3x sdp3x
static struct i2c_transaction sdp3x_trans

Detailed Description

Airspeed driver for the SDP3X pressure sensor via I2C.

Definition in file airspeed_sdp3x.c.

Macro Definition Documentation

◆ SDP3X_CONT_MEAS_AVG_MODE

#define SDP3X_CONT_MEAS_AVG_MODE   0x3615

Definition at line 37 of file airspeed_sdp3x.c.

◆ SDP3X_CONT_NONE_MODE

#define SDP3X_CONT_NONE_MODE   0x361E

Definition at line 38 of file airspeed_sdp3x.c.

◆ SDP3X_I2C_ADDR

#define SDP3X_I2C_ADDR   0x42

Sensor I2C slave address (existing defaults 0x42, 0x44 and 0x46).

Definition at line 47 of file airspeed_sdp3x.c.

Referenced by sdp3x_periodic().

◆ SDP3X_MODE

#define SDP3X_MODE   SDP3X_CONT_MEAS_AVG_MODE

Default operation mode.

Definition at line 53 of file airspeed_sdp3x.c.

Referenced by sdp3x_periodic().

◆ SDP3X_PRESSURE_SCALE

#define SDP3X_PRESSURE_SCALE   SDP3X_SCALE_PRESSURE_SDP31

Default scale for SDP31.

Definition at line 59 of file airspeed_sdp3x.c.

Referenced by sdp3x_init().

◆ SDP3X_RESET_ADDR

#define SDP3X_RESET_ADDR   0x00

Definition at line 34 of file airspeed_sdp3x.c.

◆ SDP3X_RESET_CMD

#define SDP3X_RESET_CMD   0x06

Definition at line 35 of file airspeed_sdp3x.c.

◆ SDP3X_SCALE_PRESSURE_SDP31

#define SDP3X_SCALE_PRESSURE_SDP31   60

Definition at line 40 of file airspeed_sdp3x.c.

◆ SDP3X_SCALE_PRESSURE_SDP32

#define SDP3X_SCALE_PRESSURE_SDP32   240

Definition at line 41 of file airspeed_sdp3x.c.

◆ SDP3X_SCALE_PRESSURE_SDP33

#define SDP3X_SCALE_PRESSURE_SDP33   20

Definition at line 42 of file airspeed_sdp3x.c.

◆ SDP3X_SCALE_TEMPERATURE

#define SDP3X_SCALE_TEMPERATURE   200.0f

Commands and scales.

Definition at line 33 of file airspeed_sdp3x.c.

Referenced by sdp3x_event().

Function Documentation

◆ sdp3x_crc()

bool sdp3x_crc ( const uint8_t data[],
unsigned size,
uint8_t checksum )
static

Definition at line 67 of file airspeed_sdp3x.c.

References checksum, and sdp3x_crc().

Referenced by sdp3x_crc(), and sdp3x_event().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sdp3x_event()

void sdp3x_event ( void )

◆ sdp3x_init()

void sdp3x_init ( void )

Definition at line 89 of file airspeed_sdp3x.c.

References I2CTransDone, sdp3x, SDP3X_PRESSURE_SCALE, and sdp3x_trans.

◆ sdp3x_periodic()

void sdp3x_periodic ( void )

Definition at line 99 of file airspeed_sdp3x.c.

References i2c_receive(), i2c_transmit(), I2CTransDone, sdp3x, SDP3X_I2C_ADDR, SDP3X_MODE, and sdp3x_trans.

Here is the call graph for this function:

Variable Documentation

◆ sdp3x

struct AirspeedSdp3x sdp3x

Definition at line 64 of file airspeed_sdp3x.c.

Referenced by sdp3x_event(), sdp3x_init(), and sdp3x_periodic().

◆ sdp3x_trans

struct i2c_transaction sdp3x_trans
static

Definition at line 65 of file airspeed_sdp3x.c.

Referenced by sdp3x_event(), sdp3x_init(), and sdp3x_periodic().