diff options
author | Pete Johanson <peter@peterjohanson.com> | 2020-07-20 20:54:58 -0400 |
---|---|---|
committer | Pete Johanson <peter@peterjohanson.com> | 2020-07-20 20:54:58 -0400 |
commit | 109c69cbab0a417c97b20788b0fd3bcd720178f1 (patch) | |
tree | cf784baf61b03bf48cc9f021cd069debd9554e00 /app/src | |
parent | 331bfa70521112759a4b553356a90eee8747644d (diff) |
EN11 is actually EC11, some sample work.
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/drivers/sensors/en11/CMakeLists.txt | 6 | ||||
-rw-r--r-- | app/src/drivers/sensors/en11/Kconfig | 52 | ||||
-rw-r--r-- | app/src/main.c | 15 |
3 files changed, 15 insertions, 58 deletions
diff --git a/app/src/drivers/sensors/en11/CMakeLists.txt b/app/src/drivers/sensors/en11/CMakeLists.txt deleted file mode 100644 index 4c538ca..0000000 --- a/app/src/drivers/sensors/en11/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 - -zephyr_library() - -zephyr_library_sources_ifdef(CONFIG_EN11 en11.c) -zephyr_library_sources_ifdef(CONFIG_EN11_TRIGGER en11_trigger.c) diff --git a/app/src/drivers/sensors/en11/Kconfig b/app/src/drivers/sensors/en11/Kconfig deleted file mode 100644 index 84fec95..0000000 --- a/app/src/drivers/sensors/en11/Kconfig +++ /dev/null @@ -1,52 +0,0 @@ -# EN11 incremental encoder sensor configuration options - -# Copyright (c) 2020 Peter Johanson -# SPDX-License-Identifier: MIT - -menuconfig EN11 - bool "EN11 Incremental Encoder Sensor" - depends on GPIO - help - Enable driver for EN11 incremental encoder sensors. - -if EN11 - -choice - prompt "Trigger mode" - default EN11_TRIGGER_NONE - help - Specify the type of triggering to be used by the driver. - -config EN11_TRIGGER_NONE - bool "No trigger" - -config EN11_TRIGGER_GLOBAL_THREAD - bool "Use global thread" - depends on GPIO - select EN11_TRIGGER - -config EN11_TRIGGER_OWN_THREAD - bool "Use own thread" - depends on GPIO - select EN11_TRIGGER - -endchoice - -config EN11_TRIGGER - bool - -config EN11_THREAD_PRIORITY - int "Thread priority" - depends on EN11_TRIGGER_OWN_THREAD - default 10 - help - Priority of thread used by the driver to handle interrupts. - -config EN11_THREAD_STACK_SIZE - int "Thread stack size" - depends on EN11_TRIGGER_OWN_THREAD - default 1024 - help - Stack size of thread used by the driver to handle interrupts. - -endif # EN11 diff --git a/app/src/main.c b/app/src/main.c index f42c7c4..d04efae 100644 --- a/app/src/main.c +++ b/app/src/main.c @@ -23,7 +23,22 @@ static struct sensor_trigger trigger; void encoder_change(struct device *dev, struct sensor_trigger *trigger) { + int err; + struct sensor_value value; + LOG_DBG(""); + + err = sensor_sample_fetch(dev); + if (err) { + LOG_ERR("Failed to fetch new EC11 sample"); + return; + } + + err = sensor_channel_get(dev, SENSOR_CHAN_ROTATION, &value); + if (err) { + LOG_DBG("Failed to get the sample for EC11 %d", err); + return; + } } void init_sensor() |