Commit graph

1951 commits

Author SHA1 Message Date
Baohong Liu f2c1b4bb02 drivers: 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. Let's remove IPM related code and use
GPIO as the default trigger source.

This change is on top of the bmi160 sample app change to not use
IPM.

Change-Id: I49d8040764d03b24e09d89e66643c020ef63a3c9
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-12-16 15:56:33 +00:00
Qiu Peiyang 597349207a drivers: sensor: replace device sync APIs with semaphores
Device sync APIs are actually wrappers for semaphores.
Let's replace them with semaphores.

Jira: ZEP-1411

Change-Id: I77c5c749f9e263f172d2ea7c0c0088eb9e68d235
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
2016-12-16 13:30:30 +00:00
Bogdan Davidoaia de4727ba3f sensor: update drivers to not return double values
Update drivers to return INT_PLUS_MICRO values instead of doubles.

This hides the fact that the drivers use floating point operations and
doesn't force the application to use them as well.

Change-Id: I14c6faecb35331c2fdbdab41bc624d751de984b8
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-12-13 21:51:11 +00:00
Bogdan Davidoaia 708fe8c1e3 sensor: use integers for simple value calculations
Use integers for sensor value calculations in which doubles are not
required.

Change-Id: I8662023ca596cb232e31849b0b77ae2bf0372cf0
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-12-13 21:51:10 +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
Sergio Rodriguez 1e2e05c784 drivers: sensor: fxos8700: Fix uninitialized variable
This issue was reported by Coverity

Coverity-CID: 157621

Change-Id: I7f84c0868467ab55e033aecac037967da001a6db
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-12-13 11:36:27 +00:00
Marcus Shawcroft a94437c03c sensor: Add nRF5 temperature driver.
Basic interrupt driven driver for the nRF5 onboard temperature sensor.

Change-Id: Id0ac303293b8e8b8285b19bcda31284ee6617105
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-12-11 11:14:05 +00:00
Baohong Liu b3195581e7 drivers: sensor: add missing license header
Change-Id: I0d666ba8a83ea523dd15cdc94f0565fee9f7288e
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-12-09 17:39:05 -08:00
Flavio Santes b04cdcd6e6 drivers: Remove legacy nanokernel.h include
This commit replaces the nanokernel.h include by kernel.h.

Change-Id: Ib42fbf2d9f77a73c0831f569b3dbbfb342ea2e1d
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-04 14:59:37 -06:00
Maureen Helm 550b02e438 fxos8700: Add support for data ready trigger
Adds general sensor triggering support to the fxos8700 driver, including
options for the driver to use its own thread or the global workqueue
thread to handle sensor interrupts. Adds specific support to handle the
data ready sensor trigger.

Jira: ZEP-1395
Change-Id: I092f22e35747b92a88eb71a3d162a4fc16227b45
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2016-12-04 12:37:47 +00:00
Anas Nashif 91b47b9d3c sensors: change init level from NANOKERNEL to POST_KERNEL
Change-Id: Iba788e2b0b60d89e6b9bf6f5de73ff2f5cdbebbc
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-02 15:52:34 +00:00
Baohong Liu 313700e26f drivers: sensor: use unified kernel API
Change-Id: I5d51e65105f9dee3d5eb49c60b9e5636ebd14df6
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-30 23:54:58 +00:00
Qiu Peiyang 3763487575 sensor: fix typo in Kconfig
Change-Id: I0fc7e0f66ba994f42a04684e4862fc3218ddd075
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
2016-11-29 12:59:35 +00:00
Marcus Shawcroft 7df7862749 sensor/bmc150: Limit name space, add static.
Change-Id: Ifd9ec1aec4e6486c14121b30bcd009b61456276d
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-11-27 10:27:56 +00:00
Marcus Shawcroft c3b2861572 sensor/bmc150: Fix filename in comment.
Change-Id: I0a5aaf0f3633034fabef351dc419899f9bb9c8fd
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-11-27 10:27:56 +00:00
Marcus Shawcroft 91bc741255 sensor/bmc150: Fix logging configuration.
Change-Id: Iae06066b568f51c8b63f00e973a411dcbb396dac
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-11-27 10:27:56 +00:00
Marcus Shawcroft 40d2572d12 sensor/lsm9ds0_gyro: Limit name space, add static.
Change-Id: Ifff624a2c0f619d7bb3e005b4e52b4602730a66d
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-11-27 10:27:56 +00:00
Marcus Shawcroft 8f92c5462e sensor/lsm9ds0_gyro: Fix filename in comment.
Change-Id: I6de8806fbe6ec25c83042bc52274fd91a76ae280
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-11-27 10:27:56 +00:00
Marcus Shawcroft 9048cb91d0 sensor/lsm9ds0_gyro: Fix logging configuration.
Change-Id: I332d9515e61d83f243f49353d4b67f854fec7f2e
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-11-27 10:27:56 +00:00
Marcus Shawcroft 744e438a33 sensor/lsm9ds0_mfd: Fix logging configuration.
Change-Id: I925a683e0ac961f05065b25782fc30d007e1aba6
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-11-27 10:27:56 +00:00
Marcus Shawcroft aba867d5e9 sensor/fxos8700: Switch to generic SYS_LOG_SENSOR_LEVEL
Change-Id: I21607836b2fe0cd1cd62759bed499af70a93e1be
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-11-27 10:27:55 +00:00
Marcus Shawcroft f112e8e9bc sensor/lps25hb: Limit name space add static.
Change-Id: I707fd3666f27a982f9b4ef0facf7a3a211db8914
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-11-27 10:27:55 +00:00
Marcus Shawcroft 5fe0a759ee sensor/lps25hb: Fix filename in comment.
Change-Id: Ie5529544248d408cb314be83a609b8d1d9ecaaa5
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-11-27 10:27:55 +00:00
Marcus Shawcroft 052a67f88d sensor: Remove unsued LPS25HB_SYS_LOG_LEVEL config.
Change-Id: I5af84fd420a9c50f943938faf7ed966385c19f08
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-11-27 10:27:55 +00:00
Marcus Shawcroft 14cd63a92a sensor/lsm6ds0: Limit name space, add static.
Change-Id: I227865ebbb6bf66b63694639dede3f0276c4cf22
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-11-27 10:27:55 +00:00
Marcus Shawcroft 9dc050d15e sensor/lsm6ds0: Fix filename in comment.
Change-Id: I50df25c209c322f404e7a78c5df57c2c7d75964b
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-11-27 10:27:55 +00:00
Marcus Shawcroft 79a4d35043 sensor: Remove unsued LSM6DS0_SYS_LOG_LEVEL config.
Change-Id: I7b994b33a1202cbc75a8ce5afd0385a45627f45d
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-11-27 10:26:53 +00:00
Vincenzo Frascino ceca10828a sensor: Fix Unchecked return value in bma280 driver
This patch fixes two "Unchecked return value" conditions into the bma280
driver.

The issue was reported by Coverity (CID 151953).

Change-Id: I2e595b67619411594cec527f358f6c3d3d034550
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2016-11-16 13:30:11 +00:00
Baohong Liu d6ba1c0c3e drivers: bmi160: fix variable type mismatching issue
The variable type mismatching was caught by LLVM.

Jira: ZEP-1179

Change-Id: I1193a946ea5814510e6c07668c5d05a5d91445a8
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-16 02:08:21 +00:00
Sergey Kiselev 2e10266975 sensors: bme280: fix typo in reading trimming parameters
Change-Id: I32e72c2845bd06b10585ac8048f67ac754c2a6d6
Signed-off-by: Sergey Kiselev <sergey.kiselev@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-16 01:37:54 +00:00
Vincenzo Frascino 34b7fbfca7 sensor: Fix Unchecked return value issues in bme280 driver
This patch fixes unchecked return value conditions in the bme280
driver.

