adafruit_dps310

Library for the DPS310 Precision Barometric Pressure Sensor

  • Author(s): Bryan Siepert

Implementation Notes

Hardware:

Software and Dependencies:

class adafruit_dps310.CV

struct helper

classmethod add_values(value_tuples)

Add CV values to the class

classmethod is_valid(value)

Validate that a given value is a member

class adafruit_dps310.DPS310(i2c_bus, address=119)

Library for the DPS310 Precision Barometric Pressure Sensor.

Parameters:
  • i2c_bus (I2C) – The I2C bus the DPS310 is connected to.
  • address – The I2C slave address of the sensor
initialize()

Initialize the sensor to continuous measurement

mode

The measurement mode. Must be a Mode. See the Mode documentation for details

pressure

Returns the current pressure reading in kPA

pressure_oversample_count

The number of samples taken per pressure measurement. Must be a SampleCount

pressure_rate

Configure the pressure measurement rate. Must be a Rate

pressure_ready

Returns true if pressure readings are ready

reset()

Reset the sensor

temperature

The current temperature reading in degrees C

temperature_oversample_count

The number of samples taken per temperature measurement. Must be a SampleCount

temperature_rate

Configure the temperature measurement rate. Must be a Rate

temperature_ready

Returns true if there is a temperature reading ready

wait_pressure_ready()

Wait until a pressure measurement is available

To avoid waiting indefinitely this function raises an error if the sensor isn’t configured for pressure measurements, ie. Mode.ONE_PRESSURE, Mode.CONT_PRESSURE or Mode.CONT_PRESTEMP See the Mode documentation for details.

wait_temperature_ready()

Wait until a temperature measurement is available.

To avoid waiting indefinitely this function raises an error if the sensor isn’t configured for temperate measurements, ie. Mode.ONE_TEMPERATURE, Mode.CONT_TEMP or Mode.CONT_PRESTEMP. See the Mode documentation for details.

class adafruit_dps310.Mode

Options for mode

Mode Description
Mode.IDLE Puts the sensor into a shutdown state
Mode.ONE_PRESSURE Setting mode to Mode.ONE_PRESSURE takes a single pressure measurement then switches to Mode.IDLE
Mode.ONE_TEMPERATURE Setting mode to Mode.ONE_TEMPERATURE takes a single temperature measurement then switches to Mode.IDLE
Mode.CONT_PRESSURE Take pressure measurements at the current pressure_rate. temperature will not be updated
Mode.CONT_TEMP Take temperature measurements at the current temperature_rate. pressure will not be updated
Mode.CONT_PRESTEMP Take temperature and pressure measurements at the current pressure_rate and temperature_rate
class adafruit_dps310.Rate

Options for pressure_rate and temperature_rate

class adafruit_dps310.SampleCount

Options for temperature_oversample_count and pressure_oversample_count