Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: DPS310 driver #463

Merged
merged 40 commits into from
Nov 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
643f98f
feat: DPS310 driver
trombik Oct 25, 2022
c093504
bugfix: update README
trombik Oct 25, 2022
604f74c
bugfix: include freertos/task.h, fixes build on ESP8266
trombik Oct 25, 2022
e79a016
doc: add dps310 to the doc
trombik Oct 25, 2022
80ea02d
bugfix: adjust DPS310_STARTUP_DELAY_MS
trombik Oct 25, 2022
90e4410
feat: add a helper to read specific bits from a resister
trombik Oct 25, 2022
7ed544e
feat: implement dps310_(get|set)_pm_prc()
trombik Oct 25, 2022
22f47b8
feat: implement functions for CFG_REG
trombik Oct 25, 2022
bde6657
bugfix: s/PSR/PRS/
trombik Oct 25, 2022
b48f0b3
feat: implement internal function, _wait_for_reg_bits()
trombik Oct 26, 2022
62f33ff
feat: implement dps310_get_coef()
trombik Oct 26, 2022
c07db10
chore: ignore bunder files
trombik Oct 26, 2022
4a60f55
bugfix: always use pdMS_TO_TICKS with vTaskDelay()
trombik Oct 26, 2022
13c8bdd
feat: implement dsp310_get_mode()
trombik Oct 27, 2022
fbba344
feat: implement dsp310_flush_fifo() and dsp310_enable_fifo()
trombik Oct 27, 2022
bf5bda3
doc: s/dsp/dps/ in metadata
trombik Oct 28, 2022
339d35c
bugfix: s/DSP/DPS/
trombik Oct 28, 2022
704c297
feat: implement command mode, or maunal measurement
trombik Oct 28, 2022
36dbe14
bugfix: replace pow(3) with a simple int version
trombik Oct 28, 2022
ea39242
bugfix: make scale_factors static
trombik Oct 28, 2022
6be373e
bugfix: update README
trombik Oct 28, 2022
665d864
doc: mention the unit returned by dps310_read_pressure
trombik Oct 28, 2022
c7733b1
doc: update current status
trombik Oct 28, 2022
6f95ac3
fix: add dps310 to chips table, fix printf() format specifiers
UncleRus Oct 29, 2022
bab1f0f
fix: rebase on latest master
UncleRus Oct 29, 2022
ffe6781
doc: update README for the example
trombik Oct 28, 2022
1756a20
bugfix: ensure both sensor and coef are ready in example
trombik Oct 30, 2022
1cd677f
doc: add a note about compensation
trombik Oct 30, 2022
51ab40d
doc: remove incorrect description from dps310_init_desc()
trombik Oct 30, 2022
a4e3396
doc: fix all incorrect reference to `dev` in the doc
trombik Oct 30, 2022
8850600
bugfix: read COEF in dps310_quirk()
trombik Oct 30, 2022
69e0c26
doc: briefly document internal functions
trombik Oct 30, 2022
213f240
bugfix: make single-line internal functions inline
trombik Oct 30, 2022
f14efb8
bugfix: use _read_reg_mask() where possible
trombik Oct 30, 2022
1f3ea39
bugfix: fix uninitialized variables
trombik Oct 30, 2022
ef2d390
bugfix: prefix private functions with `_`
trombik Oct 30, 2022
6ff7b98
bugfix: add units to log statements in example
trombik Oct 30, 2022
d950048
doc: update example
trombik Oct 30, 2022
e92f02e
bugfix: remove unused `define`s
trombik Oct 30, 2022
d7ad7d9
bugfix: rename confusing `_prc` and `_rate`
trombik Oct 30, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,14 @@ labels:
- "components/dht/**"
- "components/dht/.eil.yml"
- "examples/dht/**"
- label: "area:components:dps310"
sync: true
matcher:
files:
any:
- "components/dps310/**"
- "components/dps310/.eil.yml"
- "examples/dps310/**"
- label: "area:components:ds1302"
sync: true
matcher:
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,7 @@ Gemfile.lock
# macOS .DS_Store and .AppleDouble files
.DS_Store
.AppleDouble

