Commit graph

134 commits

Author SHA1 Message Date
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
David B. Kinder 2cb045420c doc: fix .rst files canonical heading order
The headings on some .rst files were not following the expected
heading order of using # for h1, * for h2, = for h3, and - for h4
This patch fixes that, and the doc/templates/*.tmpl files created
for folks to use as templates for creating board and sample docs.

Change-Id: I0263b005648558d5ea41a681ceaa4798c9594dd9
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-01-20 16:06:36 -08: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
Bogdan Davidoaia d4efb9a21f samples: thermometer: use convert to double function from sensor.h
Remove the convert_to_double function and use sensor_value_to_double
from sensor.h.

Change-Id: I92ef4219057f431917f4c8e9d46d4ee2074b423b
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
2017-01-16 13:15:14 +00:00
Bogdan Davidoaia 30162aedf1 sensor: remove sensor value type
Remove the type field from the sensor value structure. All values will
have the type previously defined by SENSOR_VALUE_TYPE_INT_PLUS_MICRO.

This simplifies the interface, as apps will know what value type to
expect. Apps that prefer to use double values can optain them using the
sensor_value_to_double function.

Change-Id: I3588d74258030eb16c3f89d8eead13cca4606b18
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
2017-01-15 01:09:33 +00:00
Anas Nashif eeb6a30f29 samples: apds9960: move under sensors and update docs
Change-Id: I8e5735f15dbba5b9fead8f677104843a947b28ca
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-11 12:24:58 +00:00
Marcus Shawcroft f0da59b062 sensor: Fix samples that assume incorrect sensor_value type.
Various sensor samples are hardwired to expect returned sensor values
are represented as doubles.  In each case this assumption is incorrect.

Introduce a generic sensor_value to double helper function and adjust
the samples to use it.

Change-Id: I89c788686576562b84e07a36064640231340c33b
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-01-08 16:16:15 +00:00
Anas Nashif fc6137001b doc: move documetnation context to root directory
This will allow inclusion of documentation files that exist outside of
doc/ and will make it possible to add rst files across the tree,
especially for boards, samples and tests.

Change-Id: I7afcf92d99f504b2bc0b2b7e3452acb2f8e08294
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-06 22:51:31 +00:00
Anas Nashif a6997bbc17 samples: sensors: fix documentation layout of MCP9808 sample
Change-Id: Iab5426a0689fd7ac22933e3c61e22d217af7f067
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-06 16:32:31 -05:00
Anas Nashif 813df21713 samples: sensors: fix documentation layout of TH02 sample
Change-Id: I140fdd96eea74aaeb0216829024a46f2430fc9c6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-06 16:32:31 -05:00
Baohong Liu 0632bcac25 samples: bmi160: use correct spi dev name
The dev name for spi in the sensor sub-system was changed to
SPI_SS_x from SPI_x recently. Let's use the new name in the
sample app.

Change-Id: I78cdf21fce16290503c303e0de1432b4587486aa
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-12-24 13:35:43 +00:00
Anas Nashif 4b20b634be samples: fix RST syntax and add headers
Change-Id: Ic94213f97698bd861516de0bd159fb37f9124883
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-22 08:01:49 -05: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
Baohong Liu db20723da2 samples: bmi160: code clean up
Remove CONFIG_BMI160_TRIGGER_SOURCE_GPIO from prj config
file. It is not being used any more.

Also change CONFIG_STDOUT_CONSOLE to CONFIG_PRINTK. The
whole sample is using printk instead of printf.

Change-Id: I4ac7db37da1e45aed2457ace9e82385e37143c36
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-12-16 23:07:55 +00:00
Baohong Liu 8b146d48d7 samples: bmi160: replace printf with printk
Change-Id: If1d05242d271ea4f8e4b60de8530984341f43d43
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-12-16 15:56:34 +00:00
Baohong Liu 9e4c2e92ca samples: bmi160: use direct GPIO trigger instead of ipm
Directly use AON GPIO trigger instead of IPM.

In the past, SW did not allow arc to receive AON GPIO interrupt.
So, interrupt from BMI160 was routed to x86 cpu. Then, x86 cpu
passed the event to arc through IPM. But, SW was updated and arc
is able to directly receive interrupt from AON GPIO now. So, IPM
is not needed any more. Both IPM and GPIO triggering code is there.
We just need to change the configuration by modifying the prj
config file.

The x86 code will be removed since it will not be used any more.

Change-Id: Ibc4250a34218cc52bf4c726cf70617cfdea3b2e8
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-12-16 15:56:33 +00:00
Bogdan Davidoaia 4946e3e6e6 sensor: remove SENSOR_VALUE_TYPE_INT
Remove SENSOR_VALUE_TYPE_INT as it is the same as
SENSOR_VALUE_TYPE_INT_PLUS_MICRO with val2 set to 0.

Change-Id: If5a9c579b7267701c27f40fd887acae47d64edc5
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-12-13 21:51:10 +00:00
Bogdan Davidoaia b584acb0a4 sensor: remove unused Q16_16 value type
Remove SENSOR_VALUE_TYPE_Q16_16 as it is not used by any driver. Future
drivers can use any of the remaining value types.

Change-Id: I984143cc65d6a6fd0477f310ac17c62498cc05b8
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-12-13 21:51:09 +00:00
Marcus Shawcroft 0bc4b494d7 samples: Add thermometer
Change-Id: Ia561255be4f47dcb2e17bf734af77786fda80d0b
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-12-11 11:14:06 +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
Flavio Santes 328ecb8dfd samples/sensors: Update README files
Remove nano kernel references found at the README files.

Change-Id: Id42f4797561f3d7674110bb84531b5f6e487decd
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-11-26 10:46:10 +00:00
Flavio Santes 5f818bfcd3 sensors/mcp9808: Evaluate sensor_channel_get return code
The sensor_channel_get return code is now evaluated.

Change-Id: Ib931d6caba65af7195bad53c62e6e5a3033b49e8
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-11-17 01:30:00 -06:00
Flavio Santes 0e20d45272 sensors/mcp9808: Evaluate sensor_sample_fetch return code
sensor_sample_fetch return code is now evaluated.

Coverity-CID: 151957

Change-Id: I79b9f44c79ac13e8d7da55c9e3866ad504a4a450
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-11-17 01:25:12 -06:00
Anas Nashif 3fe2575f0d drivers: sensors: use unified kernel threads
convert all sensor drivers to use threads and the unified kernel API and
remove all legacy APIs.

Change-Id: Ica43ea74ecbbf85273f718f182c413a9dcd8abc6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-11 21:00:19 +00:00
Anas Nashif d622b09bc0 samples: tests: remove obsolete KERNEL_TYPE and kernel variables
Remove those from Makefiles and testcase.ini, we now support unified kernel
only and sanitycheck script now knows how to deal with this.

Change-Id: I853ebcadfa7b56a4de5737d95f2ba096babb2e13
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-04 15:47:25 -04:00
Anas Nashif 629393192f sensors: tmp112: convert to and build with unified kernel
Change-Id: I8ba57652db533fc19ebecf213dccf1564ba85f61
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-03 01:45:51 +00:00
Anas Nashif 79232914c9 sensors: th02: convert to and build with unified kernel
Change-Id: Idcdce36314dce4bfe9f6cf627c38b9f350b19355
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-03 01:45:50 +00:00
Anas Nashif bf169afd46 sensors: sx9500: convert to and build with unified kernel
Change-Id: Ic3e8d0c59eda97759f1d56127f42120b0c0a6def
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-03 01:45:50 +00:00
Anas Nashif 5d3634d0b1 sensors: mcp9808: convert to and build with unified kernel
Change-Id: I8bd15fd5c353c2040ffb99e759b7739d435f2829
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-03 01:45:49 +00:00
Anas Nashif ee23f1464b sensors: max44009: convert to and build with unified kernel
Change-Id: I024d00dfd264b9ca8afb682f4146176678440ed8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-03 01:45:49 +00:00
Anas Nashif 1dc946bda1 sensors: magn_polling: convert to and build with unified kernel
Change-Id: Ib0c364c1e9faa95adf8e7a5dde8d6aa1214d9771
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-03 01:45:48 +00:00
Anas Nashif 159b27f3c5 sensors: bmg160: convert to and build with unified kernel
Change-Id: I4571cc371dcbbfaaf1a6b3a9abacac1f4b6e2821
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-03 01:45:48 +00:00
Anas Nashif 9a82a81d58 sensors: bmi160: convert to and build with unified kernel
Change-Id: I63bf181b6ec84e21a2e83bb5bce4ffb57b3affe8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-03 01:45:47 +00:00
Anas Nashif 221bb6979b sensors: bme280: convert to and build with unified kernel
Change-Id: I721ae3a9b982ff4571e7e9bc966df8c79c4dc6c3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-03 01:45:46 +00:00
Anas Nashif 5925eaf5f1 optimize testcase runs for sensors
Change-Id: If701d1824572bed068712750fbd14758806ba70f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-26 23:47:39 +00:00
Anas Nashif 511339f54c 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>
2016-10-26 23:47:21 +00:00
Anas Nashif 95bf69197d samples: sensors: cleanup mcp9808 sample and refine documentation
Enhance documentation and build for Quark D2000 Devboard by default.

Change-Id: I3417c31a8898a076465d25f45d7821820b480290
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-26 23:46:38 +00:00
Anas Nashif c224491aec samples: sensors: remove reference to non-existing MDEF_FILE
Change-Id: Ideaa795e8afc8d3226adc340db7299eaa9bf6bcc
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-25 23:16:32 +00:00
Anas Nashif 71d6ad2619 sensors: bmi160: remove unused init priority config
Change-Id: I367d7b084fb93609000066b610e01a802fdd152e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-20 09:39:51 +00:00
Anas Nashif a61a7faf53 samples: TH02 temperature and humidity sensor sample
This sample uses the grove temperature and humidity sensor and displays the
read values on the grove LCD.

Change-Id: Id6fb6171c26c97f1b01008fa06a4dc85287d7545
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-17 00:24:34 +00:00
Anas Nashif 84c9db39e7 gpio: reduce Kconfigs and use consistent name for GPIOs
Using AON for GPIO kconfigs is very specifc to quark se, there
is no need to make this special for this platform. Use the
existing scheme instead.

Change-Id: I946431490380dc0f537d6056277a94c9c9c80fed
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-07 16:15:07 +00:00
Anas Nashif f482200f9c samples: remove useless filters in testcase.ini
Change-Id: Iaf7f77a738a48918752347c97019660355de370a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-07 14:07:24 +00:00
Anas Nashif 5363d14a9e boards: rename Quark SE Devboard to Quark SE C1000
This board now has an official name and will be available soon:

http://www.intel.com/content/www/us/en/embedded/products/quark/mcu/se-soc/overview.html

Jira: ZEP-758
Change-Id: Ia16d33722308cf81471321c3063bdc75055a4d50
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-16 03:10:31 +00:00
Anas Nashif 5e4b62c35c boards: rename Quark SE Devboard to Quark SE C1000 (Sensor Subsystem)
Jira: ZEP-758
Change-Id: I8ee5a2f9e4a6ecbd15214e59321bf27a502ef6ee
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-16 03:10:30 +00:00
Anas Nashif 4589f2c468 samples: use printf/printk directly instead of macros
In many cases there is no need to define a macro for printing to
the console, just use the correct variant directly.

Jira: ZEP-240
Change-Id: I9952deda4bfc60424f01fca2443d037562d13d0d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-14 16:56:02 +00:00
Anas Nashif e38abba451 tests: change tags for sensors
Change tags to reflect the type of samples, in this case it is all
about sensors.

Change-Id: I9f87e8683dd52fd757cd07ba5aa9fad99d17ab38
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-11 19:10:40 +00:00
Anas Nashif 62289e6de7 quark_se: disable IPM and enable UART0 on the sensor subsystem
Treat the sensor subsystem as an independent board that can send
messages to UART and disable IPM and the messaging interface. IPM
can be enabled by applications that require such interface.

Fix all samples that are affected by this change to make sanitycheck
pass.

Jira: ZEP-451
Change-Id: I3df6af16adefaefec02b97778d6c68ffc920ac35
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-08-31 16:31:04 +00:00
Andrew Boie 701f0598a8 Revert "misc: Remove generic PRINT macros from sensor samples"
This reverts commit 107f38acf6.

Change-Id: I6c5aa1323da485fc7a04452537d67c797a18bba5
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-23 13:19:44 -07:00
Andrew Boie a0a5e82205 samples: mcp9808: build for sanitycheck runs
Change-Id: I593478da5f9f168be8415ada83b97876fe0b3b99
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-15 09:38:54 -07:00
Andrew Boie 58823e92fc samples: bme280: build for sanitycheck runs
Change-Id: I410c602a323e8aba00bc57111f1bb536a4dc0bf6
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-15 09:38:54 -07:00
Andrew Boie 342392fbd9 samples: tmp112: build for sanitycheck
Change-Id: I6b1da26495f1fa1063b1ca9d2990ee428fbaad1e
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-15 09:38:54 -07:00
Andrew Boie 48567055cf samples: sx9500: build for sanitycheck
Change-Id: Ic0a3614b6bd98d0e65117704b5da10ecdee39996
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-15 09:38:53 -07:00
Andrew Boie e61041dade samples: magn_polling: build for sanitycheck
Change-Id: I10ca471302050a107e720dfd4ca6c9961b588721
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-15 09:38:53 -07:00
Juan Manuel Cruz Alcaraz 107f38acf6 misc: Remove generic PRINT macros from sensor samples
Remove generic PRINT macros from sensor samples and replace
with SYS_LOG  module.

Jira: ZEP-240

Change-Id: I474efcd1daf8e621acd50d88b3a9662b8cd2b516
Signed-off-by: Juan Manuel Cruz Alcaraz <juan.m.cruz.alcaraz@intel.com>
2016-08-05 20:36:53 +00:00
Baohong Liu 538d8d184d sensor: fix BMI160 sensor hang issue
Fix several issues which are causing the BMI160 app hang.

For SPI duplex transfer, QMSI only supports equal length.
For SPI freq, divider is used. Actual freq is no longer used.

Jira: ZEP-461

Change-Id: I1a1bcc12c6514c3797686dfdad1ce1b852f7dc78
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-08-05 17:35:42 +00:00
Bogdan Davidoaia a30a3ac949 samples: bmi160: add sensor_value_sprintf helper function
Add helper function for printing sensor_value to char buffer.

Change-Id: I46329675d9a69376ea74c4f7dfcb270ca2078c72
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-08-02 05:22:44 +00:00
Kumar Gala fd9c66e3f2 samples: sensor: bmi160: Fix Kconfig dev name typo
The sample prj.conf file was using CONFIG_BMI160_DRV_NAME which doesn't
exist.  Use CONFIG_BMI160_NAME instead.

Change-Id: I6eb29bf7772055a7b1fd62461fabe8e358dd10ec
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-07-28 07:22:35 -05:00
Baohong Liu d215841808 samples: Add an app for MAX44009 light sensor
Add a sample app to read MAX44009 light sensor via i2c
of quark se sensor system.

Origin: Original

Change-Id: I7078b3383021cdc81ff7b59fd1958e6bf86fe988
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-07-27 18:03:34 -07:00
Mariusz Ryndzionek d4983df3b1 samples: add simple tmp112 sensor application
Periodically reads temperature and prints it on console

Change-Id: I293a7aad88bce245d6c1149fd19fcb7c7e770e54
Signed-off-by: Mariusz Ryndzionek <mariusz.ryndzionek@firmwave.com>
2016-06-30 14:50:56 +00:00
Kumar Gala 7dcbbc39e7 build: move from srctree to ZEPHYR_BASE for app include paths
$srctree for the application might not be set to be $ZEPHYR_BASE, use
$ZEPHYR_BASE instead to be more explicit in the build.

Change-Id: Iefa5ff59f246b584949329044f7a6531adc6ed62
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-06-30 14:36:39 +00:00
Bogdan Davidoaia 72786486c6 sensor: remove CONFIG_SENSOR_DEBUG
Remove the CONFIG_SENSOR_DEBUG as it is no longer needed since switching
to SYS_LOG_* in the sensor susbsystem.

Also, use __ASSERT where CONFIG_SENSOR_DEBUG was used to validate
function parameters.

Change-Id: I80ed7209abfb92220fa229d246c5b3a43b887e32
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-05-21 21:20:13 +00:00
Murtaza Alexandru 310ed1e2e9 sensor: add support for BME280
* Rename BMP280 to BME280 which is a superset for the former.
* Autodetect device based on chip ID.
* Implement humidity fetching and reading for BME280
* Rename sample BMP280 to BME280

Change-Id: I565c769a7011e7496c9f1cad861d5ee311839b4f
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
2016-05-17 20:07:34 +00:00
Anas Nashif f62d86c42b samples: get rid of obsolete usage of ARCH variable
Using ARCH variable to select different configurations for the different
architectures is misleading and conflicts with the variable ARCH being used by
the build system.  The variable is not needed, it is application specific and
an application can be built without the need to specify ARCH on the command
line.

This is yet another item specific to samples and test cases that
wrongfully being used and documented for every application.  We need to use
another variable and just make it clear it is specific to samples and how they
are written.  One possible solution is to have a script that gets the
architecture based on the board being used.  Attachments

Jira: ZEP-238
Change-Id: Ieccbc087a41858fb96fb361c0aaa04705e968a4e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-12 10:57:28 +00:00
Anas Nashif fbe7d90ead spi: consalidate and simplify
Use the same Kconfig infrastructure and options for all SPI drivers.

Jira: ZEP-294
Change-Id: I7097bf3d2e1040fcec166761a9342bff707de4dd
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-12 10:57:26 +00:00
Anas Nashif 0140da310b i2c: unify kconfig options and share them across drivers
Reduces Kconfig variables by ~20

Change-Id: If39f7d49482d62417c621f98bc8c0c78df0d4139
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-12 10:57:22 +00:00
Laurentiu Palcu 5841aeae14 sensor: bmg160: add sample application
The application tests polling mode and trigger mode (both data ready and
anymotion triggers).

Origin: Original
Change-Id: Ic0f9400758aaf56ef95f0f3c68c872d1bfd51176
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-05-04 13:14:00 +00:00
Anas Nashif fe1fb2a9b9 samples: magn_polling: include stdio.h and remove redundant configs
Change-Id: I8b2c729761c36c777c675c2b26f9ec7d3a22567c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-28 12:29:14 +00:00
Anas Nashif 9eaf052778 sensors: sample: this testcase is for arduino_101
Change-Id: Id0299a05aab171621a317e4ea446acd65150d6ac
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-27 15:04:18 +00:00
Murtaza Alexandru f1b95df34e sensor: rename SENSOR_TYPE_* to SENSOR_VALUE_TYPE_*
Rename sensor_value_type enums from SENSOR_TYPE_* to more concludent
name SENSOR_VALUE_TYPE_*. This change is required if we want to
introduce SENSOR_TYPE_* (SENSOR_TYPE_ACCEL - if the sensor/driver
supports accelerometer, SENSOR_TYPE_MAGN - etc.) in the future.
Also it is more clear with this notation what these enums are referring
to.

Change-Id: Ic58e29288669e10c0695e0f86f59b0e57f7ac38c
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
2016-04-26 18:09:41 +00:00
Laurentiu Palcu 47de28535a sensor: bmi160: switch x86 app to QMSI GPIO driver
Change-Id: I1265507aec8214fbdad4ea3d88cd4358081dfced
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-26 10:57:56 +00:00
Anas Nashif 4b854b00c3 sx9500: remove explicit definitions for GPIO/I2C
Change-Id: I6c0e13707a91db993737297c59ed77603c561377
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-25 19:17:05 +00:00
Tomasz Bursztyka cc53ac7918 samples: sensor: Use new GPIO callback API for bmi160 sample
gpio_set_callback is meant to be deprecated and thus modifying the
sample to use the new GPIO callback API.

Change-Id: I822cd1c81575834d40926c56cd61b87884230594
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-04-25 14:58:16 +00:00
Laurentiu Palcu 01d133a201 sensor: bmi160: add trigger tests to the application
Also, lower the clock for the SPI bus in order not to hit the DW
controller CS issue.

Change-Id: I69c4211bfa6efb85117185e2ae813dd7c4915a7a
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-21 14:16:15 +00:00
Laurentiu Palcu b70278f113 sensor: bmi160: add x86 app for Arduino101
This app is needed for Arduino101 only, or boards using the Curie
module.

BMI160 interrupt pin is connected to AON GPIO controller. The driver
handling the AON GPIO controller runs on x86 core. Even though, the AON
GPIO controller is accesible to ARC core too, the current implementation
for Designware controller driver does not allow it. Hence, this app will
register a gpio callback and signal the ARC core through IPM.

Other boards that use a gpio pin on the regular GPIO controllers don't
need this app.

Origin: Original
Change-Id: I225ca60735e39c7a47693dc53237f48cd9ac2680
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-21 14:16:12 +00:00
Laurentiu Palcu 559112a6a0 sensor: bmi160: move sample app to arc subdirectory
The movement is needed because on some boards, like Arduino101, the
current GPIO driver implementation does not allow for receiving
interrupts from AON GPIO controller directly on ARC core. Hence, IPM is
needed to relay the interrupts from x86 to arc.

However, other boards that can use a regular GPIO intterupt or users
that connect a BMI160 chip separately, can still use the ARC application
as is.

Change-Id: I58dd77edd45ea2b071db5b99073eb15722847bfe
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-21 14:16:12 +00:00
Vlad Dogaru fd094f8cfc samples: revert to default CFLAGS
SDK version 0.7.5 has fixed ZEP-62.  It is no longer necessary to use
-O0 in order to get correct readings from sensors.

Change-Id: Ia8ac2f55453b7dfdda71fe2f41863cbd0b366739
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
2016-04-08 17:24:38 +00:00
Laurentiu Palcu dbe2c5faff bmi160: Add sample application
Origin: Original
Change-Id: I8bd3fa30f3794de0fa22ffff8e3eaeb213612741
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-02 23:08:48 +00:00
Vlad Dogaru 0e702a6ce3 sensor: add driver for BMP280
This is a temperature and atmospheric pressure chip.  The datasheet is
available at:
	https://www.adafruit.com/datasheets/BST-BMP280-DS001-11.pdf

Change-Id: I3406eb6c2c4da564757b8315323d0681d648b541
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
2016-03-27 00:34:38 +00:00
Murtaza Alexandru 9d4c6507e4 sensor: add magnetometer generic polling sample
Add generic sample that continuosly read magnetometer data from
the first device that finds available within a predefined list.

Change-Id: Ia9b5fd434f462fb4704896852415f90eb633e1eb
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
2016-03-19 10:40:14 +00:00
Vlad Dogaru e479839fa1 samples: Add sample app for sx9500 sensor driver
This illustrates the usage of the sensor API, using either triggers or
periodic reads from the driver.

Origin: Original
Change-Id: Ief7451fc4771b9459a2b3b7ed0a33341a7710cc3
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
2016-03-15 18:04:19 -04:00
Vlad Dogaru 49d96d95ab sensor: Add threshold trigger support for MCP9808
The MCP9808 supports threshold triggering.  Add support for this feature
in the driver and the sample application.

If triggering is activated, the driver can create its own fiber or use
the system-wide sensor fiber.

Origin: Original
Change-Id: Ie825a22245cb48cbdffba3049011e4d305975d53
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
2016-03-15 18:04:19 -04:00
Vlad Dogaru d30b3ca516 samples: Add sample app for MCP9808 sensor
The app simply reads the temperature from the connected MCP9808 sensor.
It forces -O0 compile flags, as the default (-Os) triggers a compiler
bug when converting temperature readings.

Origin: Original
Change-Id: I0654543e3d361a862bdf78b44fdc1430cb6aad51
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
2016-03-15 18:04:19 -04:00