Commit graph

49 commits

Author SHA1 Message Date
Marc Herbert 2cd51a33ce samples: make find_package(Zephyr...) REQUIRED
This provides a better error message when building with CMake and
forgetting ZEPHYR_BASE or not registering Zephyr in the CMake package
registry. See parent commit for more details (split from parent for
better readability).

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-05-29 10:47:25 +02:00
Henrik Brix Andersen bd4c7bdc92 samples: sensor: fxos8700: enable testing on lpcxpresso55s16_ns
Enable testing of the FXOS8700 present on the NXP LPCXpresso55S16
board.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-05-05 17:03:29 -05:00
Maureen Helm 4219b63949 samples: sensor: Add lpcxpresso55s69 to fxos8700 accel-only test
The lpcxpresso55s69 board has an mma8652 accelerometer which is
compatible with the fxos8700 driver in accel-only mode. Now that this
board has an i2c driver, include it in the platform whitelist.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-04-09 08:52:13 -05:00
Maureen Helm 98ec73b2c0 samples: sensor: Add a delay to the fxos8700 sample loop
The fxos8700 sample application configures the sensor driver to sample
data at 6.25 Hz. Most configurations use the sensor data ready interrupt
to throttle the loop, but it's possible to configure the sample not to
use the data ready interrupt. In this case, throttle the loop with a
delay so it doesn't outpace the sensor data.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-04-03 12:52:06 -05:00
Maureen Helm c2a6e23d37 samples: sensor: Refactor fxos8700 tests for accel-only boards
The frdm-kl25z, bbc_microbit, and reel_board have an mma8xxx
accelerometer and therefore must use the fxos8700 driver in
accelerometer-only mode instead of hybrid mode. Refactor these boards
into a separate test that uses the prj_accel.conf configuration as
described in README.rst.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-04-03 12:52:06 -05:00
Kumar Gala d711e7b7d8 samples: sensor: Convert to new DT_INST macros
Convert older DT_INST_ macro use the new include/devicetree.h
DT_INST macro APIs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-31 07:09:33 -05:00
Torsten Rasmussen 407b49b35c cmake: use find_package to locate Zephyr
Using find_package to locate Zephyr.

Old behavior was to use $ENV{ZEPHYR_BASE} for inclusion of boiler plate
code.

Whenever an automatic run of CMake happend by the build system / IDE
then it was required that ZEPHYR_BASE was defined.
Using ZEPHYR_BASE only to locate the Zephyr package allows CMake to
cache the base variable and thus allowing subsequent invocation even
if ZEPHYR_BASE is not set in the environment.

It also removes the risk of strange build results if a user switchs
between different Zephyr based project folders and forgetting to reset
ZEPHYR_BASE before running ninja / make.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-03-27 16:23:46 +01:00
Henrik Brix Andersen 917890a544 samples: sensors: fxos8700: add support for twr-ke18f board
Add support for the FXOS8700CQ present on the NXP TWR-KE18F
development board. The FXOS8700CQ IRQ lines are not connected by
default on the TWR-KE18F, so only polling (no trigger) is supported.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-07-01 11:41:25 -05:00
Henrik Brix Andersen 506256c7cc samples: sensors: fxos8700: add polling support
Add support for polling the sensor values of the FXOS8700 device when
no trigger (interrupt) is enabled.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-07-01 11:41:25 -05:00
Anas Nashif 8c1f89fa99 cleanup: include/: move sensor.h to drivers/sensor.h
move sensor.h to drivers/sensor.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Kumar Gala a2693975d7 dts: Convert from DT_<COMPAT>_<INSTANCE>_<PROP> to DT_INST...
Change code from using now deprecated DT_<COMPAT>_<INSTANCE>_<PROP>
defines to using DT_INST_<INSTANCE>_<COMPAT>_<PROP>.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-06-14 08:02:15 -05:00
Henrik Brix Andersen ae218d2950 samples: sensors: fxos8700: whitelist rv32m1_vega board
Add the RISCV RV32M1 Vega board to the whitelist in the FXOS8700
sample.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2019-04-22 08:40:03 -05:00
Anas Nashif 3ae52624ff license: cleanup: add SPDX Apache-2.0 license identifier
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier.  Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.

