Skip to content

Commit 920aeea

Browse files
authored
drivers: sensor: added driver for sx9328/9324 (#161)
Added driver for the SX9324 and SX9328 proximity sensors. Signed-off-by: Jared Baumann <[email protected]>
1 parent 8f4008c commit 920aeea

File tree

15 files changed

+1601
-0
lines changed

15 files changed

+1601
-0
lines changed

drivers/sensor/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ add_subdirectory_ifdef(CONFIG_STM32_TEMP stm32_temp)
105105
add_subdirectory_ifdef(CONFIG_STM32_VBAT stm32_vbat)
106106
add_subdirectory_ifdef(CONFIG_STTS751 stts751)
107107
add_subdirectory_ifdef(CONFIG_SX9500 sx9500)
108+
add_subdirectory_ifdef(CONFIG_SX9328 sx9328)
108109
add_subdirectory_ifdef(CONFIG_TH02 th02)
109110
add_subdirectory_ifdef(CONFIG_TMP007 tmp007)
110111
add_subdirectory_ifdef(CONFIG_TMP108 tmp108)

drivers/sensor/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,8 @@ source "drivers/sensor/stm32_vbat/Kconfig"
249249

250250
source "drivers/sensor/stts751/Kconfig"
251251

252+
source "drivers/sensor/sx9328/Kconfig"
253+
252254
source "drivers/sensor/sx9500/Kconfig"
253255

254256
source "drivers/sensor/th02/Kconfig"

drivers/sensor/sx9328/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
zephyr_library()
4+
5+
zephyr_library_sources(sx9328.c)
6+
zephyr_library_sources_ifdef(CONFIG_SX9328_TRIGGER sx9328_trigger.c)

drivers/sensor/sx9328/Kconfig

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# SX9328 SAR proximity sensor configuration options
2+
3+
# Copyright (c) 2023 T-Mobile USA, Inc.
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
menuconfig SX9328
7+
bool "SX9328/SX9324 I2C SAR Proximity Chip"
8+
default y
9+
depends on DT_HAS_SEMTECH_SX9328_ENABLED
10+
select I2C
11+
help
12+
Enable driver for SX9328 or SX9324 I2C-based SAR proximity sensor.
13+
14+
if SX9328
15+
16+
choice
17+
prompt "SX9328 trigger mode"
18+
default SX9328_TRIGGER_GLOBAL_THREAD
19+
20+
config SX9328_TRIGGER_NONE
21+
bool "No trigger"
22+
23+
config SX9328_TRIGGER_GLOBAL_THREAD
24+
depends on GPIO
25+
select SX9328_TRIGGER
26+
bool "Use global thread"
27+
28+
config SX9328_TRIGGER_OWN_THREAD
29+
depends on GPIO
30+
select SX9328_TRIGGER
31+
bool "Use own thread"
32+
33+
endchoice
34+
35+
config SX9328_TRIGGER
36+
bool
37+
38+
config SX9328_THREAD_STACK_SIZE
39+
int "Sensor delayed work thread stack size"
40+
depends on SX9328_TRIGGER_OWN_THREAD
41+
default 1024
42+
43+
config SX9328_THREAD_PRIORITY
44+
int "Thread priority"
45+
depends on SX9328_TRIGGER_OWN_THREAD
46+
default 10
47+
48+
endif # SX9328

0 commit comments

Comments
 (0)