summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2016-10-21 19:10:36 -0400
committerAnas Nashif <nashif@linux.intel.com>2016-10-26 23:47:21 +0000
commit511339f54c1f1df655911cf5c3ea13e3b9f4749e (patch)
treee6426d101128cfd84912c5c51c3c35ea1249c9c2 /samples
parent95bf69197dd653d0ddd395623783cd3bf379fda6 (diff)
samples: cleanup sensor samples
- remove useless Kconfigs - remove SPI DW kconfigs, we now use QMSI driver - Cleanup readme and turn into ReST Change-Id: Ie1f39e0afabf499fa81627ded59adf267e01993a Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Diffstat (limited to 'samples')
-rw-r--r--samples/sensor/bme280/testcase.ini1
-rw-r--r--samples/sensor/bmg160/prj.conf7
-rw-r--r--samples/sensor/bmg160/testcase.ini2
-rw-r--r--samples/sensor/bmi160/README25
-rw-r--r--samples/sensor/bmi160/README.rst24
-rw-r--r--samples/sensor/bmi160/arc/prj.conf4
-rw-r--r--samples/sensor/bmi160/x86/prj.conf2
-rw-r--r--samples/sensor/magn_polling/README.rst (renamed from samples/sensor/magn_polling/README.txt)6
-rw-r--r--samples/sensor/magn_polling/testcase.ini1
-rw-r--r--samples/sensor/max44009/prj.conf3
-rw-r--r--samples/sensor/max44009/src/main.c11
-rw-r--r--samples/sensor/sx9500/prj.conf4
-rw-r--r--samples/sensor/sx9500/src/main.c3
13 files changed, 37 insertions, 56 deletions
diff --git a/samples/sensor/bme280/testcase.ini b/samples/sensor/bme280/testcase.ini
index 0ddb87543..40a891273 100644
--- a/samples/sensor/bme280/testcase.ini
+++ b/samples/sensor/bme280/testcase.ini
@@ -2,3 +2,4 @@
kernel = nano
build_only = true
tags = samples sensor
+platform_whitelist = frdm_k64f quark_d2000_crb
diff --git a/samples/sensor/bmg160/prj.conf b/samples/sensor/bmg160/prj.conf
index fc3e1dd20..493b0accb 100644
--- a/samples/sensor/bmg160/prj.conf
+++ b/samples/sensor/bmg160/prj.conf
@@ -1,12 +1,7 @@
-CONFIG_KERNEL_BIN_NAME="zephyr"
CONFIG_PRINTK=y
-
CONFIG_GPIO=y
-
CONFIG_I2C=y
-
CONFIG_SYS_LOG=y
-
+CONFIG_SYS_LOG_SENSOR_LEVEL=4
CONFIG_SENSOR=y
CONFIG_BMG160=y
-CONFIG_BMG160_SYS_LOG_LEVEL=4
diff --git a/samples/sensor/bmg160/testcase.ini b/samples/sensor/bmg160/testcase.ini
index abda1f621..7ccede20a 100644
--- a/samples/sensor/bmg160/testcase.ini
+++ b/samples/sensor/bmg160/testcase.ini
@@ -1,6 +1,4 @@
[test]
build_only = true
tags = sensors
-
-arch_whitelist = arc
platform_whitelist = arduino_101_sss
diff --git a/samples/sensor/bmi160/README b/samples/sensor/bmi160/README
deleted file mode 100644
index 08a92a556..000000000
--- a/samples/sensor/bmi160/README
+++ /dev/null
@@ -1,25 +0,0 @@
-BMI160 sample applications
---------------------------
-
-For Arduino101 users:
-=====================
-
-Currently, the GPIO DW controller driver does not allow for AON GPIO interrupts
-to be received on ARC core. Hence, IPM is used to relay the interrupts from x86
-to ARC core.
-
-Hence, Arduino101 users have to build and flash both x86 and arc applications
-in order to test the trigger functionality.
-
-By default, the applications are configured to build for Arduino101.
-
-
-For other boards:
-=================
-
-For boards that have BMI160 connected separately, not in a Curie module (as
-it's the case for Arduino101), the ARC application is all that's needed,
-provided the user configures the driver to use a standalone GPIO.
-
-Also, if the BMI160 is connected to the x86 core, the arc application makefile
-has to be changed accordingly.
diff --git a/samples/sensor/bmi160/README.rst b/samples/sensor/bmi160/README.rst
new file mode 100644
index 000000000..ccae2e5ba
--- /dev/null
+++ b/samples/sensor/bmi160/README.rst
@@ -0,0 +1,24 @@
+BMI160 Sample Application
+##########################
+
+For Arduino 101 users:
+=====================
+
+Currently, the GPIO controller driver does not allow for AON GPIO interrupts
+to be received on ARC core. Hence, IPM is used to relay the interrupts from x86
+to ARC core.
+
+Hence, Arduino 101 users have to build and flash both x86 and arc applications
+in order to test the trigger functionality.
+
+By default, the applications are configured to build for Arduino 101.
+
+For other boards:
+=================
+
+For boards that have BMI160 connected separately, not in a Curie module (as
+it's the case for Arduino 101), the sensor subsystem application is all that's needed,
+provided the user configures the driver to use a standalone GPIO.
+
+Also, if the BMI160 is connected to the x86 core, the sensor subsystem (arc)
+application makefile has to be changed accordingly.
diff --git a/samples/sensor/bmi160/arc/prj.conf b/samples/sensor/bmi160/arc/prj.conf
index 047ccae30..482e7e886 100644
--- a/samples/sensor/bmi160/arc/prj.conf
+++ b/samples/sensor/bmi160/arc/prj.conf
@@ -1,4 +1,3 @@
-CONFIG_KERNEL_BIN_NAME="zephyr"
CONFIG_PRINTK=y
CONFIG_NANO_TIMEOUTS=y
CONFIG_IPM=y
@@ -6,10 +5,7 @@ CONFIG_IPM_QUARK_SE=y
CONFIG_IPM_CONSOLE_SENDER=y
CONFIG_SPI=y
# CONFIG_SPI_DEBUG=y
-CONFIG_SPI_DW_ARC_AUX_REGS=y
-CONFIG_SPI_DW_INTERRUPT_SEPARATED_LINES=y
CONFIG_GPIO=y
-
CONFIG_SENSOR=y
CONFIG_BMI160=y
CONFIG_BMI160_NAME="bmi160"
diff --git a/samples/sensor/bmi160/x86/prj.conf b/samples/sensor/bmi160/x86/prj.conf
index 1cabf9f26..b2d0c8181 100644
--- a/samples/sensor/bmi160/x86/prj.conf
+++ b/samples/sensor/bmi160/x86/prj.conf
@@ -1,4 +1,3 @@
-CONFIG_KERNEL_BIN_NAME="zephyr"
CONFIG_STDOUT_CONSOLE=y
CONFIG_NANO_TIMEOUTS=y
CONFIG_IPM=y
@@ -8,7 +7,6 @@ CONFIG_IPM_CONSOLE_RECEIVER=y
CONFIG_ARC_INIT=y
CONFIG_QUARK_SE_IPM_CONSOLE_RING_BUF_SIZE32=1024
CONFIG_RING_BUFFER=y
-
CONFIG_GPIO=y
CONFIG_GPIO_QMSI=y
CONFIG_GPIO_QMSI_0_PRI=2
diff --git a/samples/sensor/magn_polling/README.txt b/samples/sensor/magn_polling/README.rst
index 9ccb4d55f..4fbbd00d0 100644
--- a/samples/sensor/magn_polling/README.txt
+++ b/samples/sensor/magn_polling/README.rst
@@ -1,3 +1,9 @@
+BMC150 Magnetometer Sample
+##########################
+
+Overview
+--------
+
Sample application that periodically reads magnetometer (X, Y, Z) data from
the first available device that implements SENSOR_CHAN_MAGN_* (predefined array
of device names).
diff --git a/samples/sensor/magn_polling/testcase.ini b/samples/sensor/magn_polling/testcase.ini
index 741207d99..5460d55c1 100644
--- a/samples/sensor/magn_polling/testcase.ini
+++ b/samples/sensor/magn_polling/testcase.ini
@@ -2,3 +2,4 @@
kernel = nano
build_only = true
tags = samples
+platform_whitelist = quark_d2000_crb
diff --git a/samples/sensor/max44009/prj.conf b/samples/sensor/max44009/prj.conf
index 6ad51cfd8..55308aca7 100644
--- a/samples/sensor/max44009/prj.conf
+++ b/samples/sensor/max44009/prj.conf
@@ -1,7 +1,6 @@
-CONFIG_STDOUT_CONSOLE=y
CONFIG_PRINTK=y
-
CONFIG_I2C=y
CONFIG_SENSOR=y
CONFIG_MAX44009=y
+CONFIG_NANO_TIMEOUTS=y
diff --git a/samples/sensor/max44009/src/main.c b/samples/sensor/max44009/src/main.c
index 3146f60b6..000e6b411 100644
--- a/samples/sensor/max44009/src/main.c
+++ b/samples/sensor/max44009/src/main.c
@@ -24,17 +24,13 @@
* the result every 4 seconds.
*/
-#define SLEEPTICKS SECONDS(4)
-
void main(void)
{
struct device *dev;
struct sensor_value val;
uint32_t lum = 0;
- struct nano_timer timer;
- void *timer_data = NULL;
- printk("MAX44009 light sensor app.\n");
+ printk("MAX44009 light sensor application\n");
dev = device_get_binding("MAX44009");
if (!dev) {
@@ -42,8 +38,6 @@ void main(void)
return;
}
- nano_timer_init(&timer, timer_data);
-
while (1) {
if (sensor_sample_fetch_chan(dev, SENSOR_CHAN_LIGHT) != 0) {
printk("sensor: sample fetch fail.\n");
@@ -58,7 +52,6 @@ void main(void)
lum = val.dval;
printk("sensor: lum reading: %d\n", lum);
- nano_timer_start(&timer, SLEEPTICKS);
- nano_timer_test(&timer, TICKS_UNLIMITED);
+ task_sleep(SECONDS(4));
}
}
diff --git a/samples/sensor/sx9500/prj.conf b/samples/sensor/sx9500/prj.conf
index 4b97c89ca..b701e616a 100644
--- a/samples/sensor/sx9500/prj.conf
+++ b/samples/sensor/sx9500/prj.conf
@@ -1,9 +1,5 @@
-CONFIG_STDOUT_CONSOLE=y
-
CONFIG_I2C=y
-
CONFIG_NANO_TIMEOUTS=y
CONFIG_GPIO=y
-
CONFIG_SENSOR=y
CONFIG_SX9500=y
diff --git a/samples/sensor/sx9500/src/main.c b/samples/sensor/sx9500/src/main.c
index 3f6109238..103adb6f4 100644
--- a/samples/sensor/sx9500/src/main.c
+++ b/samples/sensor/sx9500/src/main.c
@@ -15,7 +15,6 @@
*/
#include <zephyr.h>
-#include <nanokernel.h>
#include <device.h>
#include <sensor.h>
#include <misc/printk.h>
@@ -76,7 +75,7 @@ static void do_main(struct device *dev)
ret = sensor_channel_get(dev, SENSOR_CHAN_PROX, &prox_value);
printk("prox is %d\n", prox_value.val1);
- task_sleep(sys_clock_ticks_per_sec);
+ task_sleep(SECONDS(1));
}
}