Component: Barometer (DPS310) (Environmental)
Author | Matrix TSL |
Version | 1.0 (Release) |
Category | Environmental |
Contents
Barometer (DPS310) component
A barometric air pressure sensor with high accuracy and low current consumption. Capable of sensing air pressure and temperature. Based on an I2C bus connection.
Examples
No additional examples
Downloadable macro reference
ReadTemperature
Reads the temperature measurement from the last SampleSensor macro
Parameters
- This macro has no parameters
Return value
ConfigurePressure
Configures the pressure sensor sample rate and over sampling count
Parameters
- BYTE Rate
- Range: 0-7, 0=1Hz, 1=2Hz, 2=4Hz etc
- BYTE Oversample
- Range: 0-7, 0=1Samples, 1=2Samples, 2=4Samples etc
Return value
- This call does not return a value
ConfigureTemperature
Configures the temperature sensor sample rate and over sampling count
Parameters
- BYTE Rate
- Range: 0-7, 0=1Hz, 1=2Hz, 2=4Hz etc
- BYTE Oversample
- Range: 0-7, 0=1Samples, 1=2Samples, 2=4Samples etc
Return value
- This call does not return a value
ReadPressure
Reads the pressure measurement from the last SampleSensor macro
Parameters
- This macro has no parameters
Return value
SetMode
Sets the operational mode of the sensor to be continous or one shot
Parameters
- BYTE Mode
Return value
- This call does not return a value
ReadAltitude
Reads the pressure measurement from the last SampleSensor macro and converts the pressure reading into an altitude reading.
Parameters
- This macro has no parameters
Return value
SampleSensor
Checks to see if new data is available for temperature or pressure and collects it.
Returns 0 if no new data is available
Returns 1 for pressure, 2 for temperature and 3 for both.
Parameters
- This macro has no parameters
Return value
Initialise
Starts up the I2C ready to communicate with the sensor.
Sets the selected rates and operational mode.
Returns 1 if the sensor has been found and initialised.
Parameters
- This macro has no parameters
Return value
- BOOL : Returns true if the operation is a success, else false
Simulation macro reference
This component does not contain any simulation macros
Property reference
Device Address
This property is of type Fixed list of ints and can be referenced with the variable name DeviceAddress.
No additional information
Measurement Rate
This property is of type Fixed list of ints and can be referenced with the variable name MeasurementRate.
No additional information
Oversample Rate
This property is of type Fixed list of ints and can be referenced with the variable name OversampleRate.
No additional information
Operational Mode
This property is of type Fixed list of ints and can be referenced with the variable name OpMode.
No additional information
Channel
This property is of type Fixed list of ints and can be referenced with the variable name cal_i2c1::CHANNEL.
Channel selection
Baud Select
This property is of type Fixed list of ints and can be referenced with the variable name cal_i2c1::BAUD_LIST.
Baud rate option selector
Baud Rate
This property is of type Signed integer and can be referenced with the variable name cal_i2c1::BAUD.
Baud rate to be used
SDA
This property is of type Single digital pin and can be referenced with the variable name cal_i2c1::SDA.
Pin used for SDA (data signal)
SCL
This property is of type Single digital pin and can be referenced with the variable name cal_i2c1::SCL.
Pin used for SCL (clock signal)
Stop Delay
This property is of type True or false and can be referenced with the variable name cal_i2c1::StopDel.
On older microcontroller devices there is a potential for the I2C hardware channel to lock up if there is not
a 10ms delay between an I2C stop event and the next I2C start event.
Most modern microcontrollers will not have a problem so this property can be disabled to speed up the
I2C communications.
Simulate Comms
This property is of type True or false and can be referenced with the variable name SimComms.
No: Provides simulation using the panel component sliders.
Yes: Communicates via an API Slave device to real world hardware, shows the results using the panel component sliders.
Scope Traces
This property is of type True or false and can be referenced with the variable name cal_i2c1::ScopeTraces.
Selects if the component pin connections are automatically generated on the data recorder window or not.
Yes: Automatically add the component pins to a group on the data recorder which will reflect the sim data during simultion.
No: Do not show the pin signals on the data recorder window.
Console Data
This property is of type True or false and can be referenced with the variable name cal_i2c1::ConsoleData.
Selects if the console data is automatically generated or not
API
This property is of type Fixed list of ints and can be referenced with the variable name cal_i2c1::Injector.
Specifies the API component on the panel to interact with to provide comms simulation.