Commit graph

10 commits

Author SHA1 Message Date
Henrik Brix Andersen 696fc3afbf drivers: sensor: add api function for getting a sensor attribute
Add an API function for getting the value of a sensor attribute.

Fixes #26167.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-06-17 17:13:14 +02:00
Kumar Gala a1b77fd589 zephyr: replace zephyr integer types with C99 types
git grep -l 'u\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/u\(8\|16\|32\|64\)_t/uint\1_t/g"
	git grep -l 's\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/s\(8\|16\|32\|64\)_t/int\1_t/g"

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Parthiban Nallathambi e65b14c2b6 sensor: bq274xx: Add BQ27421 driver
Add support for TI BQ27421 fuel gauge sensor

Signed-off-by: Parthiban Nallathambi <parthiban@linumiz.com>
Signed-off-by: NavinSankar Velliangiri <navin@linumiz.com>
2020-04-13 11:50:41 -05:00
Francisco Munoz f400589c32 include: drivers: sensor: Add sensor channel for TACH
Introduce an appropiate channel for reading back RPMs in tachometers

Signed-off-by: Francisco Munoz <francisco.munoz.ruiz@intel.com>
2020-03-13 08:49:21 -05:00
Corey Wharton 86bfc489f4 scripts: Replace hard-coded subsystem list with __subsystem annotations.
This change removes the hardcoded subsystem list in gen_kobject_list.py
favor of marking the relevant driver API structs with the _subsystem
sentinel.

Signed-off-by: Corey Wharton <coreyw7@fb.com>
2020-03-11 17:13:39 +02:00
Daniel Bujak 92a31f1a40 drivers: sensor: Add support for free-fall triggering to sensor api
Add an entry in the sensor_trigger_type enum for triggering an
event on free-fall

Signed-off-by: Daniel Bujak <danb@swiftlabs.com>
2020-03-10 18:31:38 +02:00
Brooks Prumo 32e3756d66 include: Fixes #1205, C++ usage of sensor.h
I ran into issue #1205 earlier today and realized the fix was to simply
provide the proper casts.  The issue is that C++ is less permissive than
C here, erroring when trying to implicitly convert from `void *` to
`struct gpio_driver_api *`.  The same cast is done in
include/drivers/gpio.h, which is why I did that here as well.

This fix was validated by compiling my C++ application successfully and
also successfully running my app on my board, interacting with sensors.

Signed-off-by: Brooks Prumo <brooks@prumo.org>
2019-12-12 11:06:34 -06:00
Peter Bigot 6554a5e5b6 include: rearrange for standard use of extern "C" in various headers
Consistently place C++ use of extern "C" after all include directives,
within the negative branch of _ASMLANGUAGE if used.

The inclusion of the generated syscall files is placed outside the
extern "C" block as the generated file has its own extern "C" block.

Background from issue #17997:

Declarations that use C linkage should be placed within extern "C"
so the language linkage is correct when the header is included by
a C++ compiler.

Similarly #include directives should be outside the extern "C" to
ensure the language-specific default linkage is applied to any
declarations provided by the included header.

See: https://en.cppreference.com/w/cpp/language/language_linkage
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-08-13 18:00:31 +02:00
Anas Nashif 8f1780f6de docs: make doxygen happy with new locations
Change @file entry on some headers due to duplicated files in the
include/ tree (real header + shim).
Adapt the doxygen configuration file to the new locations and remove
directories which are already included.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif 8c1f89fa99 cleanup: include/: move sensor.h to drivers/sensor.h
move sensor.h to drivers/sensor.h and
create a shim for backward-compatibility.

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

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00