By default all files without license information are under the default
license of Zephyr, which is Apache version 2.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-04-07 08:45:22 -04:00
Anas Nashif da5f185e06 samples: add test identifier
Add unique identifier instead of just 'test' for samples.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-03-29 17:44:11 -04:00
Kumar Gala 5431762769 sensor: fxos8700: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert fxos8700 sensor driver to use new defines so we can remove the
dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-17 13:29:46 -06:00
Kumar Gala 5bc807949a samples: sensor: fxos8700: Add boards to sample
Add missing boards that have the fxos8700 sensor on them to build as
part of this sample.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-17 13:29:46 -06:00
Anas Nashif 5060ca6a30 cmake: increase minimal required version to 3.13.1
Move to latest cmake version with many bug fixes and enhancements.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-01-03 11:51:29 -05:00
Andrzej Głąbek 20202902f2 dts_fixups: Use DT_ prefix in all defined labels not related to Kconfig
These changes were obtained by running a script  created by
Ulf Magnusson <Ulf.Magnusson@nordicsemi.no> for the following
specification:

1. Read the contents of all dts_fixup.h files in Zephyr
2. Check the left-hand side of the #define macros (i.e. the X in
   #define X Y)
3. Check if that name is also the name of a Kconfig option
   3.a If it is, then do nothing
   3.b If it is not, then replace CONFIG_ with DT_ or add DT_ if it
       has neither of these two prefixes
4. Replace the use of the changed #define in the code itself
   (.c, .h, .ld)

Additionally, some tweaks had to be added to this script to catch some
of the macros used in the code in a parameterized form, e.g.:
- CONFIG_GPIO_STM32_GPIO##__SUFFIX##_BASE_ADDRESS
- CONFIG_UART_##idx##_TX_PIN
- I2C_SBCON_##_num##_BASE_ADDR
and to prevent adding DT_ prefix to the following symbols:
- FLASH_START
- FLASH_SIZE
- SRAM_START
- SRAM_SIZE
- _ROM_ADDR
- _ROM_SIZE
- _RAM_ADDR
- _RAM_SIZE
which are surprisingly also defined in some dts_fixup.h files.

Finally, some manual corrections had to be done as well:
- name##_IRQ -> DT_##name##_IRQ in uart_stm32.c

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-11-13 10:44:42 -06:00
Reto Schneider 7eabab2f5d samples, tests: Use semi-accurate project names
When using an IDE (e.g. Eclipse, Qt Creator), the project name gets
displayed. This greatly simplifies the navigation between projects when
having many of them open at the same time. Naming every project "NONE"
defeats this functionality.

This patch tries to use sensible project names while not duplicating
too much of what is already represented in the path. This is done by
using the name of the directory the relevant CMakeLists.txt file is
stored in. To ensure unique project names in the samples (and again, in
the tests folder) folder, small manual adjustments have been done.

Signed-off-by: Reto Schneider <code@reto-schneider.ch>
2018-10-27 21:31:25 -04:00
Johann Fischer 4ccf075d3b samples: fxos8700: add accelerometer devices to README.rst
Add information about MMA8451Q, MMA8652FC and MMA8653FC
accelerometers to README.rst

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-17 14:16:02 -05:00
Johann Fischer d294d87038 samples: fxos8700: add config for accelerometer devices
Add configuration for accelerometer devices like
MMA8451, MMA8652 and MMA8653.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-17 14:16:02 -05:00
Johann Fischer 6ca2794a88 samples: fxos8700: revised the output of the sensor values
Revised the output of the sensor values.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-17 14:16:02 -05:00
Johann Fischer 9c9b4adb9e samples: fxos8700: enable pulse and motion detection in sample.yaml
Enable pulse and motion detection in sample.yaml.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-17 14:16:02 -05:00
Johann Fischer 4a855eff4a samples: fxos8700: add motion detection overlay and test
Add motion detection overlay and test.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-17 14:16:02 -05:00
Johann Fischer 80d9ecc9db samples: fxos8700: remove DECIMATION_FACTOR
Remove DECIMATION_FACTOR from sample as the default
output data rate is set to 6.25Hz.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-17 14:16:02 -05:00
Anas Nashif deaab90641 tests/samples: cleanup tags
Remove redundant 'sample' tag and add something that matches the
functionality and features being tested, demonstrated.

