Convert ism330dhcx INT_PIN attribute from Kconfigs to Device
Tree binding properties. Here int-pin has been defined as
enum with two possible values: 1 and 2.
Signed-off-by: Armando Visconti <armando.visconti@st.com>
Convert ism330dhcx accel and gyro odr attributes from Kconfigs to Device
Tree binding properties.
Signed-off-by: Armando Visconti <armando.visconti@st.com>
Converts ism330dhcx accel and gyro range attributes from Kconfigs to
Device Tree binding properties.
Signed-off-by: Armando Visconti <armando.visconti@st.com>
The default shell configuration has heavy flash and memory requirements,
requiring project maintainers to set many configuration options to "n"
to keep flash and memory requirements within reason.
This adds a new configuration option, CONFIG_SHELL_MINIMAL, which will
disable flash and memory heavy options by default, and allow project
maintainers to select/imply only the options they want.
On a quick test from an ARM board I'm working on, enabling this option
cut flash space requirements by ~8 KB, and memory requirements by ~1 KB.
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
mpu9250 is a single package that contains both an mpu6050 6-axis
motion sensor and an ak8963 magnetometer. The two parts have
separate i2c addresses, yet despite the common mpu6050 component,
it has a different value in the "WHOAMI" register -- 0x71 instead
of 0x68.
This adds the additional chip id value in order to enable the use
of mpu9250.
Signed-off-by: Adam Serbinski <adam@serbinski.com>
Move the SPI and I2C bus I/O bits into their own files. This makes
this driver more similar to other sensor drivers.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Now that we have various convenience macros in drivers/spi.h and
device.h defined, we can resolve some longstanding TODO items in how
this driver gets a hold of the devices it depends on:
- get bus devices with DEVICE_DT_GET
- get SPI chip select information with SPI_CONFIG_DT_INST
The results are shorter on boilerplate, save RAM, and improve boot
time.
The same techniques could be reused by other device drivers.
These changes require that the SPI bus and GPIO (for device CS)
devices used to interface with the BME280 are defined in devicetree.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
In NPCX7 series, it contains two tachometer (TACH) modules that contains
two Independent timers (counter 1 and 2). They are used to capture a
counter value when an event is detected via the external pads (TA or
TB).
The CL also includes:
— Add npcx tachometer device tree declarations.
— Zephyr sensor api implementation for tachometer.
— Enable "tach1" device in npcx7m6fb.dts for testing.
Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
Rework the checks for INPSEL, INNSEL, and C0_OFFSET_BIT presence to
avoid warnings when -Wexpansion-to-defined is enabled.
The warning was enabled in c7bc6380bd.
Fixes#32475.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
QDEC_NRFX shall depend on either HAS_HW_NRF_QDEC,
or HAS_HW_NRF_QDEC0, since in the nRF5340 Application
core definition we select HAS_HW_NRF_QDEC0 instead of
HAS_HW_NRF_QDEC.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This fixes a missing bit in the registers description
which results to wrong FIFO ODR configuration
when trying to configure a FIFO ODR higher than 833Hz
Signed-off-by: Clotilde Sattler <clotilde.sattler@stimio.fr>
During the driver init, the function will set the sensor resolution
based on the driver's dts variable "resolution"
The driver's device tree has been updated to include the value
"resolution".
The default is set to the highest resolution of 0.0625C.
Moved mcp9808_reg_write from mcp9808_trigger.c to mcp9808.c
This allows resue of the same function in both the trigger and
resolution functions.
Function name changed to xxx_16bit to distinquish it from the 8
bit write function that will added.
Signed-off-by: Steven Daglish <s.c.daglish@gmail.com>
Driver uses DEVICE_AND_API_INIT which is deprecated so convert
to using DEVICE_DT_INST_DEFINE instead.
Fixes#32151
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
There are several different issues when trying to build the icm42605
sensor driver:
* Missing entry in drivers/sensor/CMakeLists.txt
* Issues with #ifndef in header files
* Issues with const usage
* Missing function prototypes in headers
* Fix use of LOG_MODULE_REGISTER v LOG_MODULE_DECLARE
* Add missing dts node to tests/drivers/build_all/spi.dtsi
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This patch fixes warnings for unused variables when acceleremoter
range and sampling frequency are set to values different from
the defaults.
Signed-off-by: Jan Tore Guggedal <jantore.guggedal@nordicsemi.no>
`SENSOR_CHAN_GAUGE_AVG_CURRENT` is currently treated as a capacity
by the MAX17055 driver, however the unit conversion is different
for current and must be calculated separately.
Add a separate method to convert a current reading to milliamps
from 1.5625 uV/R_SENSE units, instead of the 5uVH/R_SENSE conversion
that was previously used.
Tested by comparing value read and converted from MAX17055 with
value from an external power profiling kit.
Signed-off-by: Hayden Ball <hayden@playerdata.co.uk>
The ',' character was used as line terminator instead of ';'
in SPI routines. The three affected drivers were not showing
any issue, but the typo is fixed for clarity.
Signed-off-by: Armando Visconti <armando.visconti@st.com>
This allows out-of-tree libraries to implement their own temperature
driver.
We allow selecting TEMP_NRF5 to aviod dependency loops
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Initial driver and sample application of
TDK Invensense ICM42605 6-axis motion sensor.
This driver provide DTS for nRF52 DK board DTS setting.
Providing features are below.
Sensor data streaming - Accel, gyro
Tap, Double tap triggering.
Set/Get FSR, ODR by set attr API
Support multi instance feature.
Signed-off-by: JuHyun Kim <jkim@invensense.com>
Move iis2dlpc trigger pulse configurations from Kconfigs to Device Tree.
Moreover the dts properties have been renamed as 'tap', which sounds a
better name to immediately catch the feature behind it. Since tap
threshold cannot be zero, this value (which is the default in dts
binding) is used to enable/disable the device feature per each axis.
The event can be generated on INT1 only.
Signed-off-by: Armando Visconti <armando.visconti@st.com>
Simplify the switch case on trigger types (SENSOR_TRIG_DRDY and
SENSOR_TRIG_TAP) inside iis2dlpc_enable_int().
Signed-off-by: Armando Visconti <armando.visconti@st.com>
The IIS2DLPC drdy interrupt can be routed to either INT1 or
INT2 pin. Currently the selection is done by Kconfig configuration.
This commit is instead moving it into Device Tree as 'drdy-int'.
Signed-off-by: Armando Visconti <armando.visconti@st.com>
Now that we generate a header that extern's all possible devicetree
based device struct we can remove DEVICE_DT_DECLARE and
DEVICE_DT_INST_DECLARE as they aren't needed anymore.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Remove all odr values from Kconfig and always init it
at 12.5Hz. It is responsibility of application to set
the rate to a different value using SENSOR_ATTR_SAMPLING_FREQUENCY.
Signed-off-by: Armando Visconti <armando.visconti@st.com>
The thresholds for activity/inactivity in the adxl362 acceleromter have
two parameters that can be configured. Currently the threshold is
configurable via the KConfig variables CONFIG_ADXL362_ACTIVITY_THRESHOLD
and CONFIG_ADXL362_INACTIVITY_THRESHOLD which configure repectively the
value in the THRESH_ACT and THRESH_INACT registers.
The other parameter that can be configured is the time by changing the
values in the registers TIME_ACT and TIME_INACT, but this values are
hardcoded to 1 (see lines 653 and 675 in adxl362.c), this patch adds
support for configuring those values in KConfig as
CONFIG_ADXL362_ACTIVITY_TIME and CONFIG_ADXL362_INACTIVITY_TIME.
Signed-off-by: Xavier Naveira <xnaveira@gmail.com>
TMP117 from TI is a sensor similar to tmp116, but it has more precision
and it also supports the offset register.
Add support for SENSOR_ATTR_OFFSET, which is used by TMP117 to the
pre-exisiting tmp116 driver.
This commit also enables multiple instances and adds TMP117 to Kconfig.
Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
The dev_name field in DEVICE_AND_API_INIT() call should match the
driver's name. Tmp116 driver had a wrong dev_name field.
Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
Fixes the fxas21002 sensor driver to provide gyro channel data in
radians/sec instead of degrees/sec.
Signed-off-by: Maureen Helm <maureen.helm@nxp.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>
Move users that are DEVICE_DT_DECLARE(DT_DRV_INST(n, ...)) to
DEVICE_DT_INST_DECLARE(n, ...) and similar for DEVICE_DT_DEFINE.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
When testing the bmi160 I've come across an issue where the readings
didn't make sense to me. The issue comes from reading the
BMI160_SAMPLE_BURST_READ_ADDR which is 0x0C assuming both accelerometer
and gyroscope. At this point we would normally read 12 bytes
(2 bytes per sample * 3 axes * 2 sensors). This reading takes place in
bmi160_sample_fetch and begins writing to data->sample.raw
Without this change, the first byte written is actually to the dummy
byte which effectively gets tossed. The issue is that this is the
GYR_X<7:0>(LSB) according to the BMI160 data sheet. When we later call
either bmi160_gyr_channel_get or bmi160_acc_channel_get we're looking
at sample.gyr and sample.acc (which is effectively shiften by 1 byte).
This change gets rid of the dummy byte which re-alignes gyr with the
start of the raw buffer.
Signed-off-by: Yuval Peress <peress@chromium.org>
Use the devicetree node as the source of object name and other
information used when defining the device structure.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>