This issue was reported by Coverity (CID 151961, 151959, 151955).

Change-Id: I3a2dfbabd41ae52b00fa512a40e00c2e36c3b5ca
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2016-11-16 00:42:22 +00:00
Vincenzo Frascino 5912d7abe7 sensor: Fix less-than-zero comparison in bmi160 driver
This patch fixes a less-than-zero comparison of an unsigned value
condition present in bmi160 driver.

This issue was reported by Coverity (CID 152002, 152003).

Change-Id: I703066519652ac1ecdd9ddf7e97ec7dcbe2a9e27
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2016-11-16 00:42:21 +00:00
Anas Nashif 55273b0c76 drivers: sensor: use unified timer struct name in header
Change-Id: I2d2a1689d66ed4a9ab1ce1ed5bb70c8b65f7df31
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-13 13:53:52 +00: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 8910c228a2 sensors: use unified kernel APIs for kernel objects
move both semaphores and nano_work objects to unified kernel APIs.

Change-Id: Icca8a091063544c451e47201cd8e956b95010513
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-11 21:00:19 +00:00
Andrew Boie 0b474eef9c kernel: deprecate old init levels
PRIMARY, SECONDARY, NANOKERNEL, MICROKERNEL init levels are now
deprecated.

New init levels introduced: PRE_KERNEL_1, PRE_KERNEL_2, POST_KERNEL
to replace them.

Most existing code has instances of PRIMARY replaced with PRE_KERNEL_1,
SECONDARY with POST_KERNEL as SECONDARY has had a longstanding bug
where the documentation specified SECONDARY ran before the kernel started
up, but actually ran afterwards.

Change-Id: I771bc634e9caf7f17dbf214a270bc9967eed7d32
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-11-09 17:59:44 +00:00
Benjamin Walsh 8cf56bcac7 unified: dissociate system workqueue from common workqueue module
Making a reference to the common work queue code should not necessarily
drag in the system workqueue, since it is possible to use a workqueue
that is not the system workqueue. This is done by moving the system
workqueue into its own code module.

Moving the system workqueue to its own code module allows removing the
NANO_WORKQUEUE and SYSTEM_WORKQUEUE kconfig options, and compiling the
common workqueue code and system workqueue all the time. They are only
linked in the final image if a reference to them exist, same as the
other kernel modules.

Change-Id: I6f48d2542bda24f4702e7c2e317818dd082b3c11
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-11-04 22:39:54 +00:00
Maureen Helm 3bdc77ee09 sensor: fxos8700: Add accelerometer/magnetometer driver
Adds basic sensor driver support for the NXP FXOS8700 6-axis
accelerometer/magnetometer. Currently this driver supports
accelerometer-only, magnetometer-only, and hybrid (accelerometer +
magnetometer) modes, as well as 2g, 4g, and 8g accelerometer full scale
ranges.

This driver does not yet support any sensor triggers such as the data
ready trigger, or runtime changing of sensor attributes.

Datasheet:
http://cache.nxp.com/files/sensors/doc/data_sheet/FXOS8700CQ.pdf

Origin: Original
Jira: ZEP-721

Change-Id: Iff0f751c737196f60d5c5d3448631b57093ece34
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2016-10-27 14:36:43 +00:00
Marcus Shawcroft 1a13bb8c40 sensor/hp206c: Limit namespace, add static.
Change-Id: I08d0029fae70434794e09a7c9563383d1db58fe0
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-26 16:52:15 -04:00
Marcus Shawcroft a2e91dadb3 drivers/hp206c: Make driver_api structure const.
Change-Id: I6e3c7e4e420d9b9c55bbb49cf6f13b6e09ec4bb7
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-26 16:52:15 -04:00
Marcus Shawcroft 2030855399 sensor/hp206c: Correct the SYS_CLOCK_TICKS_PER_SEC diagnostic text.
Correct the text of the SYS_CLOCK_TICKS_PER_SEC #error diagnostic to
reflect the actual logic of the gate.

Change-Id: I28ad324b0b246e4a8de29b64483a97577a1b6fb7
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-26 20:51:09 +00:00
Marcus Shawcroft 94e460a92c drivers/isl29035: Make driver_api structure const.
Change-Id: If1d0adeee94663d84049bd8de0de529672ce4dbf
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-26 20:51:01 +00:00
Marcus Shawcroft 3eedeee041 drivers/hts221: Make driver_api structure const.
Change-Id: I81f6d0220ce95cbdb1f3e2b754164a6fd54d0796
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 18:45:47 +00:00
Marcus Shawcroft 2696170f11 sensor/th02: Make driver_api structure const.
Change-Id: I6493e84dabafcd301ad6e55d09fd69e02c513294
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 18:45:47 +00:00
Marcus Shawcroft 1aa7cbdae7 sensor/sht3xd: Make driver_api structure const.
Change-Id: I66c1fbad5e10a47019a6de00f0420c088954d0ff
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 18:45:46 +00:00
Marcus Shawcroft 1dddd19810 sensor/tmp112: Make driver_api structure const.
Change-Id: I32e53df25364572427be87716864118740da8f99
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 18:45:40 +00:00
Marcus Shawcroft 90d4354eef sensor/tmp007: Make driver_api structure const.
Change-Id: I1bdffc48038bc2221ce8f610e857f0be10d90987
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 18:45:39 +00:00
Marcus Shawcroft 593c2621a3 sensor/sx9500: Make driver_api structure const.
Change-Id: I96c17c776f37a63dd309c2cd4208239673033c14
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 18:45:39 +00:00
Marcus Shawcroft b230c98518 sensor/mpu6050: Make driver_api structure const.
Change-Id: I25a3d1ddbaae101043c5aaaeb0777c74df89242c
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 18:45:38 +00:00
Marcus Shawcroft 5a1d4a2fd1 sensor/mcp9808: Make driver_api structure const.
Change-Id: Id27a5a5bb085a78747fea32bf94f9552a5e01f33
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 18:45:38 +00:00
Marcus Shawcroft 74acab89bc sensor/max44009: Make driver_api structure const.
Change-Id: I4e1226f30b420e7b26d8290543877a7b87665ec5
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 18:45:37 +00:00
Marcus Shawcroft 38fac62e49 sensor/lsm9ds0_mfd: Make driver_api structure const.
Change-Id: Ifacfff048c95d7ac7061eadbaee2a15b1c01e9db
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 18:45:37 +00:00
Marcus Shawcroft f58647788a sensor/lsm9ds0_gyro: Make driver_api structure const.
Change-Id: I51947ce5f01b7ff615cca198b82b1aafe7e7d90e
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 18:45:36 +00:00
Marcus Shawcroft 1c57f39633 sensor/lsm6ds0: Make driver_api structure const.
Change-Id: I5e689cc7c33ec471379f7506653a4627f983d4d9
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 18:45:36 +00:00
Marcus Shawcroft 409d6f87a5 sensor/lps25hb: Make driver_api structure const.
Change-Id: I8c11616b7c57ea165a358b446ea595e73a99e90b
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 18:45:36 +00:00
Marcus Shawcroft b908f536d3 sensor/lis3mdl: Make driver_api structure const.
Change-Id: I4e6bb185c3ac1fe8f0bd5d186d5dc1c79274078e
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 18:45:35 +00:00
Marcus Shawcroft 7b92b59c83 sensor/lis3dh: Make driver_api structure const.
Change-Id: Ieaaa1c4cb0268dd18a50e5ced338aa60320d6885
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 18:45:35 +00:00
Marcus Shawcroft bb08e1b524 sensor/hmc5883l: Make driver_api structure const.
Change-Id: I4a78f01126055518251c9f6d864174552604fa8b
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 18:45:34 +00:00
Marcus Shawcroft ccd28b9523 sensor/hdc1008: Make driver_api structure const.
Change-Id: If2c79c29957a49a4fee492d0235060c653d1ef70
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 18:45:34 +00:00
Marcus Shawcroft dbb5380020 sensor/dht: Make driver_api structure const.
Change-Id: I49b4a0cc4342cb51e0bbf6ea925da1ae3f55ff78
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 18:45:33 +00:00
Marcus Shawcroft 0496b95391 sensor/bmi160: Make driver_api structure const.
Change-Id: I195f9ab2d3668d61c8fbdec5a3f3fa390b81948e
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 18:45:33 +00:00
Marcus Shawcroft 1f2b984ece sensor/bmg160: Make driver_api structure const.
Change-Id: Iebf5d8dbe652a6839ba435720029b568ab0d7d87
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 18:45:32 +00:00
Marcus Shawcroft 1836c61d43 sensor/bme280: Make driver_api structure const.
Change-Id: I8fe4e4a9be88eb07f438e4c580d25fe9deedc343
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 18:45:32 +00:00
Marcus Shawcroft 3d8626e95c sensor/bmc150: Make driver_api structure const.
Change-Id: I9c7df241d66e7cc78330d2de3d3a3d1f3be4151f
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 18:45:31 +00:00
Marcus Shawcroft 4be15a986c sensor/bma280: Make driver_api structure const.
Change-Id: Ia7601a99ca888b582227a0acea42ebd4018e5c44
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 18:45:31 +00:00
Marcus Shawcroft beacd063f8 sensor/ak8975: Make driver_api structure const.
Change-Id: I289f9ef59059cd7ed98e6644be2697d2f4d78ced
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 18:45:30 +00:00
Marcus Shawcroft 681a4df787 th02: Limit name space pollution by using 'static'
The name read16() collides with other definitions within Zephyr.  We
don't actually use this function here, so remove the definition.  Fix
various other unnecessary name exports while we are here by adding
'static'.

