Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
drivers: sensor: Add suport for TMAG5170 3D Hall sensor
Introduce support for Texas Instruments TMAG5170 high-precision linear 3D Hall-effect SPI sensor. This driver allows to configure measurements on magnetic and temperature channels. It is also possible to read rotation of the magnet. Signed-off-by: Michal Morsisko <morsisko@gmail.com>
- Loading branch information
Showing
12 changed files
with
1,102 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
zephyr_library() | ||
|
||
zephyr_library_sources(tmag5170.c) | ||
zephyr_library_sources_ifdef(CONFIG_TMAG5170_TRIGGER tmag5170_trigger.c) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Texas Instruments TMAG5170 high-precision, linear 3D Hall-effect sensor with SPI bus interface | ||
|
||
# Copyright (c) 2023 Michal Morsisko | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
menuconfig TMAG5170 | ||
bool "TMAG5170 SPI Hall-effect sensor driver" | ||
default y | ||
depends on DT_HAS_TI_TMAG5170_ENABLED | ||
select SPI | ||
help | ||
Enable driver for TMAG5170 Hall-effect sensor driver | ||
|
||
if TMAG5170 | ||
|
||
choice TMAG5170_TRIGGER_MODE | ||
prompt "Trigger mode" | ||
help | ||
Specify the type of triggering to be used by the driver. | ||
|
||
config TMAG5170_TRIGGER_NONE | ||
bool "No trigger" | ||
|
||
config TMAG5170_TRIGGER_GLOBAL_THREAD | ||
bool "Use global thread" | ||
depends on GPIO | ||
select TMAG5170_TRIGGER | ||
|
||
config TMAG5170_TRIGGER_OWN_THREAD | ||
bool "Use own thread" | ||
depends on GPIO | ||
select TMAG5170_TRIGGER | ||
|
||
config TMAG5170_TRIGGER_DIRECT | ||
bool "Process trigger within interrupt context" | ||
depends on GPIO | ||
select TMAG5170_TRIGGER | ||
|
||
endchoice | ||
|
||
config TMAG5170_CRC | ||
bool "Use CRC error detection" | ||
default y | ||
select CRC | ||
help | ||
Verify CRC of RX data and append CRC to TX data | ||
|
||
config TMAG5170_TRIGGER | ||
bool | ||
|
||
if TMAG5170_TRIGGER | ||
|
||
config TMAG5170_THREAD_PRIORITY | ||
int "Thread priority" | ||
depends on TMAG5170_TRIGGER_OWN_THREAD | ||
default 10 | ||
help | ||
Priority of thread used by the driver to handle interrupts. | ||
|
||
config TMAG5170_THREAD_STACK_SIZE | ||
int "Thread stack size" | ||
depends on TMAG5170_TRIGGER_OWN_THREAD | ||
default 1024 | ||
help | ||
Stack size of thread used by the driver to handle interrupts. | ||
|
||
endif # TMAG5170_TRIGGER | ||
|
||
endif # TMAG5170 |
Oops, something went wrong.