Avoid short abbriviations and using full names for fs.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-16 09:17:51 -04:00
Punit Vara e5620a2b87 drivers: sensor: Migrate to new logger
Move all sensor drivers and samples to new logging system.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2018-10-16 08:49:53 -04:00
Diego Sueiro 22b61c7f43 sensors: add WaRP7 board listing for fxos8700 and fxas21002
Update yaml files to include warp7_m4 board in the platform_whitelist
for fxos8700 and fxas21002 sensors.

Signed-off-by: Diego Sueiro <diego.sueiro@gmail.com>
2018-08-21 18:54:41 -05:00
Sebastian Bøe 55ee53ce91 cmake: Prepend 'cmake_minimum_required()' into 'app' build scripts
Prepend the text 'cmake_minimum_required(VERSION 3.8.2)' into the
application and test build scripts.

Modern versions of CMake will spam users with a deprecation warning
when the toplevel CMakeLists.txt does not specify a CMake
version. This is documented in bug #8355.

To resolve this we include a cmake_minimum_required() line into the
toplevel build scripts. Additionally, cmake_minimum_required is
invoked from within boilerplate.cmake. The highest version will be
enforced.

This patch allows us to afterwards change CMake policy CMP000 from OLD
to NEW which in turn finally rids us of the verbose warning.

The extra boilerplate is considered more acceptable than the verbosity
of the CMP0000 policy.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-08-15 04:06:50 -07:00
Armando Visconti 87d6c50e47 sensors: Add separation between ambient and die temperature
Some device include a temperature sensor, usually used as a
companion for helping in drift compensation, that measure the
die temperature. This temperature IS NOT related to the the
ambient temperature, hence a clean separation between the two
is required.

This commit introduces a clean separation between the two
types of temperature leaving the old deprecated definition
still there.

The list of current drivers that read the die (and not the ambient)
temperature is the following:

 - adxl362
 - bma280
 - bmg160
 - bmi160
 - fxos8700
 - lis3mdl
 - lsm6ds0
 - lsm6dsl
 - lsm9ds0
 - mpu6050

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2018-04-03 22:29:11 -04:00
Anas Nashif 42ac8abdc3 samples: fxos8700: fix dependencies and test cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif 23f81eeb42 tests/samples: fixed yaml syntax
Use a map directory, avoid the list which makes parsing a bit
cumbersome.

Fixes #5109

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-11 14:47:08 -05:00
Carles Cufi 8146d8efbb samples: sensor: Convert doc to CMake
Convert doc of samples/sensor to CMake.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-11-12 21:13:23 -05:00
Sebastian Bøe 0829ddfe9a kbuild: Removed KBuild
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Sebastian Bøe 12f8f76165 Introduce cmake-based rewrite of KBuild
Introducing CMake is an important step in a larger effort to make
Zephyr easy to use for application developers working on different
platforms with different development environment needs.

Simplified, this change retains Kconfig as-is, and replaces all
Makefiles with CMakeLists.txt. The DSL-like Make language that KBuild
offers is replaced by a set of CMake extentions. These extentions have
either provided simple one-to-one translations of KBuild features or
introduced new concepts that replace KBuild concepts.

This is a breaking change for existing test infrastructure and build
scripts that are maintained out-of-tree. But for FW itself, no porting
should be necessary.

For users that just want to continue their work with minimal
disruption the following should suffice:

Install CMake 3.8.2+

Port any out-of-tree Makefiles to CMake.

Learn the absolute minimum about the new command line interface:

$ cd samples/hello_world
$ mkdir build && cd build
$ cmake -DBOARD=nrf52_pca10040 ..

$ cd build
$ make

PR: zephyrproject-rtos#4692
docs: http://docs.zephyrproject.org/getting_started/getting_started.html

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Anas Nashif 0356590df5 tests: samples: fix yaml syntax
Fix indentation and syntax and make it pass yamllint tool.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-15 08:15:00 -04:00
Anas Nashif 470c5f3189 tests: remove testcase.ini files
We now use yaml files.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-21 20:56:53 -04:00
Anas Nashif cc24f4b03c tests: samples: convert testcase files to yaml
This will prepare test cases and samples with metadata and information
that will be consumed by the sanitycheck script which will be changed to
parse YAML files instead of ini.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-21 20:56:53 -04:00
Maureen Helm e09dc931bf samples: fxos8700: Update doc references and sample output
Updates the fxos8700 sample documentation to include board
cross-references and sample output with temperature data.