Change-Id: I7eee8c527a62fea4e6e1bdae8a4874d8ce66596c
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-24 20:10:15 +00:00
Marcus Shawcroft abefffeda6 hdc1008: Limit name space pollution by using 'static'
The read16() name collides with other definitions within zephyr.  Make
it static and fix a few other unnecessary name exports while we are
here.

Change-Id: Id72d44a6b84b8d72c7ba2d0f34b29dbc1d02f2b6
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-24 20:10:15 +00:00
Marcus Shawcroft c7b0aaeb07 sensor/lsm9ds0_mfd: Make driver config_info structure const.
Change-Id: I1c8790feda28ccd29f9c3df1579b596dec7ee663
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-20 16:48:59 +00:00
Marcus Shawcroft 78f07b2b9a sensor/lsm9ds0: Make driver config_info structure const.
Change-Id: I126f0c8f2e8ecfa43740d70464f2829197000ef1
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-20 16:48:59 +00:00
Marcus Shawcroft 515443f154 sensor/lsm6ds0: Make driver config_info structure const.
Change-Id: I2bb46ce28d5a74e152106301f358878cd8edc03b
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-20 16:48:59 +00:00
Marcus Shawcroft 5cafbed740 sensor/lps25hb: Make driver config_info structure const.
Change-Id: I30af3ff45c1b12a6c9392a021d8ef6bfcaa53772
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-20 16:48:58 +00:00
Marcus Shawcroft 3b678f53fe sensor/bmi160: Make driver config_info structure const.
Change-Id: Ia4f5333f9440712224f07a517229f7d3b2dd92f7
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-20 16:48:58 +00:00
Marcus Shawcroft 4577987ba7 sensor/bmg160: Make driver config_info structure const.
Change-Id: If39f09baa757623ea9ed550df0809b863b1cb8a2
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-20 16:48:57 +00:00
Marcus Shawcroft 07fd1b7746 sensor/bmc150: Make driver config_info structure const.
Change-Id: I375b8b08811c21a888d49e2b98c6a7a056520ce4
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-20 16:48:57 +00:00
Bogdan Davidoaia f0bc96ee8c sensor: hdc1008: add missing dependency for I2C address config
The HDC1008_I2C_ADDR config option should be available only if HDC1008
is enabled.

