Skip to content

Commit

Permalink
fix: tmp117 driver
Browse files Browse the repository at this point in the history
Added system calls for soft reset and sleep.
Call raw value not sensor value.
TO DO: Configuration settings.
  • Loading branch information
theBASTI0N committed Nov 5, 2021
1 parent 0bf695b commit 1d1c24f
Show file tree
Hide file tree
Showing 9 changed files with 393 additions and 246 deletions.
1 change: 0 additions & 1 deletion drivers/lis2dh12/zephyr/lis2dh12.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <sys/util.h>
#include <zephyr/types.h>


#include <stdint.h>
#include <string.h>

Expand Down
10 changes: 6 additions & 4 deletions drivers/tmp117/zephyr/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# SPDX-License-Identifier: Apache-2.0
if(CONFIG_TMP117)
zephyr_include_directories(.)
zephyr_library()

zephyr_library()

zephyr_library_sources(tmp117.c)
zephyr_library_sources(tmp117.c)
zephyr_library_sources(tmp117_i2c.c)
endif()
73 changes: 72 additions & 1 deletion drivers/tmp117/zephyr/Kconfig
Original file line number Diff line number Diff line change
@@ -1,14 +1,85 @@
# TMP117 temperature sensor configuration options

menuconfig TMP117
bool "TMP117 Temperature Sensors"
depends on I2C
help
Enable driver for TMP117 temperature sensors.
Enable I2C driver for TMP117 temperature sensor.

if TMP117

config TMP117_INIT_PRIORITY
int "Sensor Init Priority"
range 0 100
default 90

config TMP117_LOG_LEVEL
int "Log Level"
range 0 6
default 3

choice
prompt "TMP117 Oversampling"
default TMP117_OS_1

config TMP117_OS_1
bool "Oversampling 1x"

config TMP117_OS_8
bool "Oversampling 8x"

config TMP117_OS_32
bool "Oversampling 32x"

config TMP117_OS_64
bool "Oversampling 64x"

endchoice

choice
prompt "TMP117 Samplerate"
default TMP117_16_MS

config TMP117_16_MS
bool "Samplerate of 16ms"

config TMP117_125_MS
bool "Samplerate of 125ms"

config TMP117_250_MS
bool "Samplerate of 250ms"

config TMP117_500_MS
bool "Samplerate of 500ms"

config TMP117_1000_MS
bool "Samplerate of 1s"

config TMP117_4000_MS
bool "Samplerate of 4s"

config TMP117_8000_MS
bool "Samplerate of 8s"

config TMP117_16000_MS
bool "Samplerate of 16s"

endchoice

choice
prompt "TMP117 Mode"
default TMP117_MODE_SINGLE

config TMP117_MODE_SINGLE
bool "Single Mode"

config TMP117_MODE_CONTINOUS
bool "Continous Mode"

config TMP117_MODE_SLEEP
bool "Sleep Mode"

endchoice


endif #TMP117
Loading

0 comments on commit 1d1c24f

Please sign in to comment.