samples: sensor: qdec: Remove sample
The sensor shell can handle / does everything this sample does so just remove the sample in favor of sensor shell. Signed-off-by: Kumar Gala <galak@kernel.org>
This commit is contained in:
parent
6c1373fab6
commit
774f8b5b73
7 changed files with 0 additions and 114 deletions
|
@ -1,8 +0,0 @@
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.20.0)
|
|
||||||
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
|
|
||||||
project(thermometer)
|
|
||||||
|
|
||||||
FILE(GLOB app_sources src/*.c)
|
|
||||||
target_sources(app PRIVATE ${app_sources})
|
|
|
@ -1,37 +0,0 @@
|
||||||
.. _qdec:
|
|
||||||
|
|
||||||
QDEC: Quadrature Decoder
|
|
||||||
###########################
|
|
||||||
|
|
||||||
Overview
|
|
||||||
********
|
|
||||||
A simple quadrature decoder example
|
|
||||||
|
|
||||||
Building and Running
|
|
||||||
********************
|
|
||||||
|
|
||||||
This project writes the quadrature decoder position to the console once every
|
|
||||||
2 seconds.
|
|
||||||
|
|
||||||
Building on SAM E70 Xplained board
|
|
||||||
==================================
|
|
||||||
|
|
||||||
.. zephyr-app-commands::
|
|
||||||
:zephyr-app: samples/sensor/qdec
|
|
||||||
:host-os: unix
|
|
||||||
:board: sam_e70_xplained
|
|
||||||
:goals: build
|
|
||||||
:compact:
|
|
||||||
|
|
||||||
Sample Output
|
|
||||||
=============
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
Quadrature Decoder sample application
|
|
||||||
|
|
||||||
Position is 6
|
|
||||||
Position is 12
|
|
||||||
Position is -45
|
|
||||||
|
|
||||||
<repeats endlessly every 2 seconds>
|
|
|
@ -1 +0,0 @@
|
||||||
CONFIG_QDEC_SAM=y
|
|
|
@ -1,14 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2021, Piotr Mienkowski
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
&tc0 {
|
|
||||||
compatible = "atmel,sam-tc-qdec";
|
|
||||||
status = "okay";
|
|
||||||
label = "QDEC_0";
|
|
||||||
|
|
||||||
pinctrl-0 = <&tc0_qdec_default>;
|
|
||||||
pinctrl-names = "default";
|
|
||||||
};
|
|
|
@ -1,2 +0,0 @@
|
||||||
CONFIG_SENSOR=y
|
|
||||||
CONFIG_STDOUT_CONSOLE=y
|
|
|
@ -1,9 +0,0 @@
|
||||||
sample:
|
|
||||||
name: Quadrature Decoder
|
|
||||||
tests:
|
|
||||||
sample.sensor.qdec:
|
|
||||||
tags: sensors
|
|
||||||
harness: sensor
|
|
||||||
platform_allow: sam_e70_xplained
|
|
||||||
integration_platforms:
|
|
||||||
- sam_e70_xplained
|
|
|
@ -1,43 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2021, Piotr Mienkowski
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <zephyr/zephyr.h>
|
|
||||||
#include <zephyr/drivers/sensor.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
void main(void)
|
|
||||||
{
|
|
||||||
const struct device *dev;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
printf("Quadrature Decoder sample application\n\n");
|
|
||||||
|
|
||||||
dev = device_get_binding("QDEC_0");
|
|
||||||
if (!dev) {
|
|
||||||
printf("error: no QDEC_0 device\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (1) {
|
|
||||||
struct sensor_value value;
|
|
||||||
|
|
||||||
ret = sensor_sample_fetch(dev);
|
|
||||||
if (ret) {
|
|
||||||
printf("sensor_sample_fetch failed returns: %d\n", ret);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = sensor_channel_get(dev, SENSOR_CHAN_ROTATION, &value);
|
|
||||||
if (ret) {
|
|
||||||
printf("sensor_channel_get failed returns: %d\n", ret);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
printf("Position is %d\n", value.val1);
|
|
||||||
|
|
||||||
k_sleep(K_MSEC(2000));
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue