Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.
Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.
Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.
Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.
Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.
Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.
Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.
Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.
Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.
Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
This patch modifies the ADXL362 driver to use the new
SENSOR_TRIG_MOTION trigger for activity detection
and SENSOR_TRIG_STATIONARY for inactivity detection.
Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.
Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.
Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.
Signed-off-by: Kumar Gala <galak@kernel.org>
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.
Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.
Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.
Signed-off-by: Kumar Gala <galak@kernel.org>
Move to use DEVICE_DT_GET instead of device_get_binding as we work
on phasing out use of DTS 'label' property.
Signed-off-by: Kumar Gala <galak@kernel.org>
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as we
work on phasing out use of DTS 'label' property.
Signed-off-by: Kumar Gala <galak@kernel.org>
Enable I2C access to FXOS7000 sensor on the mixrt595_evk board
Tested using samples/sensor/fxos8700 for mimxrt595_evk_cm33.
Signed-off-by: Chay Guo <changyi.guo@nxp.com>
Adds few missing zephyr/ prefixes to leftover #include statements that
either got added recently or were using double quote format.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
integration platforms can't be filtered out, adapt tests so that those
platforms are always available for testing.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
In order to bring consistency in-tree, migrate all samples to the use
the new prefix <zephyr/...>. Note that the conversion has been scripted:
```python
from pathlib import Path
import re
EXTENSIONS = ("c", "h", "cpp", "rst")
for p in Path(".").glob("samples/**/*"):
if not p.is_file() or p.suffix and p.suffix[1:] not in EXTENSIONS:
continue
content = ""
with open(p) as f:
for line in f:
m = re.match(r"^(.*)#include <(.*)>(.*)$", line)
if (m and
not m.group(2).startswith("zephyr/") and
(Path(".") / "include" / "zephyr" / m.group(2)).exists()):
content += (
m.group(1) +
"#include <zephyr/" + m.group(2) +">" +
m.group(3) + "\n"
)
else:
content += line
with open(p, "w") as f:
f.write(content)
```
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Add sample code that demonstrate the usage for Nuvoton ADC Comparator
driver, this driver is available for NPCX microcontroller family,
this sample is supported on npcx9m6f_evb board.
Signed-off-by: Bernardo Perez Priego <bernardo.perez.priego@intel.com>
This update Atmel sam qdec sensor driver to use pinctrl driver and API.
It update board and sample with new pinctrl groups format.
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
Remove pinmux usage for acmp peripheral on kinetis boards, as mcux_acmp
driver supports pinctrl
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Reserve the upper 8 bits of gpio_dt_flags_t for SoC specific flags and
move the non-standard, hardware-specific GPIO devicetree flags (IO
voltage level, drive strength, debounce filter) from the generic
dt-bindings/gpio/gpio.h header to SoC specific dt-bindings headers.
Some of the SoC specific dt-bindings flags take up more bits than
necessary in order to retain backwards compatibility with the deprecated
GPIO flags. The width of these fields can be reduced/optimized once the
deprecated flags are removed.
Remove hardcoded use of GPIO_INT_DEBOUNCE in GPIO client drivers. This
flag can now be set in the devicetree for boards/SoCs with debounce
filter support. The SoC specific debounce flags have had the _INT part
of their name removed since these flag must be passed to
gpio_pin_configure(), not gpio_pin_interrupt_configure().
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
According to Kconfig guidelines, boolean prompts must not start with
"Enable...". The following command has been used to automate the changes
in this patch:
sed -i "s/bool \"[Ee]nables\? \(\w\)/bool \"\U\1/g" **/Kconfig*
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
the icm42605 defaults to a global thread for trigger processing,
the CONFIG_ICM42605_TRIGGER_OWN_THREAD is deprecated.
Signed-off-by: Mikkel Jakobsen <mikkel.aunsbjerg@escolifesciences.com>
sensor_value_from_double had a early overflow when converting the
fractional part (val2). This occured when input was more then
2147.493647 (inp >= INT32_MAX/1000000.0 + 0.01).
return value -ERANGE as this is what errno is set to by `strtod` and
similar posix functions.
fixes issue #39176
Signed-off-by: Simon Frank <simon.frank@lohmega.com>
The sample enabled the Grove LCD by default in prj.conf, and in the
README it is clearly stated that the sample is intended to work using
the LCD module. This patch remove the unnecessary ifdeffery and obtains
a reference to the display at compile time.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
The driver does not implement a display API, it has a custom API. Having
it under display is confusing, since display API consumers may expect
they can use it. These sort of custom drivers fit better under
drivers/misc.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This PR adds the different handling of temperature sensor for the
STM32L5 soc. In this soc, there are some calibration settings which
need to be applied for temperature conversion.
Signed-off-by: Wouter Cappelle <wouter.cappelle@crodeon.com>
This sample writes the tmp108 temperature to the console
once every 3 seconds. There are macro definitions included
for turning off and on alerts if that is set up, and
also using low power one shot mode.
Signed-off-by: Jimmy Johnson <catch22@fastmail.net>
Add read access to internal tmp116 eeprom which
contains the device unique id after manufacturing
Signed-off-by: Guillaume Lager <g.lager@innoseis.com>
Since drivers implement a callback based on action and not the state,
we should be using the API based on the action instead of the one based
on the state.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Convert remaining tests and samples to using find_package() instead of
literally including the CMake boilerplate code.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
This commit adds const modifier in second argument for
sensor trigger handler.
There is no reason to modify this data and this change
would allow to store trigger configuration also in FLASH.
Fixes: #38929
Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
Adds a config flag to enable floating point support for fxos8700
compatible accelerometer devices.
Signed-off-by: Jordan Stein <jordan.stein@fortrobotics.com>
Both ARG_UNUSED in pm_info(), cause errors when using PM_DEVICE=y.
Added a default case in pm_info(), to fix warnings.
Signed-off-by: Igor Knippenberg <igor.knippenberg@gmail.com>
Add configuration for the mimxrt1024_evk board. This board does not have
any of the FXOS8700 interrupt pins connected by default, so triggers are
not available.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This adds an example application for the TI INA219 Zero-Drift,
Bidirectional Current/Power Monitor with I2C Interface
Signed-off-by: Leonard Pollak <leonardp@tr-host.de>
Move to CMake 3.20.0.
At the Toolchain WG it was decided to move to CMake 3.20.0.
The main reason for increasing CMake version is better toolchain
support.
Better toolchain support is added in the following CMake versions:
- armclang, CMake 3.15
- Intel oneAPI, CMake 3.20
- IAR, CMake 3.15 and 3.20
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
When there is no grove sensor driver enabled, cmake warns
that the library has no sources. Fix that by adding
a new kconfig to be used by CMake to selectively
include the grove directory.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Rename:
- grove,light to seeed,grove-light
- grove,temperature to seeed,grove-temperature
The "grove" brand applies to a family of products by Seeed (sic):
https://www.seeedstudio.com/category/Grove-c-1003.html
Therefore we should use the existing vendor seeed.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
It should be "maxim,max30101", because the vendor prefix for this
company is "maxim", not "max".
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
The verb tense for the suspended state was not consistent with other
states. The likely reason: state was being used as a command/action.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
The difference between low power and suspend states is a thin blur line
that is is not clear and most drivers have used indistinctly. This patch
converges to the usage of the suspend state for low power, since
contrary to the low power state, it is used by both system and runtime
device PM. The low power state is still kept, but its future is unclear
and needs some discussion.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This adds an example application for Sensirions SGP40 gas sensor
and SHT4X T/RH sensor.
The measured T/RH are used to make use of the on-chip T/RH compensation
of the SGP40.
Signed-off-by: Leonard Pollak <leonardp@tr-host.de>
The callback is not used anymore, so just delete it from the pm_control
callback signature.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Move all PM_DEVICE_STATE_* definitions to an enum. The
PM_DEVICE_STATE_SET and PM_DEVICE_STATE_GET definitions have been kept
out of the enum since they do not represent any state. However, their
name has not been changed since they will be removed soon.
All drivers and tests have been adjusted accordingly.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
For some reason a few drivers were not converted to the new device PM
callback signature. The reason may be because the device PM part is
compiled only when CONFIG_PM_DEVICE=y, a condition not enabled in CI by
default.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Change the drivers's compatible from atmel,sam-tc to atmel,sam-tc-qdec.
The atmel,sam-tc should be reserved for the future counter driver.
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
Rename the NXP LPCXpresso55S16 board definition from
lpcxpresso55s16_ns (non-secure) to lpcxpresso55s16 and remove TF-M
configuration options.
While the LPC55S16 does have Arm TrustZone support, there is no TF-M
support available upstream yet.
Fixes#35100
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Converts the bmg160 sample application to check the sensor device at
build time instead of runtime. This fixes a Coverity issue for logically
dead code introduced in commit 5832e588e3.
Fixes#35118
Coverity-CID: 235919
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
Converts the adxl372 sample application to check the sensor device at
build time instead of runtime. This fixes a Coverity issue for logically
dead code introduced in commit 72795c3e6c.
Fixes#35119
Coverity-CID: 235932
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
If we don't get a dev pointer from device_get_binding() we should
not dereference it. Just drop the name from the printk message
as in the future this is likely to use DEVICE_DT_GET().
Fixes#35112
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Looks like I forgot to finish a sentence. There's nothing really
special besides the top level requirement for an enabled node which is
mentioned at the top of the page. Add a reference to the bindings
index while we're here to make it clearer what such nodes contain.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Add a real README, convert the device getter to DEVICE_DT_GET_ANY,
and enable assertions to make debugging easier on new users.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
The MAX17262 is an ultra-low power fuel-gauge IC which implements the
Maxim ModelGauge m5 algorithm. The IC monitors a single-cell battery
pack and supports internal current sensing for up to 3.1A pulse
current. The IC provides best performance for batteries with 100mAhr
to 6Ahr capacity.
Signed-off-by: Matija Tudan <mtudan@mobilisis.hr>
Switch to using I2C0 as this I2C controller on the FRDM-K64F is actually
configured (pinmux) for use and is available on an arduino header if
someone would wire up an adxl372 to it.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Add pinctrl-0 properties for configuration of UART, I2C, SPI, FTM,
DAC, ADC, ACMP, and PWT peripherals. These settings are based on what
is defined in the board/pinmux.c file.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
These changes turn out to have been incompatible with the way pinctrl
drivers are going to work, so we need to go back to what we had before
until we can agree on a better approach.
Squash of the following reverts:
Revert "boards: nrf: fix deprecated I2C properties"
This reverts commit 2a4ac9ac02.
Revert "samples: switch nrf overlays to sda-gpios, scl-gpios"
This reverts commit 01bb08e7d8.
Revert "boards: nrf: switch to sda-gpios, scl-gpios"
This reverts commit 17a66304c4.
Revert "i2c: nordic: switch to phandle arrays for pinmux"
This reverts commit 821c03a14a.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Add simple application to demonstrate quadrature decoder sensor.
Tested on Atmel SMART SAM E70 Xplained board.
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
This sample application periodically reads raw data from the FDC2X1X
sensor in polling mode or optionally with data ready trigger.
It is able to read the 12-Bit and 28-Bit, as well as the 2-Channel
and 4-Channel versions (FDC2112, FDC2114, FDC2212, FDC2214).
The 4-channel versions are chosen through devicetree properties.
The default is FDC2112.
Signed-off-by: Igor Knippenberg <igor.knippenberg@gmail.com>
Set integration_platforms on these samples to just frdm_k64f.
This should be sufficient to make sure these tests build.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
I only see one sample with an overlay using the now legacy sda-pin and
scl-pin properties. Move it to the new style.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Adjust the documentation and devicetree overlays so the sample can be
built for any board with an Arduino I2C and SPI pinout, defaulting I2C
and SPI to y to make it easier to switch between the two without
requiring a pristine build.
The user has to choose an appropriate overlay or have a sensor built
in to the board.
Use the newly introduced DEVICE_DT_GET_ANY() in main.c to ask for a
bosch,bme280 without worrying over the details or exposing
DT_DRV_COMPAT-based functionality that is really meant for drivers.
Remove the no-longer-needed board specific overlay for nRF52840 DK;
this is covered by the generic Arduino overlays now.
Fix the datasheet link while we're here.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Add a sample application to test MAX6675 cold-junction-compensated
K-thermocouple to digital converter.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
Introduce a dts board overlay on the nucleo_l053r8 board as this
board was used for testing addition of resolution setting on the
mcp9808 sensor driver.
Signed-off-by: Steven Daglish <s.c.daglish@gmail.com>
Add sample code which demostrates the use of the offset
register offered in the TMP117.
Also add information about tmp117 in README.
Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
Add a sample for demonstrating the usage of the NXP MCUX Analog
Comparator (ACMP) sensor driver. The sample currently only supports the
NXP TWR-KE18F development board.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
some tests configured with CONFIG_NEWLIB_LIBC=y,
it's better to add a filter filter: TOOLCHAIN_HAS_NEWLIB == 1
in those tests yaml file.
Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
- Remove SYS_ prefix
- shorten POWER_MANAGEMENT to just PM
- DEVICE_POWER_MANAGEMENT -> PM_DEVICE
and use PM_ as the prefix for all PM related Kconfigs
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add sample application for sensor lsm6dso. This sample has been
tested on stm32l562e_dk board, where lsm6dso is connect to I2C bus.
Signed-off-by: Yestin Sun <sunyi0804@gmail.com>
Enables the magnetic vector magnitude function in the fxos8700 sensor
sample application to ensure it builds in CI.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
Converts fxos8700 power mode options (normal, low noise low power, high
resolution, low power) from Kconfigs to an optional device tree
property.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
Samples that include floating-point format specifications may need
cbprintf FP support. Make sure it's available.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
The Nucleo-L031K6 development board has been tested with the MCP9808
sample code and works as expected.
Signed-off-by: Steven Daglish <s.c.daglish@gmail.com>
The overlay file defines an i2c interface for the
Feather nRF52840 Express and the Adafruit BME680.
Also adds the platform to the test build configuration.
Signed-off-by: Patrick K. Moffitt <patrick@moffitt.com>
Remove reference to a specific board, since that board doesn't have
this sensor.
Add a dependency on presence of a devicetree node that will be
required to build the driver.
Add a fixture that identifies the specific sensor required to run the
sample. This should be added as a side effect of specifying the
shield (though this is not currently done, it must be added in the
device description).
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Now that device_api attribute is unmodified at runtime, as well as all
the other attributes, it is possible to switch all device driver
instance to be constant.
A coccinelle rule is used for this:
@r_const_dev_1
disable optional_qualifier
@
@@
-struct device *
+const struct device *
@r_const_dev_2
disable optional_qualifier
@
@@
-struct device * const
+const struct device *
Fixes#27399
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Add a sample to demonstrate and test the Wurth Elektronik WSEN-ITDS
accel sensor. Sample code covers accel and die temperature functions.
Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
The generic SPI GPIO chip select support now respects devicetree flags
for signal active level. Update all cs-gpios properties to specify
active low.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
When using an IDE (e.g. Eclipse, Qt Creator), the project name gets
displayed. This greatly simplifies the navigation between projects when
having many of them open at the same time. Naming multiple projects
"NONE" defeats this functionality.
This patch tries to use sensible project names while not duplicating
too much of what is already represented in the path. This is done by
using the name of the directory the relevant CMakeLists.txt file is
stored in. To ensure unique project names, small, manual adjustments
have been done.
See also 7eabab2f5d ("samples, tests: Use semi-accurate project names")
Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
This provides a better error message when building with CMake and
forgetting ZEPHYR_BASE or not registering Zephyr in the CMake package
registry. See parent commit for more details (split from parent for
better readability).
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Several reviewers agreed that DT_HAS_NODE_STATUS_OKAY(...) was an
undesirable API for the following reasons:
- it's inconsistent with the rest of the DT_NODE_HAS_FOO names
- DT_NODE_HAS_FOO_BAR_BAZ(node) was agreed upon as a shorthand
for macros which are equivalent to
DT_NODE_HAS_FOO(node) && DT_NODE_HAS_BAR(node) &&
- DT_NODE_HAS_BAZ(node), and DT_HAS_NODE_STATUS_OKAY is an odd duck
- DT_NODE_HAS_STATUS(..., okay) was viewed as more readable anyway
- it is seen as a somewhat aesthetically challenged name
Replace all users with DT_NODE_HAS_STATUS(..., okay), which is
semantically equivalent.
This is mostly done with sed, but a few remaining cases were done by
hand, along with whitespace, docs, and comment changes. These special
cases include the Nordic SOC static assert files.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Rename DT_HAS_NODE to DT_HAS_NODE_STATUS_OKAY so the semantics are
clear. As going forward DT_HAS_NODE will report if a NODE exists
regardless of its status.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
The NRF driver doesn't utilize the Kconfig symbol for per instance I2C
so we can remove setting that in the conf file.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
The sensor is on the nrf9160_innblue22 not nrf9160_innblue21. This
causes CI build failures since there is no dts node for the sensor
on the nrf9160_innblue21 board.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Convert driver to use DT_INST_ defines. As part of this conversion we
remove the Kconfig options for per GPIO controller enables and instead
get that information from device tree. This means we now disable each
GPIO controller by default in the DTS and have each board dts enable the
GPIO controller ports it needs.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
board support nrf9160_innblue22 includes the sensor in
nrf9160_innblue22_common.dts, explicit overlay can be removed
Signed-off-by: Parthiban Nallathambi <parthiban@linumiz.com>
I personally don't find it very useful to have to maintain prj.conf
and prj_spi.conf for this sample. The information we need to make
this application "just work" with regards to the bus is available in
the devicetree, and Kconfig can now access it using
dt_compat_on_bus().
Do so, enabling I2C and SPI appropriately when a sensor of the right
type is on either of those buses.
If no sensors are enabled, the user gets the build-time error message
in main.c about no devices being found.
This approach is prone to the "stuck symbol" Kconfig problem covered
in our documentation, so a pristine build is necessary to change the
default settings from a previous build.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Use instance zero of the compatible to get the device instead of
fixing a label. Print the used label for help debugging, and the
results of finding the device (or not), with a hint about what might
have gone wrong in case of failure.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
The nrf52840-DK doesn't have this sensor built-in, so it's likely
users will be getting this sensor from a breakout board. The ones that
Sparkfun and Adafruit sell pull up the LSB address pin, so the default
address is 0x77 on those boards.
Let's follow along with them instead of using 0x76, because those are
the boards that come up first in the results when you google "BME280
breakout board" from where I'm sitting.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This helps debug issues with the device. Samples should try to be
helpful to first-time users. Send printk() to logging so it doesn't
fight over the UART.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Add bq274xx sample with reading and showing all
possible values from the sensor.
Signed-off-by: Parthiban Nallathambi <parthiban@linumiz.com>
Signed-off-by: NavinSankar Velliangiri <navin@linumiz.com>
The lpcxpresso55s69 board has an mma8652 accelerometer which is
compatible with the fxos8700 driver in accel-only mode. Now that this
board has an i2c driver, include it in the platform whitelist.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
The samples/sensor/sensor_shell sample was introduced after deprecation
of set_conf_file and thus was not adopted to the new recommended board
conf file overlay.
This commit align this sample with the rest of Zephyr's samples.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
The board name for the Thingy:52, so far known as nrf52_pca20020, is
renamed to thingy52_nrf52832. Its documentation and all references to
its name in the tree are updated accordingly. Overlay and configuration
files specific to this board are also renamed, to match the new board
name.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The board name for the nRF52 DK, so far known as nrf52_pca10040, is
renamed to nrf52dk_nrf52832. Its documentation and all references
to its name in the tree are updated accordingly. Overlay and
configuration files specific to this board are also renamed, to
match the new board name.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The fxos8700 sample application configures the sensor driver to sample
data at 6.25 Hz. Most configurations use the sensor data ready interrupt
to throttle the loop, but it's possible to configure the sample not to
use the data ready interrupt. In this case, throttle the loop with a
delay so it doesn't outpace the sensor data.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
The frdm-kl25z, bbc_microbit, and reel_board have an mma8xxx
accelerometer and therefore must use the fxos8700 driver in
accelerometer-only mode instead of hybrid mode. Refactor these boards
into a separate test that uses the prj_accel.conf configuration as
described in README.rst.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
Kernel timeouts have always been a 32 bit integer despite the
existence of generation macros, and existing code has been
inconsistent about using them. Upcoming commits are going to make the
timeout arguments opaque, so fix things up to be rigorously correct.
Changes include:
+ Adding a K_TIMEOUT_EQ() macro for code that needs to compare timeout
values for equality (e.g. with K_FOREVER or K_NO_WAIT).
+ Adding a k_msleep() synonym for k_sleep() which can continue to take
integral arguments as k_sleep() moves away to timeout arguments.
+ Pervasively using the K_MSEC(), K_SECONDS(), et. al. macros to
generate timeout arguments.
+ Removing the usage of K_NO_WAIT as the final argument to
K_THREAD_DEFINE(). This is just a count of milliseconds and we need
to use a zero.
This patch include no logic changes and should not affect generated
code at all.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Using find_package to locate Zephyr.
Old behavior was to use $ENV{ZEPHYR_BASE} for inclusion of boiler plate
code.
Whenever an automatic run of CMake happend by the build system / IDE
then it was required that ZEPHYR_BASE was defined.
Using ZEPHYR_BASE only to locate the Zephyr package allows CMake to
cache the base variable and thus allowing subsequent invocation even
if ZEPHYR_BASE is not set in the environment.
It also removes the risk of strange build results if a user switchs
between different Zephyr based project folders and forgetting to reset
ZEPHYR_BASE before running ninja / make.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
The nRF52840 DK board target, so far known as nrf52840_pca10056,
is renamed to nrf52840dk_nrf52840.
Its documentation and all references to its name in the tree are
updated accordingly. Overlay and configuration files specific to
this board are also renamed, to match the new board name.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
gpio_pin_get() returns a negative value in case of error and
callbacks_configure was assigning this value to an unsigned variable.
Fixes: #22643
Coverity CID :208206
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
And an overlay for the nRF52840 DK to be able to build the sample after
the transition to Device Tree.
Fixes#23148.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Replace Kconfig configuration data with devicetree bindings using
(ADC) io channels. Rework the sample to document expectations about
the relationship between the reference voltage and the divider input
voltage, and update the sensor configuration to support Nordic SAADC.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Replace Kconfig configuration data with devicetree bindings using
(ADC) io channels. Rework the sample to document expectations about
the relationship between the reference voltage and the divider input
voltage, and update the sensor configuration to support Nordic SAADC.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Use new configuration API, replace callback enable/disable with
interrupt enable/disable, and set active level in devicetree source.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Update devicetree sources and bindings, switch to new GPIO API. Use
devicetree property name to identify interrupt signal.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Update sample overlays. Add GPIO flags to configuration state.
Refactor to split out setup/handle/process phases. Switch to new API
replacing callback dis/enable with interrupt dis/enable.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Since this was converted to the setup/handle/process idiom in master
the conversion is straightforward.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit updates the HMC5883L driver to use the new GPIO API.
Also add a note explicitly describing the active state of the DRDY
pin in the binding file.
Tested on frdm_k64f.
Signed-off-by: Kevin Townsend <kevin@ktownsend.com>
Update sample overlay for missing chip select and to deconflict with
UART TXD. Add GPIO flags to configuration state. Replace callback
enable with interrupt enable.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Add a sample overlay. Add GPIO flags to configuration state. Replace
callback enable with interrupt enable.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Update ALERT active level in all devicetree files. Capture GPIO flags
in static configuration. Add internal API to enable and disable
interrupt, to release the handlers when an alert occurs, and to
re-enable the signal when the handler completes. Check for alerts
received during periods when the interrupt was disabled.
Extend the example to handle both above and below range triggers and
alerts that are present on startup.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Assignments have no effect on promptless symbols. Flagged by
https://github.com/zephyrproject-rtos/zephyr/pull/20742.
SHT3XD_TRIGGER is already being selected by
SHT3XD_TRIGGER_GLOBAL_THREAD, which is enabled in the same configuration
file.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Add missing information to existing files in anticipation of whinage
from recently modified CI License checks.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Correct handling of device encoded temperature values, which combine a
12-bit 2s complement signed value with a separate sign bit. Rework
conversion between device and sensor temperature representations to
support negative temperatures in both domains.
Use a much simpler trigger configuration where the alert is driven by
comparator output, rather than as an interrupt that requires a pair of
I2C transactions to read and clear the flag.
Refactor the trigger infrastructure to use the setup/handle/process
idiom, which reduces duplicated code and to correctly detect alerts
present when the triggers are set.
Completely replace the sample with something that demonstrates
updating upper and lower threshold values to track moving
temperatures.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Add a sample for the MPU6050 that demonstrates on-demand and triggered
display of all sensor data.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>