Change-Id: I0d1813512396faefb609527ba5df2a0c4ea159a9
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-10-20 09:44:40 +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 348e61dcdc sensors: tmp112: move tmp112 to own directory under drivers/sensor/
Change-Id: I85023f60ee3c5303a6c065f8ee1b238106b13e49
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-17 14:49:56 -04:00
Anas Nashif 623b43f5dc sensors: tmp007: move tmp007 to own directory under drivers/sensor/
Change-Id: If5fd1277ec93455ee7a1e856357dfab0930a653c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-17 14:41:21 -04:00
Anas Nashif bdfeda0a73 sensors: sx9500: move sx9500 to own directory under drivers/sensor/
Change-Id: Ifc7dfd8a28d33f140415ca178b56d35e51aff178
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-17 14:39:56 -04:00
Anas Nashif b918ae8d82 sensors: sht3xd: move sht3xd to own directory under drivers/sensor/
Change-Id: I8d13f5b2461169940f24a08346f0da0c291a8fef
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-17 18:38:00 +00:00
Anas Nashif cce03b127d sensors: mpu6050: move mpu6050 to own directory under drivers/sensor/
Change-Id: Ia0c4e81f8725da6fc5fead7a86320b613336e702
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-17 18:37:59 +00:00
Anas Nashif 6977cad1e2 sensors: mcp9808: move mcp9808 to own directory under drivers/sensor/
Change-Id: I8327d821b95b5bd8c13d5f24dd5ec46fa53b2d18
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-17 18:37:59 +00:00
Anas Nashif 77bbbb3618 sensors: max44009: move max44009 to own directory under drivers/sensor/
Change-Id: I6b063ebeb53ce6ababd027e15d8d7d94f6174a53
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-17 18:37:59 +00:00
Anas Nashif 109cfe5889 sensors: lsm9ds0_mfd: move lsm9ds0_mfd to own directory under drivers/sensor/
Change-Id: If07b2a73a8acad7f89f650ec304199961a629e28
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-17 18:37:58 +00:00
Anas Nashif 81c564a675 sensors: lsm9ds0_gyro: move lsm9ds0_gyro to own directory under drivers/sensor/
Change-Id: Ia654ab8059d656da6b4414a3fe35c81ec39654d3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-17 18:37:58 +00:00
Anas Nashif 1ae2b855c1 sensors: lsm6ds0: move lsm6ds0 to own directory under drivers/sensor/
Change-Id: Ia2911f584da30fd583318e9730ad1ec147ba6f8b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-17 18:37:57 +00:00
Anas Nashif 8298e9ac27 sensors: lps25hb: move lps25hb to own directory under drivers/sensor/
Change-Id: I5d9c802a8ec9d29557417b687c92b2430aca9fe1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-17 18:37:57 +00:00
Anas Nashif 49f53fa3ac sensors: lis3mdl: move lis3mdl to own directory under drivers/sensor/
Change-Id: Ie3140e7eb6dcfab6008af3ba85dc9119c5dbfb50
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-17 18:37:56 +00:00
Anas Nashif 6f0c55600a sensors: lis3dh: move lis3dh to own directory under drivers/sensor/
Change-Id: Ie263f4400707fec685cd93077e764c5b77f4784d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-17 18:37:56 +00:00
Anas Nashif bdcf651cd1 sensors: isl29035: move isl29035 to own directory under drivers/sensor/
Change-Id: Ia0164f2891b1b2f3d19c63b8311d71e1f9abeeb5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-17 18:37:56 +00:00
Anas Nashif cc43b3017a sensors: hts221: move hts221 to own directory under drivers/sensor/
Change-Id: Id568ee3fae62090ef2711d34fbfd9de214630008
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-17 18:37:55 +00:00
Anas Nashif e71a133dd7 sensors: hp206c: move hp206c to own directory under drivers/sensor/
Change-Id: Ie218228c16584384312200522f43edbd15aadf30
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-17 18:37:55 +00:00
Anas Nashif 4166365c00 sensors: hmc5883l: move hmc5883l to own directory under drivers/sensor/
Change-Id: I5b1126238686b239a5abb73d3ddc966e7d7150d3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-17 18:37:54 +00:00
Anas Nashif 37cf07df27 sensors: hdc1008: move hdc1008 to own directory under drivers/sensor/
Change-Id: If1a7805ab2053b3588318c2a3d5b549a667cb0fb
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-17 18:37:54 +00:00
Anas Nashif 9078ad7982 sensors: dht: move dht to own directory under drivers/sensor/
Change-Id: Id19b4ea414347caa23730e3ccd4f79761878af01
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-17 18:37:53 +00:00
Anas Nashif 49a6d13849 sensors: bmi160: move bmi160 to own directory under drivers/sensor/
Change-Id: I14bfabf77b7aa64acbf25a922a94f92c559b13f7
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-17 18:37:53 +00:00
Anas Nashif 0005f2ff06 sensors: bmg160: move bmg160 to own directory under drivers/sensor/
Change-Id: Ifae44714f08537835c8466fba11b6853f258f148
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-17 18:37:53 +00:00
Anas Nashif c445de3bbb sensors: bme280: move bme280 to own directory under drivers/sensor/
Change-Id: I53f5504773c914b0936091c459b80ab133b9e4ac
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-17 18:37:52 +00:00
Anas Nashif 57b13ec890 sensors: bmc150_magn: move bmc150_magn to own directory under drivers/sensor/
Change-Id: I725438747b3208ebd49f4f7d9ef6277721eaa48f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-17 18:37:52 +00:00
Anas Nashif c31bbc32d8 sensors: bma280: move bma280 to own directory under drivers/sensor/
Change-Id: I1c73d36a51ea88fbda3707c7d6630d54f8fd3545
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-17 18:37:51 +00:00
Anas Nashif db04446964 sensors: ak8975: move ak8975 to own directory under drivers/sensor/
Change-Id: Ib3a8e8a74430d30843db77954737c3ce5dfdce14
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-17 18:37:51 +00:00
Anas Nashif 915eac4625 sensors: add TH02 temperature sensor (Grove)
Support for the Temperature&Humidity Sensor (High-Accuracy &Mini)
v1.0 sensor, see:

http://wiki.seeed.cc/Grove-TemptureAndHumidity_Sensor-High-Accuracy_AndMini-v1.0/

Change-Id: I439eafc863116f21e3b3385175d1935e60a5e9b1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-17 00:24:33 +00:00
Marcus Shawcroft 67d6b592cf sensor/lsm9ds0_gyro: Make config_info pointers const.
Preparation for const driver configuration data.

Change-Id: I8fd83236ecf5357a0a192650a26e91045a6116a7
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-07 20:34:01 +00:00
Marcus Shawcroft cfb5196f07 sensor/lsm9ds0_gyro: Fix failure to compile, undefined CONFIG_LSM9DS0_SENSOR_INIT_PRIORITY
Change-Id: Ibaeaa1a7df692c044310ba116285e1898d806d0e
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-07 20:34:00 +00:00
Marcus Shawcroft dee749b213 sensor/lsm64s0: Make config_info pointers const.
Preparation for const driver configuration data.

Change-Id: If977cc39bab3e838d1ff6d8de2cb4b667974ee17
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-07 20:33:59 +00:00
Marcus Shawcroft db35cc6838 sensor/bmi160: Make config_info pointers const.
Preparation for const driver configuration data.

Change-Id: Ia4639d65ab4ee64a2ee0ba41677bab40894d65b4
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-07 20:33:55 +00:00
Marcus Shawcroft a6f681c782 sensor/bmg160: Make config_info pointers const.
Preparation for const driver configuration data.

Change-Id: I2e9b7e7e8245e60e66554b4d631d71a453cf7ffd
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-07 20:33:54 +00:00
Marcus Shawcroft 1ec5093c04 sensor/bmc150: Make config_info pointers const.
Preparation for const driver configuration data.

Change-Id: Ic4563561cff930533e920031767218023d4746b0
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-07 20:33:53 +00:00
Marcus Shawcroft 58c8199aa6 sensor/lps25hb: Make config_info pointers const.
Preparation for const driver configuration data.

Change-Id: I9f510669710ae8fab897d4047e4d7324c3a84e00
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-07 20:33:52 +00:00
Marcus Shawcroft 6cfe874a0f sensor/lsm9ds0_mfd: Make config_info pointers const.
Preparation for const driver configuration data.

Change-Id: I3b781f09e15d57ae4d00c11d6b7a328b31bc25aa
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-07 20:33:51 +00:00
Anas Nashif 16c5416d70 sensors: use one single sys log config for sensors
Change-Id: I27aadd15ad0ebbaf6373591d52e63fe3f4560378
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-07 16:15:54 +00:00
Anas Nashif e3706c98f3 sensors: cleanup duplicate includes
zephyr.h includes nanokernel.h which includes cpu.h, so make it
simple and just include nanokernel.h. zephyr.h should only be
included in applications.

Change-Id: I11a9ad8608d23af4f2a40a97eb71c09516c3399b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-07 14:07:26 +00:00
Marcus Shawcroft fccfbf2e21 sensor: Fix Kconfig LSM9DS0_MFD I2C slave address type
Change the Kconfig parameter type for the I2C slave address from
string to hex.  The code that consumes this configuration parameter
expects an integer and fails to compile when presented with a string.

Change-Id: I493002ea6f1266344cac863ac305e59e93a5b1fe
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-07 10:34:36 +01:00
Anas Nashif f320338066 sensors: do not use choice for I2C address
Set the value for the I2C address directly and use only
one per sensor.

Change-Id: I24d06a964e8e372eddf262b70fe5d9854a04563c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-06 04:17:52 +00:00
Anas Nashif efd6b94929 sensors: HDC1000: check for manufacturer and device IDs
Make sure we are connected to the right device.

Change-Id: I09e696563191392d23a316ad065bb7e320df76bb
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-06 04:17:44 +00:00
Anas Nashif 6a534710c0 sensors: use one init priority config for all sensors
Sensors are end-devices and usually nothing depends on them,
so set a global priority for all sensors and use it instead of
individual values per sensor.

Change-Id: I5847411e783ef8a8517f0ab1d8234810513707b4
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-05 23:01:23 +00:00
Javier B Perez 453d172bff sensor: HP206C: fix kconfig sys log help
Changed help message to be in compliance with the rest of sensors.

Change-Id: Ia18f7623eda5f86fe6f7d99ac934f1a9beda55a8
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
2016-09-12 10:35:41 -05:00
Laurentiu Palcu 3ef2e059c3 sensor: add driver for HP206C sensor
This sensor is a high precision barometer, altimeter and temperature
sensor. It can also be found on the Grove Barometer module (v1.0).

