Commit graph

70 commits

Author SHA1 Message Date
Kumar Gala e60af3be66 drivers/sensor: Convert formatter strings to use PRI defines
To allow for various libc implementations (like newlib) in which the way
various {u}int{8,16,32}_t types are defined vary between both libc
implementations and across architectures we need to utilize the PRI
defines.

Change-Id: I69e60e3823028389b314adaf6e279fd47fde1182
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-17 11:09:36 -05:00
Maureen Helm de64c8394c fxos8700: Fix Kconfig help indentation
Fixes the fxos8700 Kconfig help indentation to be <tab><space><space>.

Change-Id: If6e9395b5d28044962ca568be5515658e7dc2627
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-03-30 21:21:22 +00:00
Maureen Helm 4905e400ed fxos8700: Add support for temperature
The fxos8700 is primarily an accelerometer/magnetometer, but it does
also include a temperature sensor. Note that the temperature sensor is
uncalibrated and can only be used when the magnetometer is enabled
(magnetometer-only mode or hybrid mode).

Change-Id: I74c4ae68c30e0f9836caa70baed44ad8956b17ea
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-03-23 09:41:48 -05:00
Maureen Helm 1a344ed8fc fxos8700: Use SYS_LOG_ERR instead of SYS_LOG_DBG for errors
Converts fxos8700 error messages from SYS_LOG_DBG to SYS_LOG_ERR.

Change-Id: Ic2b3245fd46372d585df81deeafb56e31cdf542a
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-03-23 09:34:08 -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 8575a36dbe fxos8700: Fix broken gpio callback implementation
Fixes fxos8700_gpio_callback() to pass a pin number to
gpio_pin_disable_callback() rather than a pin mask.

Jira: ZEP-1507

Change-Id: I15bfbf4d3377f22942aa549377472d2b1142c32b
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-26 11:57:22 +00:00
Bogdan Davidoaia 9f7a643310 sensor: fxos8700: expand trigger requirement to include pulse config
The pulse config option requires triggers enabled, so expand the
trigger requirement to also include all the pulse configs.

Change-Id: Ib94f4071cac757b24bfe940ca64fd11b07fed1c1
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
2017-01-24 13:45:16 +00:00
Bogdan Davidoaia 4fadbbeebd sensor: fxos8700: fix missing dependency in Kconfig
FXOS8700_THREAD_PRIORITY and FXOS8700_THREAD_STACK_SIZE need to also
depend on FXOS8700_TRIGGER, else they will not show in the fxos8700
menu entry when running "make menuconfig".

Change-Id: I8f59125157f046592f3c92dcf2a92bd0e407cd6a
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
2017-01-20 14:40:40 +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 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
Maureen Helm 31862e3a63 fxos8700: Add support for tap and double tap triggers
Adds optional support for tap and double tap sensor triggers to the
fxos8700 driver using the pulse detection hardware function.

Default configuration values were taken from NXP AN4072, section 6.3.
http://cache.nxp.com/assets/documents/data/en/application-notes/AN4072.pdf

Change-Id: Ia95091628a853eb956f6fd1df099a9e6e101b707
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2016-12-21 08:06:56 -06:00
Flavio Santes 5799495a5b drivers/sensor: Add the ARG_UNUSED macro
Add the ARG_UNUSED macro to avoid compiler warnings.

Change-Id: I2e0d8ccdcd2d525e109cee6c3bd1035640618eb0
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-21 12:54:51 +00:00
Anas Nashif a9e879e273 logging: move sys_log to subsys/logging
Move logging out of misc/ to its own subsystem. Anything related to
logging and any new logging features or backends could be added here
instead of the generic location in misc/ which is overcrowded with
options that are not related to eachother.

Jira: ZEP-1467
Change-Id: If6a3ea625c3a3562a7a61a0ba5fd7e6ca75518ba
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-19 19:58:39 +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
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
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
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
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
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