Change-Id: I8d4e4d8d287806f5480316da09d4072fcf9c05ac
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-03-30 21:21:22 +00:00
Maureen Helm 153017834a samples: fxos8700: Add support for temperature
Enables the temperature sensor in the fxos8700 sample.

Change-Id: I2b4c306d3c5528dc32d940476c00180b5df08187
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-03-23 09:41:49 -05:00
Maureen Helm 9b715d9128 samples: fxos8700: Switch to generic SYS_LOG_SENSOR_LEVEL
The fxos8700 driver was previously converted to use the generic
SYS_LOG_SENSOR_LEVEL. Update the fxos8700 sample to use it too.

Change-Id: I2ef02342ce3a25e8d3a3d1b13181872ca0abdc16
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-03-23 09:41:49 -05:00
Bogdan Davidoaia a45dd12f0c sensor: use SENSOR_CHAN_*_XYZ instead of SENSOR_CHAN_*_ANY
SENSOR_CHAN_*_ANY will be deprecated, so use the new SENSOR_CHAN_*_XYZ
enum values.

Change-Id: I91cf25864613a934feab65588969d10c52fd4fe6
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
2017-01-27 19:07:17 +00:00
Maureen Helm 5d5b17b037 samples: fxos8700: Convert documentation to RST
Converts the fxos8700 sample documentation to RST format.

Change-Id: I26084fea4b0eb11d09cd75526c6c52e3fdd76dda
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-26 11:57:23 +00:00
Maureen Helm 1938f5dadb samples: fxos8700: Decimate sensor data before printing to the console
At the default sample rate of 400 Hz, there is not enough bandwidth on
the UART at 115200 baud to print every sample. Fix by decimating the
sensor data by 4 before printing to the console.

This issue was discovered after fixing ZEP-1507.

Change-Id: I451ec9873ca93fe417d5d5a2d6d13b5e921c7611
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-26 11:57:23 +00:00
Bogdan Davidoaia 6460e7655d samples: sensor: fxos8700: use floating point for printing sensor values
Printing values as <integer_part>.<fractional_part> gives undesired
results for negative numbers, so print the values converted to floating
point to avoid this.

Change-Id: I871b8461f2d643a2adce67df064e9f5e6d506319
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
2017-01-20 14:40:39 +00:00
David B. Kinder ac74d8b652 license: Replace Apache boilerplate with SPDX tag
Replace the existing Apache 2.0 boilerplate header with an SPDX tag
throughout the zephyr code tree. This patch was generated via a
script run over the master branch.

Also updated doc/porting/application.rst that had a dependency on
line numbers in a literal include.

Manually updated subsys/logging/sys_log.c that had a malformed
header in the original file.  Also cleanup several cases that already
had a SPDX tag and we either got a duplicate or missed updating.

Jira: ZEP-1457

Change-Id: I6131a1d4ee0e58f5b938300c2d2fc77d2e69572c
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-19 03:50:58 +00:00
Flavio Santes d47abac73d samples: Add the ARG_UNUSED macro
Avoid compiler warnings by incorporating the ARG_UNUSED macro.

Change-Id: Iea567bf5f42d9f609bf68d171e0bc0e03b62b821
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-21 12:54:53 +00:00
Sergio Rodriguez a213fb4e27 samples: sensor: fxos8700: Check sample fetch return value
The sample was reading the sample values regardless of return
value of the fetch sample function, now it exits the function and
prints an error message

Coverity-CID: 157576

Change-Id: If9a909ed9b617357a032c5632ac04984846d6744
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-12-11 04:30:02 +00:00
Maureen Helm 23b06ebd8c samples: Add fxos8700 sample application
Adds a fxos8700 sample application that uses the sensor data ready
trigger to periodically print accelerometer and magnetometer data.

Change-Id: I43fef6cd6090b58d8d0168a25558a3a05781ea5d
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2016-12-04 12:37:49 +00:00