Sensor datasheet:
http://www.hoperf.com/upload/sensor/HP206C_DataSheet_EN_V2.0.pdf

Grove link:
http://www.seeedstudio.com/depot/Grove-Barometer-HighAccuracy-p-1865.html

Origin: Original
Change-Id: I99986b26b6b4447e31e12a1fc17ede3e6bb4c586
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-09-12 12:18:55 +00:00
Bogdan Davidoaia 966118ee18 sensor: hmc5883l: fix data sample axis order
The data sample registers are ordered as X, Z, Y (not X, Y, Z), so the
driver also needs to extract the sample components in this order.

Jira: ZEP-679

Change-Id: I317994bb545539b049e2ebf3d2af94e63c7d2511
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-08-11 17:29:50 +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
Javier B Perez dfc15d3a48 driver: sensor: lsm6ds: remove dead code by kconfig options
Removed dead code inside sensor_lsm6ds0.h. There is no kconfig option
CONFIG_LSM6DS0_I2C_ADDR_6A neither 6B.
Also the #define LSM6DS0_I2C_ADDR is not in use.

Change-Id: Ib5a7f40d0d61542ed81687227df3795ba52ec725
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
2016-08-02 06:47:39 +00:00
Javier B Perez 33f048073f sensor: isl29035: fix undefined CONFIG LUX RANGE 4k in elif
Fixed undefined CONFIG_ISL29035_LUX_RANGE_4 in #elif

Change-Id: I2a7a6e46ffa0236da126d4e2c321e59302e54527
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
2016-07-28 15:40:13 +00:00
Kumar Gala 902ddbe9c7 sensor: max44009: Fix Kconfig dev name typo
Code was using CONFIG_MAX44009_I2C_MASTER_DEV_NAME which doesn't exist.
Use CONFIG_MAX44009_I2C_DEV_NAME instead.

Change-Id: I6bf6eedd2229bb91f64264dc5b32e4a3c00921b6
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-07-28 07:21:49 -05:00
Andrew Boie 0529c931a0 sensors: fix incorrect use of __ASSERT
__ASSERT was being used when __ASSERT_NO_MSG was appropriate.
This problem was previously only visible if CONFIG_ASSERT=y,
but a recent change to the assert macros fixed them so they
can't be improperly used with assertions disabled either.

Change-Id: I1e13c796873d79826d177a01246d2ca0e8f0a107
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-27 16:56:08 -07:00
Murtaza Alexandru 0c83039a67 sensor: add driver for LPS25HB
Add driver for LPS25HB pressure and temperature sensor.

Datasheet:
http://www.st.com/content/ccc/resource/technical/document/datasheet/9a/4c/aa/72/1f/45/4e/24/DM00141379.pdf/files/DM00141379.pdf/jcr:content/translations/en.DM00141379.pdf

Change-Id: I6b616e879777b52f16f4e867c330e8beacf59fd3
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-07-21 16:22:03 +00:00
Andrew Boie df72692fb6 sensor_bmi160: fix incorrect use of __ASSERT()
Change-Id: Ieb1d8b1aed3e9906d1377e1e4117b69eb8cae751
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-20 22:00:44 +00:00
Baohong Liu a3488d13e0 sensor: add driver for MAX44009 light sensor
Add device driver for MAX44009 light sensor

Datasheet:
https://datasheets.maximintegrated.com/en/ds/MAX44009.pdf

Jira: ZEP-357

Origin: Original
Change-Id: I6b5c8e0afc36c22de0a6432d01cd5b7eb2e12f1b
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-07-12 19:31:09 +00:00
Mariusz Ryndzionek 57afc5f851 sensor: tmp112: use arithmetic_shift_right helper function
Use the function provided in misc/util.h to do the sample
conversion.

Change-Id: I21179982b6001bf79448e4eb289e9cffaf97f3fb
Signed-off-by: Mariusz Ryndzionek <mariusz.ryndzionek@firmwave.com>
2016-07-06 22:04:25 +00:00
Bogdan Davidoaia e8d0090808 sensor: tmp007: fix negative sample values bug
Fix bug that caused negative temperature values to be computed incorrectly.
The sign bit needs to be perserved, when extracting the data sample from
the TMP007_REG_TOBJ register.

Jira: ZEP-499
Change-Id: Idbebd48b3164d7d4883352ef7128ef73be70e1b2
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-06-30 17:50:05 +00:00
Mariusz Ryndzionek 65cc01ac16 sensor: adjust Kconfig file formatting
Add hyphens so that the .rst file is formatted properly

Change-Id: Ic798590d4a892f4f4d5312e86949db23a3b3abe0
Signed-off-by: Mariusz Ryndzionek <mariusz.ryndzionek@firmwave.com>
2016-06-30 17:49:50 +00:00
Mariusz Ryndzionek c8a589e06e sensor: add driver for TMP112 temperature sensor
Add device driver for the TMP112 I2C temperature sensor

Datasheet:
	http://www.ti.com/lit/ds/slos887d/slos887d.pdf

Change-Id: I08208204cd8f377dc65378aaf2b92c7cdefe8d2b
Origin: Original
Signed-off-by: Mariusz Ryndzionek <mariusz.ryndzionek@firmwave.com>
2016-06-29 05:09:11 +00:00
Bogdan Davidoaia 4f80a44b1b sensor: add driver for HMC5883L magnetometer
Add driver for the I2C-based Honeywell HMC5883L magnetometer.

Datasheet:
	https://cdn-shop.adafruit.com/datasheets/HMC5883L_3-Axis_Digital_Compass_IC.pdf

Change-Id: I9ad56a7533d8d67402aa2ae2862ba339b04d3525
Origin: Original
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-06-29 04:58:44 +00:00
Kumar Gala 556b66f468 More cleanup whitespace in Kconfig files
Some additional whitespace converted to TABs

Change-Id: I945383f70960ad97e9cbc11ea96b099bcc558404
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-06-01 22:39:54 +00:00
Bogdan Davidoaia 4b00a69989 sensor: hts221: fix sensor type in Kconfig
The driver for the HTS221 sensor was added with the wrong type stated in
the Kconfig file, as it is a temperature and humidity sensor and not a
magnetometer.

Change-Id: Icc50c9b7ccc491b1c22e13d00607123a45338b11
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-06-01 14:25:27 +00:00
Murtaza Alexandru b3a485147f sensor: add driver for LSM6DS0
Add driver for LSM6DS0 accelerometer, gyroscope and temperature sensor.

Change-Id: Ic04fa8d0bbf935e7f04ed7981554d8095ceb5ccf
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
2016-06-01 11:48:50 +00:00
Bogdan Davidoaia caa506102e sensor: ak8975: add support for MPU9150
The AK8975 chip can be packaged together with a MPU6050 chip, resulting
in a MPU9150 chip. In this format, the MPU6050 part of the MPU9150 chip
needs to be turned on and pass-through mode enable in order to communicate
with the AK8975 chip.

Datasheet:
	http://43zrtwysvxb2gf29r5o0athu.wpengine.netdna-cdn.com/wp-content/uploads/2015/02/MPU-9150-Datasheet.pdf

Register Map:
	http://43zrtwysvxb2gf29r5o0athu.wpengine.netdna-cdn.com/wp-content/uploads/2015/02/MPU-9150-Register-Map.pdf