# bundled files by ruby bundler and configuration
/.bundle/
/vendor/
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ or [GitLab examples](https://gitlab.com/UncleRus/esp-idf-lib/tree/master/example
| **bme680** | Driver for BME680 digital environmental sensor | BSD-3 | `esp32`, `esp8266`, `esp32s2`, `esp32c3` | Yes
| **bmp180** | Driver for BMP180 digital pressure sensor | MIT | `esp32`, `esp8266`, `esp32s2`, `esp32c3` | Yes
| **bmp280** | Driver for BMP280/BME280 digital pressure sensor | MIT | `esp32`, `esp8266`, `esp32s2`, `esp32c3` | Yes
| **dps310** | Driver for DPS310 barometric pressure sensor | ISC | `esp32`, `esp8266`, `esp32s2`, `esp32c3` | Yes
| **ms5611** | Driver for barometic pressure sensor MS5611-01BA03 | BSD-3 | `esp32`, `esp8266`, `esp32s2`, `esp32c3` | Yes

### Real-time clocks
Expand All @@ -247,6 +248,7 @@ or [GitLab examples](https://gitlab.com/UncleRus/esp-idf-lib/tree/master/example
| **bmp180** | Driver for BMP180 digital pressure sensor | MIT | `esp32`, `esp8266`, `esp32s2`, `esp32c3` | Yes
| **bmp280** | Driver for BMP280/BME280 digital pressure sensor | MIT | `esp32`, `esp8266`, `esp32s2`, `esp32c3` | Yes
| **dht** | Driver for DHT11, AM2301 (DHT21, DHT22, AM2302, AM2321), Itead Si7021 | BSD-3 | `esp32`, `esp8266`, `esp32s2`, `esp32c3` | No
| **dps310** | Driver for DPS310 barometric pressure sensor | ISC | `esp32`, `esp8266`, `esp32s2`, `esp32c3` | Yes
| **ds18x20** | Driver for DS18B20/DS18S20 families of 1-Wire temperature sensor ICs | BSD-3 | `esp32`, `esp8266`, `esp32s2`, `esp32c3` | No
| **hdc1000** | Driver for HDC1000 temperature and humidity sensor | BSD-3 | `esp32`, `esp8266`, `esp32s2`, `esp32c3` | Yes
| **hts221** | Driver for HTS221 temperature and humidity sensor. | ISC | `esp32`, `esp32s2`, `esp32c3` | Yes
Expand Down
26 changes: 26 additions & 0 deletions components/dps310/.eil.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
components:
- name: dps310
description: |
Driver for DPS310 barometric pressure sensor
group:
name: pressure
groups:
- name: temperature
code_owners:
- name: trombik
depends:
- name: i2cdev
- name: log
- name: esp_idf_lib_helpers
thread_safe: yes
targets:
- name: esp32
- name: esp8266
- name: esp32s2
- name: esp32c3
licenses:
- name: ISC
copyrights:
- name: trombik
year: 2022
22 changes: 22 additions & 0 deletions components/dps310/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
idf_component_register(

# sources to compile
SRCS src/dps310.c src/helper_i2c.c

# public headers
INCLUDE_DIRS include

# private headers
PRIV_INCLUDE_DIRS priv_include

# Component Requirements
# https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/build-system.html#component-requirements

# components whose header files are #included from the public header files
# of this component.
REQUIRES log i2cdev

# components whose header files are #included from any source files in
# this component, unless already listed in REQUIRES
PRIV_REQUIRES esp_idf_lib_helpers i2cdev
)
10 changes: 10 additions & 0 deletions components/dps310/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
menu "DPS310 driver"
choice DPS310_PROTOCOL
prompt "Choose protocol for digital interface"
default DPS310_PROTOCOL_USING_I2C
help
The protocol to use for digital interface
config DPS310_PROTOCOL_USING_I2C
bool "I2C"
endchoice
endmenu
13 changes: 13 additions & 0 deletions components/dps310/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright (c) 2022 Tomoyuki Sakurai <y@trombik.org>

Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
4 changes: 4 additions & 0 deletions components/dps310/component.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
COMPONENT_DEPENDS = i2cdev log esp_idf_lib_helpers
COMPONENT_ADD_INCLUDEDIRS = include
COMPONENT_PRIV_INCLUDEDIRS = priv_include
COMPONENT_SRCDIRS := src
Loading