Change-Id: I120dff11c187689e2e6968c812aae2e3e3578bc6
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-06-01 14:02:20 +03:00
Bogdan Davidoaia c4c01a92f3 sensor: add driver for AK8975 magnetometer
Add driver for the AK8975 3-axis electonic compass.

Datasheet:
	http://www.akm.com/akm/en/file/datasheet/AK8975.pdf

Change-Id: I427f954396c8991a153e4447d746b855d19cb60d
Origin: Original
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-06-01 14:02:20 +03:00
Bogdan Davidoaia 01062d97aa sensor: add driver for MPU6050 sensor
Add driver to MPU6050 six-axis motion tracking device. The driver has support
for accelerometer, gyroscope and temperature channels.

Datasheet:
	http://43zrtwysvxb2gf29r5o0athu.wpengine.netdna-cdn.com/wp-content/uploads/2015/02/MPU-6000-Datasheet1.pdf

Register Map:
	http://43zrtwysvxb2gf29r5o0athu.wpengine.netdna-cdn.com/wp-content/uploads/2015/02/MPU-6000-Register-Map1.pdf

Change-Id: Id3930fc666195051093fee80c15cf2deb0eaedff
Origin: Original
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-06-01 14:02:13 +03:00
Bogdan Davidoaia 34f63de901 sensor: add driver for HTS221 sensor
Add driver for HTS221 temeprature and relative humidity sensor.

Datasheet:
	http://www.st.com/resource/en/datasheet/hts221.pdf

Interpreting humidity and temperature readings document:
	http://www.st.com/resource/en/technical_note/dm00208001.pdf

Change-Id: I1fee9d8372ad71b22bc85a60939c82f81569e135
Origin: Original
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-05-29 22:25:19 +00:00
Bogdan Davidoaia a2605e50d7 sensor: add driver for LIS3MDL magnetometer
Add driver for the LIS3MDL ultra-low-power high-performance three-axis
magnetic sensor.

Datasheet:
	http://www.st.com/resource/en/datasheet/lis3mdl.pdf

Application note:
	http://www.st.com/resource/en/application_note/dm00136626.pdf

Change-Id: Id2d65e7525bef6c4fe50f86169a80f84197f8983
Origin: Original
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-05-29 22:25:03 +00:00
Kumar Gala 9ec2f3be80 Cleanup whitespace in Kconfig files
Convert leading whitespace into tabs in Kconfig files.  Also replaced
double spaces between config and <prompt>.

Change-Id: I341c718ecf4143529b477c239bbde88e18f37062
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-05-25 13:28:07 -05:00
Murtaza Alexandru c4425fd816 sensor: fix typo resulting in compile error
Fix a compile error when trying to set I2C address of LSM9DS0 Gyro to
VCC (0x6B) caused by a typo.

Change-Id: I27850ecd70e715a10b96572aedea0d237dd55cd5
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
2016-05-24 11:36:33 +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
Murtaza Alexandru 261a448f33 sensor: remove unnecessary return variables
Remove unnecessary return variables (ret/rc) to reduce memory footprint.

Change-Id: Ifc22fd993b4f8f2d0cf992f620f53cc510add1fa
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
2016-05-17 20:07:29 +00:00
Murtaza Alexandru 2d7ae8b249 sensor: migrate all drivers to new error code standard
Check if return value is negative when checking for errors, instead of
checking if it's 0.

Change-Id: I0b0af28c02b3760f3128e8cbe48908dabc89af88
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
2016-05-17 20:07:24 +00:00
Murtaza Alexandru df20e3e4a7 sensor: add support for *_ANY get channel
Update all drivers that have vectorial data to return all 3 channels (X,
Y and Z) if the chan parameter is _ANY.
Also fix a compile bug in LSM9DS0 MFD driver.

Change-Id: I5bf261846bcd68c288b96997ff164726f75c151c
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
2016-05-17 20:07:05 +00:00
Bogdan Davidoaia c9caf1806a sensors: add driver for DHTxx sensors
Add driver for the DHT temperature and relative himidity sensor family.
The sensor has a single signal pin (in addition to GND and VDD) over
which communication is done in a half-duplex manner (see datasheet for
more details).

Datasheets:
	http://www.micropik.com/PDF/dht11.pdf
	https://www.sparkfun.com/datasheets/Sensors/Temperature/DHT22.pdf
	http://akizukidenshi.com/download/ds/aosong/AM2302.pdf

Origin: Original
Change-Id: If8c8be73d7fdfef2ab2091bf9b8fe72bcd700ed1
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-05-14 00:31:43 +00:00
Vlad Dogaru 3a66946b0f sensor: Rework core to use workqueue API
Remove the homegrown sensor delayed work API in favor of using the
system-wide workqueue.  Drivers still have the option of using their own
fiber.

In a second step, drivers can be refactored to start and use their own
workqueue.

Change-Id: I70dea6fc2abcbc9e04ac1ed3c837483a3d3c4424
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
2016-05-12 15:27:40 +00:00
Vlad Dogaru 77850daf11 sensor: sx9500: fix compile error
Looks like this snuck in with the GPIO API migration.

Change-Id: Ib58142e134a779431bacf9ca75a66541bf63d5b0
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
2016-05-05 19:06:16 +00:00
Vlad Dogaru 149decdcf5 sensor: bmg160: fix compile error when not using trigger
Change-Id: If681ace87439daf6e6aa0ad70ac79a19827a2e73
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
2016-05-05 12:00:20 +00:00
Laurentiu Palcu 6f11e868b0 sensor: add support for BMG160 gyroscope
Datasheet:
http://ae-bst.resource.bosch.com/media/_tech/media/datasheets/BST-BMG160-DS000-09.pdf

Origin: Original
Change-Id: I27469da8ff04c2eb26e92cc5d747b1bb8fee627b
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-05-04 13:13:59 +00:00
Murtaza Alexandru f169a66205 sensor: migrate all drivers to new SYS_LOG
Refactor all sensor drivers so that they use SYS_LOG instead of
decentralized systems/functions.

Change-Id: Ibd9443e06004341bc5e9afaf5b49bbec547e073d
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
2016-04-26 18:11:05 +00:00
Murtaza Alexandru 52ccdada9c sensor: split lsm9ds0_gyro driver
Split driver for LSM9DS0 gyroscope in core functionalities and trigger.

Change-Id: I19736b65f45a6c4fc79a1f16423097b89accff24
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
2016-04-26 18:10:56 +00:00
Murtaza Alexandru 28cf0c210a sensor: split bmc150_magn driver
Split BMC150 magnetometer driver in core functionalities and trigger.

Change-Id: I955ac39c2e995a81fa830776da9c0bcc38d9490a
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
2016-04-26 18:10:41 +00:00
Murtaza Alexandru 075d081811 sensor: add driver for LSM9DS0 accel and magn
Add device driver for the multi function device (MFD) part of LSM9DS0:
accelerometer, magnetometer and temperature.

Datasheet:
  https://www.adafruit.com/datasheets/LSM9DS0.pdf

Change-Id: I00b9db2c69c6e5229269afacb02bf5f921edabe9
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
2016-04-26 18:10:41 +00:00
Murtaza Alexandru 676b89cd1a sensor: make runtime configurable attrs continuous
Runtime configurable attributes are now matched with the smallest
available value that is greater or equal to the parameter instead of
returning -EINVAL.

Change-Id: I9ca8e2eba443fcd247c329c6ce71dc2167fb7f03
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
2016-04-26 18:10:40 +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
Murtaza Alexandru 1be6d1f6c8 sensor: add the posibility to fetch one data type
Now you can specify the sensor type you want to fetch using
sensor_sample_fetch_chan. This will inform the driver that you want only
one type of data updated, leaving the others unchanged and enabling
different sampling rates for multi function devices (MFDs).

Change-Id: I403e422dffadc697c19a5372ed55ed8f486a2607
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
2016-04-26 18:09:41 +00:00
Murtaza Alexandru 82cca9c56e sensor: fix bmc150_magn compile error
Fix bmc150_magn compile error introduced in I2C register access API
migration patch.

Change-Id: I48f4d6405b4b7ae25beb0fbd46169eac3689ec8e
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
2016-04-26 18:08:38 +00:00
Murtaza Alexandru db06b853d3 sensor: fix init driver_api
Assign driver_api only if *_init is successful.

Change-Id: Ib95cd358af358aec4fc58ff10dcede05fad00d0a
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
2016-04-26 18:08:38 +00:00
Murtaza Alexandru 6542e03a33 sensor: refactor bmc150 and lsm9ds0
* Fix coding style so line length does not exceed 80 chars.
* Remove unnecessary casts
* Remove unnecessary variable prefixes (from *_fiber_stack to
fiber_stack)
* Rewrite lsm9ds0_gyro_channel_get into more readable form

Change-Id: I086562644f707d9d6538cb34d000012464b02fe3
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
2016-04-26 18:08:38 +00:00
Bogdan Davidoaia fb1ea43be2 sensors: use I2C register access API
Use I2C register access API in drivers of sensors that have
8-bit registers.

Change-Id: I33e016feff09be396eae70fb312de055c49caca7
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-04-26 11:06:50 +00:00
Laurentiu Palcu e7a8c7609a sensor: bmi160: fix regression
The regression was introduced by the following commit:

sensor: bmi160: Use the new GPIO callback API

The problem was that ipm context was not set when registering the
callback.

Change-Id: Icbe8fb9670b9e7e7d489e70adf93ff62fed98935
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-26 10:57:56 +00:00
Anas Nashif 9d8c332b21 i2c: use I2C_X nameing instead of I2CX
Other IOs use this format, so lets be consistent and use

I2C_0 instead of I2C0 and I2C_1 an instead of I2C1.

Change-Id: I591ab08e14bd533ef0fac38e596559da783863b8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-25 17:01:48 +00:00
Tomasz Bursztyka 559b768340 sensor: bmi160: Use the new GPIO callback API
gpio_set_callback() is meant to be deprecated and thus modifying the
driver to use the new GPIO callback API.

Taking the opportunity to use ipm API properly in order to remove the
struct bmi160_data singleton.

Change-Id: Iafcf3fed10bd286962829a4157effd054dd78c1e
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-04-25 14:58:16 +00:00
Tomasz Bursztyka 62fcd4ca82 sensors: Using new GPIO API callbacks
Adapting GPIO based sensors to use the new callback format.

Change-Id: Ibdc68bf80a2ee42dcaf25c7a6e4431f9b64dc20a
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-04-22 22:17:25 -04:00
Laurentiu Palcu e5dc7ac363 sensor: bmi160: switch to the new logging API
Change-Id: Id370e06e95528c223e09bb4110eeec3dcc2d4aef
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-21 14:16:15 +00:00
Laurentiu Palcu 8943f6c5ce sensor: bmi160: add support for triggers
Add support for anymotion and data ready triggers. Also, the user can
choose at configuration time the source of the triggers. For quark, in
particular, since the current driver for ARC does not allow receiving
interrupts from AON GPIO controller, IPM is used: a helper app on x86,
registers a gpio callback and will 'relay' the interrupt, through IPM,
to arc core.

Origin: Original
Change-Id: I170d723425c6280f9aa8c240b66275647723edd9
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-21 14:16:14 +00:00
Laurentiu Palcu f71df44204 sensor: bmi160: make some read/write functions global
These will be needed by the trigger implementation.

Change-Id: Ib408ae540571447059301046a3486cedffa735d5
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-21 14:16:14 +00:00
Laurentiu Palcu 5609ec95ee sensor: bmi160: fix bmi160_reg_field_update function
A mask was not applied on the shifted value, hence allowing one to pass
a val that would change other fields in the register.

Change-Id: I3c7bdb24c7b3a0ce94f664dbba303db35660ce7b
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-21 14:16:14 +00:00
Laurentiu Palcu 77e28d2263 sensor: bmi160: create two wrappers for bmi160_reg_val_to_range
These will be used in the trigger implementation, which is a different
file, and will allow for the arrays to be static.

Change-Id: Ia34ebe9bde7d09abe8e93f3ace9e282cee1169db
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-21 14:16:13 +00:00
Laurentiu Palcu 6330388bf5 sensor: bmi160: move the printing macro to the header
The macro will be used in the upcoming trigger file.

Change-Id: I57a570fde37f31771b3d8bb9c028520fdc41da8f
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-21 14:16:13 +00:00
Bogdan Davidoaia b628aa8a87 sensors: bma280: add support for BMC150 accelerometer
Add support for BMC150 accelerometer which differs from BMA280 only in
id, I2C address and acceleration data width.

Change-Id: Iccf47ecc5de9fdb1b9e45f1561c5dbb54f720806
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-04-19 18:40:43 +00:00
Bogdan Davidoaia 0eec9492fc sensors: bma280: fix accel data sample calculation
The values from the accel data sample msb and lsb registers need to
be concatenated (using bitwise or) and not added, since together they
represent a single 14-bit value.

Change-Id: I476f05512beb3d6b81bacefd4c52e4b2a541708b
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-04-19 18:40:43 +00:00
Bogdan Davidoaia 62fca8fcc1 sensors: bma280: compute accel scales based on data width
Compute acceleration data and threshold scales based on data width and
acceleration measurement range instead of defining LSB values for each
measurement range.

Change-Id: I2a15877cef00d49d7a64fd6f6003722bb9f80b92
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-04-19 18:40:42 +00:00
Bogdan Davidoaia b53b27701a sensors: add driver for TMP007 infrared thermopile sensor
Add driver for the TMP007 intrared thermopile sensor which measures
the temperature of an object without direct contact.

Datasheet:
	http://www.ti.com/lit/ds/symlink/tmp007.pdf

Origin: Original
Change-Id: I29857b2e424a2144370d75e2ee40c4ff8b619afd
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-04-16 05:32:35 +00:00
Bogdan Davidoaia 176c2525a6 sensors: bma280: fix slope threshold measurement unit
Slope threshold attribute values should be received in m/s^2 instead
of Gs, since accel channels return data in m/s^2.

Change-Id: I0669345ff8af8559e47895bca8225e15d2576a06
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-04-13 17:27:08 +00:00
Bogdan Davidoaia 69793bb320 sensors: use SENSOR_G constant in all accelerometer drivers
Use the SENSOR_G constant from sensor.h in all accelerometer
drivers, instead of having the constant redefined in each
driver header file.

Since GRAVITY_CONST was measured in mili-m/s^2 and SENSOR_G
is measured in micro-m/s^2, some changes to the calculation
of the acceleration data were added.

Change-Id: Ia323dfc46bee00035e24b37e1b7fbc886dfbe029
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-04-13 17:27:08 +00:00
Murtaza Alexandru fbd45861f3 sensor: lsm9ds0-gyro: fix FULL_SCALE attribute
SENSOR_ATTR_FULL_SCALE attribute now expects the value as radians per
second.

Change-Id: I8082a1f112f1ed8efb511de39e3a8e5ae3d3ed0c
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
2016-04-07 17:00:09 +00:00
Bogdan Davidoaia 3bdf498716 sensors: fix coding style regarding max line length
Fix coding style so line length does not exceed 80 chars.

Change-Id: Iddebdf55593736cfa288a03a750cc927665f9065
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-04-07 01:03:40 +00:00
Laurentiu Palcu 5d2a200381 sensor: add driver for BMI160
This patch adds support for the Curie's BMI160 IMU chip. Only polling is
supported in this version.

Datasheet:
http://ae-bst.resource.bosch.com/media/_tech/media/datasheets/BST-BMI160-DS000-07.pdf

Origin: Original
Change-Id: I759856d4bf123c21e9e4928f32bdf8f00aeeed24
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-02 23:08:48 +00:00
Vlad Dogaru 320651281c sensor: bmp280: fix pressure value
The comments in the sensor header specify that pressure should be
expressed in kPa, but the bmp280 driver returns a value in Pa.

Change-Id: I6d5346db250d1a01a1e5e31fb1d8685ab5dc405b
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
2016-04-01 14:48:00 +03: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
Bogdan Davidoaia a302451cc4 sensor: add driver for LIS3DH accelerometer
Add device driver for the LIS3DH I2C-based triaxial accelerometer
sensor, which supports reading data from the accel-x, accel-y and
accel-z channels.

Datasheet:
	http://www.st.com/web/en/resource/technical/document/datasheet/CD00274221.pdf

Application note:
	http://www.st.com/web/en/resource/technical/document/application_note/CD00290365.pdf

Change-Id: Ib51bd6346798249d850376e50d1c938eda8a3d28
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-03-27 00:34:30 +00:00
Murtaza Alexandru b1ea13413e sensor: add driver for LSM9DS0 gyroscope
Add device driver for the gyroscope part of LSM9DS0 gyroscope.

Datasheet:
  https://www.adafruit.com/datasheets/LSM9DS0.pdf

Change-Id: I25e0c8470c9b68c594bc4a0d2a9a13f8f41ee309
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
2016-03-24 08:03:31 +00:00
Anas Nashif 2f20933cad sensors: Convert return codes to errno.h
Change-Id: Ifdcc26c903e70c4f72ac94e0511cc3f01fa6dc6e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-03-21 09:16:40 +00:00
Murtaza Alexandru 3b6d4cb9cf sensor: add driver for BMC150 magnetometer
Add device driver for the magnetometer part of BMC150 sensor.

Datasheet:
  https://ae-bst.resource.bosch.com/media/products/dokumente/bmc150/BST-BMC150-DS000-04.pdf

Change-Id: Id7cbfd872a0a37e20afb03a8155c1f6851710a16
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
2016-03-19 06:39:42 -04:00
Bogdan Davidoaia ef65f155c2 sensor: add driver for HDC1008 temperature and humidity sensor
Add driver for the HDC1008 temperature and relative humidity
sensor.

Datasheet:
	http://www.ti.com/lit/ds/symlink/hdc1008.pdf

Origin: Original
Change-Id: I63cb4cdd94120b80d0d6f3205da073f0817c4f17
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-03-19 06:39:42 -04:00
Bogdan Davidoaia 653874c73f sensor: add driver for SHT3xD sensors
Add device driver for the SHT3xD temperature and humidity sensors.

Datasheets:
	https://www.sensirion.com/fileadmin/user_upload/customers/sensirion/Dokumente/Humidity_Sensors/Sensirion_Humidity_Sensors_SHT3x_Datasheet_digital.pdf
	https://www.sensirion.com/fileadmin/user_upload/customers/sensirion/Dokumente/Humidity_Sensors/Sensirion_Humidity_Sensors_SHT3x_Application_Note_Alert_Mode_DIS_V1.pdf

Origin: Original
Change-Id: I9cda2f1bc7172e93ce34fde63c6febf0b8b28289
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-03-19 06:39:42 -04:00
Bogdan Davidoaia babb62a0ed sensor: add isl29035 light sensor
Add device driver for the isl29035 ambient light and infrared
light sensor.

Datasheet:
    http://www.intersil.com/content/dam/Intersil/documents/isl2/isl29035.pdf

Origin: Original
Change-Id: Ib285f8def32d78d50f1d92998dca5f55d6603ca5
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-03-19 10:38:39 +00:00
Bogdan Davidoaia fe9c947fee sensor: add driver for BMA280 accelerometer
Add device driver for the BMA280 I2C-based triaxial accelerometer
sensor, which supports reading data from the accel-x, accel-y, accel-z
and temperature channels. The driver also has support for data-ready
and any-motion triggers.

Datasheet:
	http://ae-bst.resource.bosch.com/media/_tech/media/datasheets/BST-BMA280-DS000-11_published.pdf

Origin: Original
Change-Id: Iff7246d7dd4a9358ec7a71e8ffbcfcccd49e393c
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
Signed-off-by: Teodora Baluta <teodora.baluta@intel.com>
2016-03-19 00:13:18 +00:00
Bogdan Davidoaia aad3e2a21e sensor: move driver specific options to separate Kconfig files
Move driver specific config options to separate Kconfig sub-files
as this is a more scalable approach when considering that multiple
sensor drivers will be added in the future.

Change-Id: Ia1d62afd628723be33868d6c1a956ca7b27eba88
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-03-17 15:59:17 +00:00
Andre Guedes b3cb3a1f68 drivers: Replace DEV_INVALID_CONF by -EINVAL
This patch replaces all occurences of the macro DEV_INVALID_CONF by
-EINVAL at the driver level. So this patch touch the files under
drivers/, include/ and samples/drivers/ when applicable.

This patch is part of the effort to transition from DEV_* codes to
errno.h codes.

Change-Id: Idae0d5af8dd780416977c9261a5fb6188c3aab64
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-16 19:30:04 -04:00
Andre Guedes 245e140da6 drivers: Replace DEV_INVALID_OP by -ENOTSUP
This patch replaces all occurences of the macro DEV_INVALID_OP by
-ENOTSUP at the driver level. So this patch touch the files under
drivers/, include/ and samples/drivers/ when applicable.

This patch is part of the effort to transition from DEV_* codes to
errno.h codes.

Change-Id: I46aec3c65963018c479b01602e4a3eec8650eaff
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-16 19:30:04 -04:00
Andre Guedes 024cfe754e drivers: Replace DEV_OK by 0
This patch replaces all occurences of the macro DEV_OK by the actual
value 0 at the driver level. So this patch touch the files under
drivers/, include/ and samples/drivers/.

This patch is part of the effort to transition from DEV_* codes to
errno.h codes.

Change-Id: I69980ecb9755f2fb026de5668ae9c21a4ae62d1e
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-16 19:30:04 -04:00
Vlad Dogaru 447489dc84 sensor: Add sx9500 SAR proximity driver
Support for data-ready and near/far triggers is included.  Datasheet the
sensor available at <http://www.semtech.com/images/datasheet/sx9500_ag.pdf>.

Origin: Original
Change-Id: Idd491a8bad7e119b0ed66e655955228ffdac6e76
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 68be7b7d26 sensor: Add driver for MCP9808 temperature sensor
The driver only supports simple temperature readings.  It does not
support the alarm feature.  Datasheet available at
<http://ww1.microchip.com/downloads/en/DeviceDoc/25095A.pdf>.

Origin: Original
Change-Id: I283e6697fc6947975323d280f5ff0ba625fac5a9
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
2016-03-15 18:04:19 -04:00
Vlad Dogaru 48bdd70a07 Add infrastructure for sensor drivers
Origin: Original
Change-Id: I846b1601f1bdf15ad068b27baefc4b23ffab81e3
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
2016-03-15 19:00:08 +00:00