diff --git a/drivers/sensor/adt7420/adt7420.c b/drivers/sensor/adt7420/adt7420.c index e87c6207eb07..d07785cef9a8 100644 --- a/drivers/sensor/adt7420/adt7420.c +++ b/drivers/sensor/adt7420/adt7420.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include "adt7420.h" diff --git a/drivers/sensor/adt7420/adt7420_trigger.c b/drivers/sensor/adt7420/adt7420_trigger.c index 4d9412d875ec..87fb0414afce 100644 --- a/drivers/sensor/adt7420/adt7420_trigger.c +++ b/drivers/sensor/adt7420/adt7420_trigger.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include "adt7420.h" diff --git a/drivers/sensor/adxl362/adxl362.c b/drivers/sensor/adxl362/adxl362.c index b3c17c77a758..659a9e27e9b3 100644 --- a/drivers/sensor/adxl362/adxl362.c +++ b/drivers/sensor/adxl362/adxl362.c @@ -7,7 +7,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/sensor/adxl362/adxl362_trigger.c b/drivers/sensor/adxl362/adxl362_trigger.c index 7dc0dbef82f3..a0f3b777d812 100644 --- a/drivers/sensor/adxl362/adxl362_trigger.c +++ b/drivers/sensor/adxl362/adxl362_trigger.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include "adxl362.h" diff --git a/drivers/sensor/adxl372/adxl372.c b/drivers/sensor/adxl372/adxl372.c index b8db23812258..0e3c0b842b22 100644 --- a/drivers/sensor/adxl372/adxl372.c +++ b/drivers/sensor/adxl372/adxl372.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/sensor/adxl372/adxl372_trigger.c b/drivers/sensor/adxl372/adxl372_trigger.c index 88e7bbf35497..32d8fa1cdaf9 100644 --- a/drivers/sensor/adxl372/adxl372_trigger.c +++ b/drivers/sensor/adxl372/adxl372_trigger.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include "adxl372.h" #define LOG_LEVEL CONFIG_SENSOR_LOG_LEVEL diff --git a/drivers/sensor/ak8975/ak8975.c b/drivers/sensor/ak8975/ak8975.c index c1ade27efccf..fd1f5eaa3a01 100644 --- a/drivers/sensor/ak8975/ak8975.c +++ b/drivers/sensor/ak8975/ak8975.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/sensor/amg88xx/amg88xx.c b/drivers/sensor/amg88xx/amg88xx.c index 4552969df69f..79aba35140eb 100644 --- a/drivers/sensor/amg88xx/amg88xx.c +++ b/drivers/sensor/amg88xx/amg88xx.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/sensor/amg88xx/amg88xx_trigger.c b/drivers/sensor/amg88xx/amg88xx_trigger.c index 6e9e91ce46ff..6bb63e88a4e3 100644 --- a/drivers/sensor/amg88xx/amg88xx_trigger.c +++ b/drivers/sensor/amg88xx/amg88xx_trigger.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include "amg88xx.h" extern struct amg88xx_data amg88xx_driver; diff --git a/drivers/sensor/ams_iAQcore/iAQcore.c b/drivers/sensor/ams_iAQcore/iAQcore.c index 0736c05c8a30..13568aca6810 100644 --- a/drivers/sensor/ams_iAQcore/iAQcore.c +++ b/drivers/sensor/ams_iAQcore/iAQcore.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/sensor/apds9960/apds9960.c b/drivers/sensor/apds9960/apds9960.c index 5dee388e4399..b483e884299d 100644 --- a/drivers/sensor/apds9960/apds9960.c +++ b/drivers/sensor/apds9960/apds9960.c @@ -10,7 +10,7 @@ */ #include -#include +#include #include #include #include diff --git a/drivers/sensor/apds9960/apds9960_trigger.c b/drivers/sensor/apds9960/apds9960_trigger.c index 499923eced35..aa53f4a9126f 100644 --- a/drivers/sensor/apds9960/apds9960_trigger.c +++ b/drivers/sensor/apds9960/apds9960_trigger.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include "apds9960.h" extern struct apds9960_data apds9960_driver; diff --git a/drivers/sensor/bma280/bma280.c b/drivers/sensor/bma280/bma280.c index f83cfab92b83..8f77e35136d4 100644 --- a/drivers/sensor/bma280/bma280.c +++ b/drivers/sensor/bma280/bma280.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include diff --git a/drivers/sensor/bma280/bma280_trigger.c b/drivers/sensor/bma280/bma280_trigger.c index 4e4406751d57..8d6f113b0003 100644 --- a/drivers/sensor/bma280/bma280_trigger.c +++ b/drivers/sensor/bma280/bma280_trigger.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include "bma280.h" diff --git a/drivers/sensor/bmc150_magn/bmc150_magn.c b/drivers/sensor/bmc150_magn/bmc150_magn.c index 6eac87335097..a107d73c53fd 100644 --- a/drivers/sensor/bmc150_magn/bmc150_magn.c +++ b/drivers/sensor/bmc150_magn/bmc150_magn.c @@ -9,7 +9,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include #include #include #include diff --git a/drivers/sensor/bmc150_magn/bmc150_magn_trigger.c b/drivers/sensor/bmc150_magn/bmc150_magn_trigger.c index cc3e116cd4f4..88e8d2392570 100644 --- a/drivers/sensor/bmc150_magn/bmc150_magn_trigger.c +++ b/drivers/sensor/bmc150_magn/bmc150_magn_trigger.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include "bmc150_magn.h" diff --git a/drivers/sensor/bme280/bme280.c b/drivers/sensor/bme280/bme280.c index ebe8b6137ea8..65faf0554eb3 100644 --- a/drivers/sensor/bme280/bme280.c +++ b/drivers/sensor/bme280/bme280.c @@ -8,7 +8,7 @@ */ #include -#include +#include #include #include #include diff --git a/drivers/sensor/bme680/bme680.c b/drivers/sensor/bme680/bme680.c index ecb90daa8419..9ea61e66b341 100644 --- a/drivers/sensor/bme680/bme680.c +++ b/drivers/sensor/bme680/bme680.c @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include LOG_MODULE_REGISTER(bme680, CONFIG_SENSOR_LOG_LEVEL); diff --git a/drivers/sensor/bmg160/bmg160.c b/drivers/sensor/bmg160/bmg160.c index caa4cff27682..bcde519c4225 100644 --- a/drivers/sensor/bmg160/bmg160.c +++ b/drivers/sensor/bmg160/bmg160.c @@ -9,7 +9,7 @@ */ #include -#include +#include #include #include #include diff --git a/drivers/sensor/bmg160/bmg160_trigger.c b/drivers/sensor/bmg160/bmg160_trigger.c index ac8f96a6dfdd..45e7b14fdbdf 100644 --- a/drivers/sensor/bmg160/bmg160_trigger.c +++ b/drivers/sensor/bmg160/bmg160_trigger.c @@ -9,7 +9,7 @@ */ #include -#include +#include #include "bmg160.h" diff --git a/drivers/sensor/bmi160/bmi160.c b/drivers/sensor/bmi160/bmi160.c index 6e8b2c130468..6d2788a1bf1e 100644 --- a/drivers/sensor/bmi160/bmi160.c +++ b/drivers/sensor/bmi160/bmi160.c @@ -9,7 +9,7 @@ */ #include -#include +#include #include #include #include diff --git a/drivers/sensor/bmi160/bmi160_trigger.c b/drivers/sensor/bmi160/bmi160_trigger.c index fca4aebe53d8..b8582df99996 100644 --- a/drivers/sensor/bmi160/bmi160_trigger.c +++ b/drivers/sensor/bmi160/bmi160_trigger.c @@ -6,7 +6,7 @@ */ #include -#include +#include #include #include "bmi160.h" diff --git a/drivers/sensor/bmm150/bmm150.h b/drivers/sensor/bmm150/bmm150.h index 75c3f946beef..22e44c43602d 100644 --- a/drivers/sensor/bmm150/bmm150.h +++ b/drivers/sensor/bmm150/bmm150.h @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/sensor/ccs811/ccs811.c b/drivers/sensor/ccs811/ccs811.c index 6715356e4294..f1fd4d51b983 100644 --- a/drivers/sensor/ccs811/ccs811.c +++ b/drivers/sensor/ccs811/ccs811.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/sensor/dht/dht.c b/drivers/sensor/dht/dht.c index f2276fe8f6b4..e454864bb6a9 100644 --- a/drivers/sensor/dht/dht.c +++ b/drivers/sensor/dht/dht.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/sensor/ens210/ens210.c b/drivers/sensor/ens210/ens210.c index 4d88bd95d2b7..1e41bbe8ab62 100644 --- a/drivers/sensor/ens210/ens210.c +++ b/drivers/sensor/ens210/ens210.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #include "ens210.h" diff --git a/drivers/sensor/fxas21002/fxas21002.h b/drivers/sensor/fxas21002/fxas21002.h index d1cb6263076b..4f7803aa4209 100644 --- a/drivers/sensor/fxas21002/fxas21002.h +++ b/drivers/sensor/fxas21002/fxas21002.h @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include #include #include diff --git a/drivers/sensor/fxos8700/fxos8700.h b/drivers/sensor/fxos8700/fxos8700.h index cc671f39e9f9..83e3a7fb4b00 100644 --- a/drivers/sensor/fxos8700/fxos8700.h +++ b/drivers/sensor/fxos8700/fxos8700.h @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include #include #include diff --git a/drivers/sensor/grove/light_sensor.c b/drivers/sensor/grove/light_sensor.c index e4d78ddca571..54b4a96c862f 100644 --- a/drivers/sensor/grove/light_sensor.c +++ b/drivers/sensor/grove/light_sensor.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #define LOG_LEVEL CONFIG_SENSOR_LOG_LEVEL diff --git a/drivers/sensor/grove/temperature_sensor.c b/drivers/sensor/grove/temperature_sensor.c index 28181f1fcd64..2aaf2dca83b5 100644 --- a/drivers/sensor/grove/temperature_sensor.c +++ b/drivers/sensor/grove/temperature_sensor.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #define LOG_LEVEL CONFIG_SENSOR_LOG_LEVEL diff --git a/drivers/sensor/hmc5883l/hmc5883l.c b/drivers/sensor/hmc5883l/hmc5883l.c index 9b54d7e40e62..beb2ac431a35 100644 --- a/drivers/sensor/hmc5883l/hmc5883l.c +++ b/drivers/sensor/hmc5883l/hmc5883l.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/sensor/hmc5883l/hmc5883l_trigger.c b/drivers/sensor/hmc5883l/hmc5883l_trigger.c index 1c6280e7fd0b..2e35b3abafbf 100644 --- a/drivers/sensor/hmc5883l/hmc5883l_trigger.c +++ b/drivers/sensor/hmc5883l/hmc5883l_trigger.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include "hmc5883l.h" diff --git a/drivers/sensor/hp206c/hp206c.c b/drivers/sensor/hp206c/hp206c.c index 26fdff3ff9a4..edd3226eca93 100644 --- a/drivers/sensor/hp206c/hp206c.c +++ b/drivers/sensor/hp206c/hp206c.c @@ -9,7 +9,7 @@ */ #include -#include +#include #include #include #include diff --git a/drivers/sensor/hts221/hts221.c b/drivers/sensor/hts221/hts221.c index 35b406771c54..15baf9e9f9b3 100644 --- a/drivers/sensor/hts221/hts221.c +++ b/drivers/sensor/hts221/hts221.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/sensor/hts221/hts221_trigger.c b/drivers/sensor/hts221/hts221_trigger.c index f63f3fa319eb..89a47bcb195a 100644 --- a/drivers/sensor/hts221/hts221_trigger.c +++ b/drivers/sensor/hts221/hts221_trigger.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include "hts221.h" diff --git a/drivers/sensor/isl29035/isl29035.c b/drivers/sensor/isl29035/isl29035.c index 236d73851e35..d5bce22cfbcf 100644 --- a/drivers/sensor/isl29035/isl29035.c +++ b/drivers/sensor/isl29035/isl29035.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/sensor/isl29035/isl29035.h b/drivers/sensor/isl29035/isl29035.h index e1b339d7b940..eca195cd74cd 100644 --- a/drivers/sensor/isl29035/isl29035.h +++ b/drivers/sensor/isl29035/isl29035.h @@ -11,7 +11,7 @@ #include #include -#include +#include #include #define ISL29035_I2C_ADDRESS 0x44 diff --git a/drivers/sensor/lis2dh/lis2dh.h b/drivers/sensor/lis2dh/lis2dh.h index e3485eb389f3..732f82535e54 100644 --- a/drivers/sensor/lis2dh/lis2dh.h +++ b/drivers/sensor/lis2dh/lis2dh.h @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #define LIS2DH_BUS_ADDRESS DT_INST_0_ST_LIS2DH_BASE_ADDRESS diff --git a/drivers/sensor/lis2ds12/lis2ds12.c b/drivers/sensor/lis2ds12/lis2ds12.c index c53d2d489685..862e95b8b3f2 100644 --- a/drivers/sensor/lis2ds12/lis2ds12.c +++ b/drivers/sensor/lis2ds12/lis2ds12.c @@ -8,7 +8,7 @@ * https://www.st.com/resource/en/datasheet/lis2ds12.pdf */ -#include +#include #include #include #include diff --git a/drivers/sensor/lis2ds12/lis2ds12.h b/drivers/sensor/lis2ds12/lis2ds12.h index ac5b7d1be4a1..efa39d8c85ed 100644 --- a/drivers/sensor/lis2ds12/lis2ds12.h +++ b/drivers/sensor/lis2ds12/lis2ds12.h @@ -12,7 +12,7 @@ #define ZEPHYR_DRIVERS_SENSOR_LIS2DS12_LIS2DS12_H_ #include -#include +#include #include #define LIS2DS12_REG_WHO_AM_I 0x0F diff --git a/drivers/sensor/lis2ds12/lis2ds12_trigger.c b/drivers/sensor/lis2ds12/lis2ds12_trigger.c index 9b16cc06d63b..4c19e42a1c61 100644 --- a/drivers/sensor/lis2ds12/lis2ds12_trigger.c +++ b/drivers/sensor/lis2ds12/lis2ds12_trigger.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include "lis2ds12.h" diff --git a/drivers/sensor/lis2dw12/lis2dw12.c b/drivers/sensor/lis2dw12/lis2dw12.c index d8755062635a..9bda0739d8e6 100644 --- a/drivers/sensor/lis2dw12/lis2dw12.c +++ b/drivers/sensor/lis2dw12/lis2dw12.c @@ -12,7 +12,7 @@ #include #include #include -#include +#include #if defined(DT_ST_LIS2DW12_BUS_SPI) #include diff --git a/drivers/sensor/lis2dw12/lis2dw12.h b/drivers/sensor/lis2dw12/lis2dw12.h index cd7bf6ffa816..b3f9f33c0568 100644 --- a/drivers/sensor/lis2dw12/lis2dw12.h +++ b/drivers/sensor/lis2dw12/lis2dw12.h @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include "lis2dw12_reg.h" #if defined(CONFIG_LIS2DW12_ODR_1_6) diff --git a/drivers/sensor/lis2dw12/lis2dw12_trigger.c b/drivers/sensor/lis2dw12/lis2dw12_trigger.c index 5bb3cc5cd649..1d3267f4aabe 100644 --- a/drivers/sensor/lis2dw12/lis2dw12_trigger.c +++ b/drivers/sensor/lis2dw12/lis2dw12_trigger.c @@ -9,7 +9,7 @@ */ #include -#include +#include #include #include diff --git a/drivers/sensor/lis2mdl/lis2mdl.c b/drivers/sensor/lis2mdl/lis2mdl.c index 846f1a6c695b..0ef34ed11e77 100644 --- a/drivers/sensor/lis2mdl/lis2mdl.c +++ b/drivers/sensor/lis2mdl/lis2mdl.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include "lis2mdl.h" diff --git a/drivers/sensor/lis2mdl/lis2mdl_trigger.c b/drivers/sensor/lis2mdl/lis2mdl_trigger.c index 7448ca78a017..e5f8fd1feb63 100644 --- a/drivers/sensor/lis2mdl/lis2mdl_trigger.c +++ b/drivers/sensor/lis2mdl/lis2mdl_trigger.c @@ -7,7 +7,7 @@ */ #include -#include +#include #include #include "lis2mdl.h" diff --git a/drivers/sensor/lis3mdl/lis3mdl.c b/drivers/sensor/lis3mdl/lis3mdl.c index cd6956f154ae..88a2d94ee906 100644 --- a/drivers/sensor/lis3mdl/lis3mdl.c +++ b/drivers/sensor/lis3mdl/lis3mdl.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/sensor/lis3mdl/lis3mdl_trigger.c b/drivers/sensor/lis3mdl/lis3mdl_trigger.c index ec2324d224e7..655eefd786d8 100644 --- a/drivers/sensor/lis3mdl/lis3mdl_trigger.c +++ b/drivers/sensor/lis3mdl/lis3mdl_trigger.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include "lis3mdl.h" diff --git a/drivers/sensor/lps22hb/lps22hb.c b/drivers/sensor/lps22hb/lps22hb.c index bceb05c8bf5e..75140db686d2 100644 --- a/drivers/sensor/lps22hb/lps22hb.c +++ b/drivers/sensor/lps22hb/lps22hb.c @@ -6,7 +6,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include #include #include #include diff --git a/drivers/sensor/lps25hb/lps25hb.c b/drivers/sensor/lps25hb/lps25hb.c index 1603046e5a8a..de10638ebc1f 100644 --- a/drivers/sensor/lps25hb/lps25hb.c +++ b/drivers/sensor/lps25hb/lps25hb.c @@ -6,7 +6,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include #include #include #include diff --git a/drivers/sensor/lsm303dlhc_magn/lsm303dlhc_magn.c b/drivers/sensor/lsm303dlhc_magn/lsm303dlhc_magn.c index e3d74ff91ac8..02ad25d53277 100644 --- a/drivers/sensor/lsm303dlhc_magn/lsm303dlhc_magn.c +++ b/drivers/sensor/lsm303dlhc_magn/lsm303dlhc_magn.c @@ -6,7 +6,7 @@ #include #include -#include +#include #define LOG_LEVEL CONFIG_SENSOR_LOG_LEVEL #include diff --git a/drivers/sensor/lsm6ds0/lsm6ds0.c b/drivers/sensor/lsm6ds0/lsm6ds0.c index ccfeee7dafe7..34ad434665ff 100644 --- a/drivers/sensor/lsm6ds0/lsm6ds0.c +++ b/drivers/sensor/lsm6ds0/lsm6ds0.c @@ -8,7 +8,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include #include #include #include diff --git a/drivers/sensor/lsm6dsl/lsm6dsl.c b/drivers/sensor/lsm6dsl/lsm6dsl.c index 69780bd6fd08..c3d8aeeb4b88 100644 --- a/drivers/sensor/lsm6dsl/lsm6dsl.c +++ b/drivers/sensor/lsm6dsl/lsm6dsl.c @@ -8,7 +8,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include #include #include #include diff --git a/drivers/sensor/lsm6dsl/lsm6dsl.h b/drivers/sensor/lsm6dsl/lsm6dsl.h index f889cb1d4dfe..dd742889287e 100644 --- a/drivers/sensor/lsm6dsl/lsm6dsl.h +++ b/drivers/sensor/lsm6dsl/lsm6dsl.h @@ -11,7 +11,7 @@ #ifndef ZEPHYR_DRIVERS_SENSOR_LSM6DSL_LSM6DSL_H_ #define ZEPHYR_DRIVERS_SENSOR_LSM6DSL_LSM6DSL_H_ -#include +#include #include #include #include diff --git a/drivers/sensor/lsm6dsl/lsm6dsl_shub.c b/drivers/sensor/lsm6dsl/lsm6dsl_shub.c index 0d482e281f2b..86bc13ad52fb 100644 --- a/drivers/sensor/lsm6dsl/lsm6dsl_shub.c +++ b/drivers/sensor/lsm6dsl/lsm6dsl_shub.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include "lsm6dsl.h" diff --git a/drivers/sensor/lsm6dsl/lsm6dsl_trigger.c b/drivers/sensor/lsm6dsl/lsm6dsl_trigger.c index c8d476b31293..7fca299752a4 100644 --- a/drivers/sensor/lsm6dsl/lsm6dsl_trigger.c +++ b/drivers/sensor/lsm6dsl/lsm6dsl_trigger.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include "lsm6dsl.h" diff --git a/drivers/sensor/lsm9ds0_gyro/lsm9ds0_gyro.c b/drivers/sensor/lsm9ds0_gyro/lsm9ds0_gyro.c index 1d9949f3a937..8119f310817f 100644 --- a/drivers/sensor/lsm9ds0_gyro/lsm9ds0_gyro.c +++ b/drivers/sensor/lsm9ds0_gyro/lsm9ds0_gyro.c @@ -6,7 +6,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include #include #include #include diff --git a/drivers/sensor/lsm9ds0_gyro/lsm9ds0_gyro_trigger.c b/drivers/sensor/lsm9ds0_gyro/lsm9ds0_gyro_trigger.c index 22513db4ea50..1ed5da1f07d0 100644 --- a/drivers/sensor/lsm9ds0_gyro/lsm9ds0_gyro_trigger.c +++ b/drivers/sensor/lsm9ds0_gyro/lsm9ds0_gyro_trigger.c @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include #include #include #include diff --git a/drivers/sensor/lsm9ds0_mfd/lsm9ds0_mfd.c b/drivers/sensor/lsm9ds0_mfd/lsm9ds0_mfd.c index 83b0445f2665..09c5ac682ccf 100644 --- a/drivers/sensor/lsm9ds0_mfd/lsm9ds0_mfd.c +++ b/drivers/sensor/lsm9ds0_mfd/lsm9ds0_mfd.c @@ -8,7 +8,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include #include #include #include diff --git a/drivers/sensor/max30101/max30101.h b/drivers/sensor/max30101/max30101.h index f5cbdd90b0e7..954d5644d210 100644 --- a/drivers/sensor/max30101/max30101.h +++ b/drivers/sensor/max30101/max30101.h @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include #include #include diff --git a/drivers/sensor/max44009/max44009.c b/drivers/sensor/max44009/max44009.c index 4c6616d1e5cc..ead2b73d172c 100644 --- a/drivers/sensor/max44009/max44009.c +++ b/drivers/sensor/max44009/max44009.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include diff --git a/drivers/sensor/mcp9808/mcp9808.h b/drivers/sensor/mcp9808/mcp9808.h index 473661bab2ce..23f66d958d40 100644 --- a/drivers/sensor/mcp9808/mcp9808.h +++ b/drivers/sensor/mcp9808/mcp9808.h @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include diff --git a/drivers/sensor/mpu6050/mpu6050.c b/drivers/sensor/mpu6050/mpu6050.c index e620581ad4b1..f98505209790 100644 --- a/drivers/sensor/mpu6050/mpu6050.c +++ b/drivers/sensor/mpu6050/mpu6050.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include "mpu6050.h" diff --git a/drivers/sensor/mpu6050/mpu6050_trigger.c b/drivers/sensor/mpu6050/mpu6050_trigger.c index 1cb5632f91bf..4d00e3cb25d1 100644 --- a/drivers/sensor/mpu6050/mpu6050_trigger.c +++ b/drivers/sensor/mpu6050/mpu6050_trigger.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include "mpu6050.h" diff --git a/drivers/sensor/ms5837/ms5837.c b/drivers/sensor/ms5837/ms5837.c index 413ff8bfdf76..ce517ef179b1 100644 --- a/drivers/sensor/ms5837/ms5837.c +++ b/drivers/sensor/ms5837/ms5837.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include "ms5837.h" diff --git a/drivers/sensor/nrf5/temp_nrf5.c b/drivers/sensor/nrf5/temp_nrf5.c index 97f3983c22b1..eef6f1f5b998 100644 --- a/drivers/sensor/nrf5/temp_nrf5.c +++ b/drivers/sensor/nrf5/temp_nrf5.c @@ -5,7 +5,7 @@ */ #include -#include +#include #include #include diff --git a/drivers/sensor/pms7003/pms7003.c b/drivers/sensor/pms7003/pms7003.c index 9e8ad8be708f..0ede96070dfd 100644 --- a/drivers/sensor/pms7003/pms7003.c +++ b/drivers/sensor/pms7003/pms7003.c @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/sensor/qdec_nrfx/qdec_nrfx.c b/drivers/sensor/qdec_nrfx/qdec_nrfx.c index 1c35f4d97b26..905d4207215d 100644 --- a/drivers/sensor/qdec_nrfx/qdec_nrfx.c +++ b/drivers/sensor/qdec_nrfx/qdec_nrfx.c @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include #include #include diff --git a/drivers/sensor/sensor_handlers.c b/drivers/sensor/sensor_handlers.c index 763c1c168316..79bb8d6cc5f0 100644 --- a/drivers/sensor/sensor_handlers.c +++ b/drivers/sensor/sensor_handlers.c @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include #include Z_SYSCALL_HANDLER(sensor_attr_set, dev, chan, attr, val) diff --git a/drivers/sensor/sht3xd/sht3xd.c b/drivers/sensor/sht3xd/sht3xd.c index a00e9c83597b..09397b96bbda 100644 --- a/drivers/sensor/sht3xd/sht3xd.c +++ b/drivers/sensor/sht3xd/sht3xd.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/sensor/sht3xd/sht3xd_trigger.c b/drivers/sensor/sht3xd/sht3xd_trigger.c index 5d574510eb7b..f3ed2f961d97 100644 --- a/drivers/sensor/sht3xd/sht3xd_trigger.c +++ b/drivers/sensor/sht3xd/sht3xd_trigger.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include "sht3xd.h" diff --git a/drivers/sensor/sx9500/sx9500.c b/drivers/sensor/sx9500/sx9500.c index 198d9df5509f..adc1e6af787d 100644 --- a/drivers/sensor/sx9500/sx9500.c +++ b/drivers/sensor/sx9500/sx9500.c @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/sensor/sx9500/sx9500_trigger.c b/drivers/sensor/sx9500/sx9500_trigger.c index 7741a0083758..a2d047bbe3a2 100644 --- a/drivers/sensor/sx9500/sx9500_trigger.c +++ b/drivers/sensor/sx9500/sx9500_trigger.c @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include diff --git a/drivers/sensor/th02/th02.c b/drivers/sensor/th02/th02.c index 550b533aec86..4d869334f979 100644 --- a/drivers/sensor/th02/th02.c +++ b/drivers/sensor/th02/th02.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/sensor/ti_hdc/ti_hdc.c b/drivers/sensor/ti_hdc/ti_hdc.c index c9ad45d99da4..de0b5ee51e30 100644 --- a/drivers/sensor/ti_hdc/ti_hdc.c +++ b/drivers/sensor/ti_hdc/ti_hdc.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/sensor/tmp007/tmp007.c b/drivers/sensor/tmp007/tmp007.c index 47118469665e..0e69dec3750b 100644 --- a/drivers/sensor/tmp007/tmp007.c +++ b/drivers/sensor/tmp007/tmp007.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/sensor/tmp007/tmp007_trigger.c b/drivers/sensor/tmp007/tmp007_trigger.c index fabfcb9fbcd8..4dabc4f98a67 100644 --- a/drivers/sensor/tmp007/tmp007_trigger.c +++ b/drivers/sensor/tmp007/tmp007_trigger.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include "tmp007.h" diff --git a/drivers/sensor/tmp112/tmp112.c b/drivers/sensor/tmp112/tmp112.c index 73a52aed00df..3b8e1e025762 100644 --- a/drivers/sensor/tmp112/tmp112.c +++ b/drivers/sensor/tmp112/tmp112.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/sensor/vl53l0x/vl53l0x.c b/drivers/sensor/vl53l0x/vl53l0x.c index b46735d6ab93..4d1c1d7c482f 100644 --- a/drivers/sensor/vl53l0x/vl53l0x.c +++ b/drivers/sensor/vl53l0x/vl53l0x.c @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/sensor/vl53l0x/vl53l0x_platform.c b/drivers/sensor/vl53l0x/vl53l0x_platform.c index c48ad4175ee0..f88dbd093017 100644 --- a/drivers/sensor/vl53l0x/vl53l0x_platform.c +++ b/drivers/sensor/vl53l0x/vl53l0x_platform.c @@ -10,7 +10,7 @@ #include "vl53l0x_platform.h" -#include +#include #include #include #include diff --git a/include/drivers/sensor.h b/include/drivers/sensor.h new file mode 100644 index 000000000000..2b190c6beb36 --- /dev/null +++ b/include/drivers/sensor.h @@ -0,0 +1,568 @@ +/** + * @file sensor.h + * + * @brief Public APIs for the sensor driver. + */ + +/* + * Copyright (c) 2016 Intel Corporation + * + * SPDX-License-Identifier: Apache-2.0 + */ +#ifndef ZEPHYR_INCLUDE_DRIVERS_SENSOR_H_ +#define ZEPHYR_INCLUDE_DRIVERS_SENSOR_H_ + +/** + * @brief Sensor Interface + * @defgroup sensor_interface Sensor Interface + * @ingroup io_interfaces + * @{ + */ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Representation of a sensor readout value. + * + * The value is represented as having an integer and a fractional part, + * and can be obtained using the formula val1 + val2 * 10^(-6). Negative + * values also adhere to the above formula, but may need special attention. + * Here are some examples of the value representation: + * + * 0.5: val1 = 0, val2 = 500000 + * -0.5: val1 = 0, val2 = -500000 + * -1.0: val1 = -1, val2 = 0 + * -1.5: val1 = -1, val2 = -500000 + */ +struct sensor_value { + /** Integer part of the value. */ + s32_t val1; + /** Fractional part of the value (in one-millionth parts). */ + s32_t val2; +}; + +/** + * @brief Sensor channels. + */ +enum sensor_channel { + /** Acceleration on the X axis, in m/s^2. */ + SENSOR_CHAN_ACCEL_X, + /** Acceleration on the Y axis, in m/s^2. */ + SENSOR_CHAN_ACCEL_Y, + /** Acceleration on the Z axis, in m/s^2. */ + SENSOR_CHAN_ACCEL_Z, + /** Acceleration on the X, Y and Z axes. */ + SENSOR_CHAN_ACCEL_XYZ, + /** Angular velocity around the X axis, in radians/s. */ + SENSOR_CHAN_GYRO_X, + /** Angular velocity around the Y axis, in radians/s. */ + SENSOR_CHAN_GYRO_Y, + /** Angular velocity around the Z axis, in radians/s. */ + SENSOR_CHAN_GYRO_Z, + /** Angular velocity around the X, Y and Z axes. */ + SENSOR_CHAN_GYRO_XYZ, + /** Magnetic field on the X axis, in Gauss. */ + SENSOR_CHAN_MAGN_X, + /** Magnetic field on the Y axis, in Gauss. */ + SENSOR_CHAN_MAGN_Y, + /** Magnetic field on the Z axis, in Gauss. */ + SENSOR_CHAN_MAGN_Z, + /** Magnetic field on the X, Y and Z axes. */ + SENSOR_CHAN_MAGN_XYZ, + /** Device die temperature in degrees Celsius. */ + SENSOR_CHAN_DIE_TEMP, + /** Ambient temperature in degrees Celsius. */ + SENSOR_CHAN_AMBIENT_TEMP, + /** Pressure in kilopascal. */ + SENSOR_CHAN_PRESS, + /** + * Proximity. Adimensional. A value of 1 indicates that an + * object is close. + */ + SENSOR_CHAN_PROX, + /** Humidity, in percent. */ + SENSOR_CHAN_HUMIDITY, + /** Illuminance in visible spectrum, in lux. */ + SENSOR_CHAN_LIGHT, + /** Illuminance in infra-red spectrum, in lux. */ + SENSOR_CHAN_IR, + /** Illuminance in red spectrum, in lux. */ + SENSOR_CHAN_RED, + /** Illuminance in green spectrum, in lux. */ + SENSOR_CHAN_GREEN, + /** Illuminance in blue spectrum, in lux. */ + SENSOR_CHAN_BLUE, + /** Altitude, in meters */ + SENSOR_CHAN_ALTITUDE, + + /** 1.0 micro-meters Particulate Matter, in ug/m^3 */ + SENSOR_CHAN_PM_1_0, + /** 2.5 micro-meters Particulate Matter, in ug/m^3 */ + SENSOR_CHAN_PM_2_5, + /** 10 micro-meters Particulate Matter, in ug/m^3 */ + SENSOR_CHAN_PM_10, + /** Distance. From sensor to target, in meters */ + SENSOR_CHAN_DISTANCE, + + /** CO2 level, in parts per million (ppm) **/ + SENSOR_CHAN_CO2, + /** VOC level, in parts per billion (ppb) **/ + SENSOR_CHAN_VOC, + /** Gas sensor resistance in ohms. */ + SENSOR_CHAN_GAS_RES, + + /** Voltage, in volts **/ + SENSOR_CHAN_VOLTAGE, + /** Current, in amps **/ + SENSOR_CHAN_CURRENT, + /** Resistance , in Ohm **/ + SENSOR_CHAN_RESISTANCE, + + /** Angular rotation, in degrees */ + SENSOR_CHAN_ROTATION, + + /** Position change on the X axis, in points. */ + SENSOR_CHAN_POS_DX, + /** Position change on the Y axis, in points. */ + SENSOR_CHAN_POS_DY, + /** Position change on the Z axis, in points. */ + SENSOR_CHAN_POS_DZ, + + /** All channels. */ + SENSOR_CHAN_ALL, + + /** + * Number of all common sensor channels. + */ + SENSOR_CHAN_COMMON_COUNT, + + /** + * This and higher values are sensor specific. + * Refer to the sensor header file. + */ + SENSOR_CHAN_PRIV_START = SENSOR_CHAN_COMMON_COUNT, + + /** + * Maximum value describing a sensor channel type. + */ + SENSOR_CHAN_MAX = INT16_MAX, +}; + +/** + * @brief Sensor trigger types. + */ +enum sensor_trigger_type { + /** + * Timer-based trigger, useful when the sensor does not have an + * interrupt line. + */ + SENSOR_TRIG_TIMER, + /** Trigger fires whenever new data is ready. */ + SENSOR_TRIG_DATA_READY, + /** + * Trigger fires when the selected channel varies significantly. + * This includes any-motion detection when the channel is + * acceleration or gyro. If detection is based on slope between + * successive channel readings, the slope threshold is configured + * via the @ref SENSOR_ATTR_SLOPE_TH and @ref SENSOR_ATTR_SLOPE_DUR + * attributes. + */ + SENSOR_TRIG_DELTA, + /** Trigger fires when a near/far event is detected. */ + SENSOR_TRIG_NEAR_FAR, + /** + * Trigger fires when channel reading transitions configured + * thresholds. The thresholds are configured via the @ref + * SENSOR_ATTR_LOWER_THRESH and @ref SENSOR_ATTR_UPPER_THRESH + * attributes. + */ + SENSOR_TRIG_THRESHOLD, + + /** Trigger fires when a single tap is detected. */ + SENSOR_TRIG_TAP, + + /** Trigger fires when a double tap is detected. */ + SENSOR_TRIG_DOUBLE_TAP, + + /** + * Number of all common sensor triggers. + */ + SENSOR_TRIG_COMMON_COUNT, + + /** + * This and higher values are sensor specific. + * Refer to the sensor header file. + */ + SENSOR_TRIG_PRIV_START = SENSOR_TRIG_COMMON_COUNT, + + /** + * Maximum value describing a sensor trigger type. + */ + SENSOR_TRIG_MAX = INT16_MAX, +}; + +/** + * @brief Sensor trigger spec. + */ +struct sensor_trigger { + /** Trigger type. */ + enum sensor_trigger_type type; + /** Channel the trigger is set on. */ + enum sensor_channel chan; +}; + +/** + * @brief Sensor attribute types. + */ +enum sensor_attribute { + /** + * Sensor sampling frequency, i.e. how many times a second the + * sensor takes a measurement. + */ + SENSOR_ATTR_SAMPLING_FREQUENCY, + /** Lower threshold for trigger. */ + SENSOR_ATTR_LOWER_THRESH, + /** Upper threshold for trigger. */ + SENSOR_ATTR_UPPER_THRESH, + /** Threshold for any-motion (slope) trigger. */ + SENSOR_ATTR_SLOPE_TH, + /** + * Duration for which the slope values needs to be + * outside the threshold for the trigger to fire. + */ + SENSOR_ATTR_SLOPE_DUR, + /** Oversampling factor */ + SENSOR_ATTR_OVERSAMPLING, + /** Sensor range, in SI units. */ + SENSOR_ATTR_FULL_SCALE, + /** + * The sensor value returned will be altered by the amount indicated by + * offset: final_value = sensor_value + offset. + */ + SENSOR_ATTR_OFFSET, + /** + * Calibration target. This will be used by the internal chip's + * algorithms to calibrate itself on a certain axis, or all of them. + */ + SENSOR_ATTR_CALIB_TARGET, + + /** + * Number of all common sensor attributes. + */ + SENSOR_ATTR_COMMON_COUNT, + + /** + * This and higher values are sensor specific. + * Refer to the sensor header file. + */ + SENSOR_ATTR_PRIV_START = SENSOR_ATTR_COMMON_COUNT, + + /** + * Maximum value describing a sensor attribute type. + */ + SENSOR_ATTR_MAX = INT16_MAX, +}; + +/** + * @typedef sensor_trigger_handler_t + * @brief Callback API upon firing of a trigger + * + * @param "struct device *dev" Pointer to the sensor device + * @param "struct sensor_trigger *trigger" The trigger + */ +typedef void (*sensor_trigger_handler_t)(struct device *dev, + struct sensor_trigger *trigger); + +/** + * @typedef sensor_attr_set_t + * @brief Callback API upon setting a sensor's attributes + * + * See sensor_attr_set() for argument description + */ +typedef int (*sensor_attr_set_t)(struct device *dev, + enum sensor_channel chan, + enum sensor_attribute attr, + const struct sensor_value *val); +/** + * @typedef sensor_trigger_set_t + * @brief Callback API for setting a sensor's trigger and handler + * + * See sensor_trigger_set() for argument description + */ +typedef int (*sensor_trigger_set_t)(struct device *dev, + const struct sensor_trigger *trig, + sensor_trigger_handler_t handler); +/** + * @typedef sensor_sample_fetch_t + * @brief Callback API for fetching data from a sensor + * + * See sensor_sample_fetch() for argument description + */ +typedef int (*sensor_sample_fetch_t)(struct device *dev, + enum sensor_channel chan); +/** + * @typedef sensor_channel_get_t + * @brief Callback API for getting a reading from a sensor + * + * See sensor_channel_get() for argument description + */ +typedef int (*sensor_channel_get_t)(struct device *dev, + enum sensor_channel chan, + struct sensor_value *val); + +struct sensor_driver_api { + sensor_attr_set_t attr_set; + sensor_trigger_set_t trigger_set; + sensor_sample_fetch_t sample_fetch; + sensor_channel_get_t channel_get; +}; + +/** + * @brief Set an attribute for a sensor + * + * @param dev Pointer to the sensor device + * @param chan The channel the attribute belongs to, if any. Some + * attributes may only be set for all channels of a device, depending on + * device capabilities. + * @param attr The attribute to set + * @param val The value to set the attribute to + * + * @return 0 if successful, negative errno code if failure. + */ +__syscall int sensor_attr_set(struct device *dev, + enum sensor_channel chan, + enum sensor_attribute attr, + const struct sensor_value *val); + +static inline int z_impl_sensor_attr_set(struct device *dev, + enum sensor_channel chan, + enum sensor_attribute attr, + const struct sensor_value *val) +{ + const struct sensor_driver_api *api = dev->driver_api; + + if (api->attr_set == NULL) { + return -ENOTSUP; + } + + return api->attr_set(dev, chan, attr, val); +} + +/** + * @brief Activate a sensor's trigger and set the trigger handler + * + * The handler will be called from a thread, so I2C or SPI operations are + * safe. However, the thread's stack is limited and defined by the + * driver. It is currently up to the caller to ensure that the handler + * does not overflow the stack. + * + * This API is not permitted for user threads. + * + * @param dev Pointer to the sensor device + * @param trig The trigger to activate + * @param handler The function that should be called when the trigger + * fires + * + * @return 0 if successful, negative errno code if failure. + */ +static inline int sensor_trigger_set(struct device *dev, + struct sensor_trigger *trig, + sensor_trigger_handler_t handler) +{ + const struct sensor_driver_api *api = dev->driver_api; + + if (api->trigger_set == NULL) { + return -ENOTSUP; + } + + return api->trigger_set(dev, trig, handler); +} + +/** + * @brief Fetch a sample from the sensor and store it in an internal + * driver buffer + * + * Read all of a sensor's active channels and, if necessary, perform any + * additional operations necessary to make the values useful. The user + * may then get individual channel values by calling @ref + * sensor_channel_get. + * + * Since the function communicates with the sensor device, it is unsafe + * to call it in an ISR if the device is connected via I2C or SPI. + * + * @param dev Pointer to the sensor device + * + * @return 0 if successful, negative errno code if failure. + */ +__syscall int sensor_sample_fetch(struct device *dev); + +static inline int z_impl_sensor_sample_fetch(struct device *dev) +{ + const struct sensor_driver_api *api = dev->driver_api; + + return api->sample_fetch(dev, SENSOR_CHAN_ALL); +} + +/** + * @brief Fetch a sample from the sensor and store it in an internal + * driver buffer + * + * Read and compute compensation for one type of sensor data (magnetometer, + * accelerometer, etc). The user may then get individual channel values by + * calling @ref sensor_channel_get. + * + * This is mostly implemented by multi function devices enabling reading at + * different sampling rates. + * + * Since the function communicates with the sensor device, it is unsafe + * to call it in an ISR if the device is connected via I2C or SPI. + * + * @param dev Pointer to the sensor device + * @param type The channel that needs updated + * + * @return 0 if successful, negative errno code if failure. + */ +__syscall int sensor_sample_fetch_chan(struct device *dev, + enum sensor_channel type); + +static inline int z_impl_sensor_sample_fetch_chan(struct device *dev, + enum sensor_channel type) +{ + const struct sensor_driver_api *api = dev->driver_api; + + return api->sample_fetch(dev, type); +} + +/** + * @brief Get a reading from a sensor device + * + * Return a useful value for a particular channel, from the driver's + * internal data. Before calling this function, a sample must be + * obtained by calling @ref sensor_sample_fetch or + * @ref sensor_sample_fetch_chan. It is guaranteed that two subsequent + * calls of this function for the same channels will yield the same + * value, if @ref sensor_sample_fetch or @ref sensor_sample_fetch_chan + * has not been called in the meantime. + * + * For vectorial data samples you can request all axes in just one call + * by passing the specific channel with _XYZ suffix. The sample will be + * returned at val[0], val[1] and val[2] (X, Y and Z in that order). + * + * @param dev Pointer to the sensor device + * @param chan The channel to read + * @param val Where to store the value + * + * @return 0 if successful, negative errno code if failure. + */ +__syscall int sensor_channel_get(struct device *dev, + enum sensor_channel chan, + struct sensor_value *val); + +static inline int z_impl_sensor_channel_get(struct device *dev, + enum sensor_channel chan, + struct sensor_value *val) +{ + const struct sensor_driver_api *api = dev->driver_api; + + return api->channel_get(dev, chan, val); +} + +/** + * @brief The value of gravitational constant in micro m/s^2. + */ +#define SENSOR_G 9806650LL + +/** + * @brief The value of constant PI in micros. + */ +#define SENSOR_PI 3141592LL + +/** + * @brief Helper function to convert acceleration from m/s^2 to Gs + * + * @param ms2 A pointer to a sensor_value struct holding the acceleration, + * in m/s^2. + * + * @return The converted value, in Gs. + */ +static inline s32_t sensor_ms2_to_g(const struct sensor_value *ms2) +{ + s64_t micro_ms2 = ms2->val1 * 1000000LL + ms2->val2; + + if (micro_ms2 > 0) { + return (micro_ms2 + SENSOR_G / 2) / SENSOR_G; + } else { + return (micro_ms2 - SENSOR_G / 2) / SENSOR_G; + } +} + +/** + * @brief Helper function to convert acceleration from Gs to m/s^2 + * + * @param g The G value to be converted. + * @param ms2 A pointer to a sensor_value struct, where the result is stored. + */ +static inline void sensor_g_to_ms2(s32_t g, struct sensor_value *ms2) +{ + ms2->val1 = ((s64_t)g * SENSOR_G) / 1000000LL; + ms2->val2 = ((s64_t)g * SENSOR_G) % 1000000LL; +} + +/** + * @brief Helper function for converting radians to degrees. + * + * @param rad A pointer to a sensor_value struct, holding the value in radians. + * + * @return The converted value, in degrees. + */ +static inline s32_t sensor_rad_to_degrees(const struct sensor_value *rad) +{ + s64_t micro_rad_s = rad->val1 * 1000000LL + rad->val2; + + if (micro_rad_s > 0) { + return (micro_rad_s * 180LL + SENSOR_PI / 2) / SENSOR_PI; + } else { + return (micro_rad_s * 180LL - SENSOR_PI / 2) / SENSOR_PI; + } +} + +/** + * @brief Helper function for converting degrees to radians. + * + * @param d The value (in degrees) to be converted. + * @param rad A pointer to a sensor_value struct, where the result is stored. + */ +static inline void sensor_degrees_to_rad(s32_t d, struct sensor_value *rad) +{ + rad->val1 = ((s64_t)d * SENSOR_PI / 180LL) / 1000000LL; + rad->val2 = ((s64_t)d * SENSOR_PI / 180LL) % 1000000LL; +} + +/** + * @brief Helper function for converting struct sensor_value to double. + * + * @param val A pointer to a sensor_value struct. + * @return The converted value. + */ +static inline double sensor_value_to_double(struct sensor_value *val) +{ + return (double)val->val1 + (double)val->val2 / 1000000; +} + +#include + +#ifdef __cplusplus +} +#endif + +/** + * @} + */ + +#endif /* ZEPHYR_INCLUDE_DRIVERS_SENSOR_H_ */ diff --git a/include/sensor.h b/include/sensor.h index c38d146a4b10..b590a3d496b6 100644 --- a/include/sensor.h +++ b/include/sensor.h @@ -1,568 +1,15 @@ -/** - * @file sensor.h - * - * @brief Public APIs for the sensor driver. - */ - /* - * Copyright (c) 2016 Intel Corporation + * Copyright (c) 2019 Intel Corporation * * SPDX-License-Identifier: Apache-2.0 */ #ifndef ZEPHYR_INCLUDE_SENSOR_H_ #define ZEPHYR_INCLUDE_SENSOR_H_ -/** - * @brief Sensor Interface - * @defgroup sensor_interface Sensor Interface - * @ingroup io_interfaces - * @{ - */ - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { +#ifndef CONFIG_COMPAT_INCLUDES +#warning "This header file has moved, include instead." #endif -/** - * @brief Representation of a sensor readout value. - * - * The value is represented as having an integer and a fractional part, - * and can be obtained using the formula val1 + val2 * 10^(-6). Negative - * values also adhere to the above formula, but may need special attention. - * Here are some examples of the value representation: - * - * 0.5: val1 = 0, val2 = 500000 - * -0.5: val1 = 0, val2 = -500000 - * -1.0: val1 = -1, val2 = 0 - * -1.5: val1 = -1, val2 = -500000 - */ -struct sensor_value { - /** Integer part of the value. */ - s32_t val1; - /** Fractional part of the value (in one-millionth parts). */ - s32_t val2; -}; - -/** - * @brief Sensor channels. - */ -enum sensor_channel { - /** Acceleration on the X axis, in m/s^2. */ - SENSOR_CHAN_ACCEL_X, - /** Acceleration on the Y axis, in m/s^2. */ - SENSOR_CHAN_ACCEL_Y, - /** Acceleration on the Z axis, in m/s^2. */ - SENSOR_CHAN_ACCEL_Z, - /** Acceleration on the X, Y and Z axes. */ - SENSOR_CHAN_ACCEL_XYZ, - /** Angular velocity around the X axis, in radians/s. */ - SENSOR_CHAN_GYRO_X, - /** Angular velocity around the Y axis, in radians/s. */ - SENSOR_CHAN_GYRO_Y, - /** Angular velocity around the Z axis, in radians/s. */ - SENSOR_CHAN_GYRO_Z, - /** Angular velocity around the X, Y and Z axes. */ - SENSOR_CHAN_GYRO_XYZ, - /** Magnetic field on the X axis, in Gauss. */ - SENSOR_CHAN_MAGN_X, - /** Magnetic field on the Y axis, in Gauss. */ - SENSOR_CHAN_MAGN_Y, - /** Magnetic field on the Z axis, in Gauss. */ - SENSOR_CHAN_MAGN_Z, - /** Magnetic field on the X, Y and Z axes. */ - SENSOR_CHAN_MAGN_XYZ, - /** Device die temperature in degrees Celsius. */ - SENSOR_CHAN_DIE_TEMP, - /** Ambient temperature in degrees Celsius. */ - SENSOR_CHAN_AMBIENT_TEMP, - /** Pressure in kilopascal. */ - SENSOR_CHAN_PRESS, - /** - * Proximity. Adimensional. A value of 1 indicates that an - * object is close. - */ - SENSOR_CHAN_PROX, - /** Humidity, in percent. */ - SENSOR_CHAN_HUMIDITY, - /** Illuminance in visible spectrum, in lux. */ - SENSOR_CHAN_LIGHT, - /** Illuminance in infra-red spectrum, in lux. */ - SENSOR_CHAN_IR, - /** Illuminance in red spectrum, in lux. */ - SENSOR_CHAN_RED, - /** Illuminance in green spectrum, in lux. */ - SENSOR_CHAN_GREEN, - /** Illuminance in blue spectrum, in lux. */ - SENSOR_CHAN_BLUE, - /** Altitude, in meters */ - SENSOR_CHAN_ALTITUDE, - - /** 1.0 micro-meters Particulate Matter, in ug/m^3 */ - SENSOR_CHAN_PM_1_0, - /** 2.5 micro-meters Particulate Matter, in ug/m^3 */ - SENSOR_CHAN_PM_2_5, - /** 10 micro-meters Particulate Matter, in ug/m^3 */ - SENSOR_CHAN_PM_10, - /** Distance. From sensor to target, in meters */ - SENSOR_CHAN_DISTANCE, - - /** CO2 level, in parts per million (ppm) **/ - SENSOR_CHAN_CO2, - /** VOC level, in parts per billion (ppb) **/ - SENSOR_CHAN_VOC, - /** Gas sensor resistance in ohms. */ - SENSOR_CHAN_GAS_RES, - - /** Voltage, in volts **/ - SENSOR_CHAN_VOLTAGE, - /** Current, in amps **/ - SENSOR_CHAN_CURRENT, - /** Resistance , in Ohm **/ - SENSOR_CHAN_RESISTANCE, - - /** Angular rotation, in degrees */ - SENSOR_CHAN_ROTATION, - - /** Position change on the X axis, in points. */ - SENSOR_CHAN_POS_DX, - /** Position change on the Y axis, in points. */ - SENSOR_CHAN_POS_DY, - /** Position change on the Z axis, in points. */ - SENSOR_CHAN_POS_DZ, - - /** All channels. */ - SENSOR_CHAN_ALL, - - /** - * Number of all common sensor channels. - */ - SENSOR_CHAN_COMMON_COUNT, - - /** - * This and higher values are sensor specific. - * Refer to the sensor header file. - */ - SENSOR_CHAN_PRIV_START = SENSOR_CHAN_COMMON_COUNT, - - /** - * Maximum value describing a sensor channel type. - */ - SENSOR_CHAN_MAX = INT16_MAX, -}; - -/** - * @brief Sensor trigger types. - */ -enum sensor_trigger_type { - /** - * Timer-based trigger, useful when the sensor does not have an - * interrupt line. - */ - SENSOR_TRIG_TIMER, - /** Trigger fires whenever new data is ready. */ - SENSOR_TRIG_DATA_READY, - /** - * Trigger fires when the selected channel varies significantly. - * This includes any-motion detection when the channel is - * acceleration or gyro. If detection is based on slope between - * successive channel readings, the slope threshold is configured - * via the @ref SENSOR_ATTR_SLOPE_TH and @ref SENSOR_ATTR_SLOPE_DUR - * attributes. - */ - SENSOR_TRIG_DELTA, - /** Trigger fires when a near/far event is detected. */ - SENSOR_TRIG_NEAR_FAR, - /** - * Trigger fires when channel reading transitions configured - * thresholds. The thresholds are configured via the @ref - * SENSOR_ATTR_LOWER_THRESH and @ref SENSOR_ATTR_UPPER_THRESH - * attributes. - */ - SENSOR_TRIG_THRESHOLD, - - /** Trigger fires when a single tap is detected. */ - SENSOR_TRIG_TAP, - - /** Trigger fires when a double tap is detected. */ - SENSOR_TRIG_DOUBLE_TAP, - - /** - * Number of all common sensor triggers. - */ - SENSOR_TRIG_COMMON_COUNT, - - /** - * This and higher values are sensor specific. - * Refer to the sensor header file. - */ - SENSOR_TRIG_PRIV_START = SENSOR_TRIG_COMMON_COUNT, - - /** - * Maximum value describing a sensor trigger type. - */ - SENSOR_TRIG_MAX = INT16_MAX, -}; - -/** - * @brief Sensor trigger spec. - */ -struct sensor_trigger { - /** Trigger type. */ - enum sensor_trigger_type type; - /** Channel the trigger is set on. */ - enum sensor_channel chan; -}; - -/** - * @brief Sensor attribute types. - */ -enum sensor_attribute { - /** - * Sensor sampling frequency, i.e. how many times a second the - * sensor takes a measurement. - */ - SENSOR_ATTR_SAMPLING_FREQUENCY, - /** Lower threshold for trigger. */ - SENSOR_ATTR_LOWER_THRESH, - /** Upper threshold for trigger. */ - SENSOR_ATTR_UPPER_THRESH, - /** Threshold for any-motion (slope) trigger. */ - SENSOR_ATTR_SLOPE_TH, - /** - * Duration for which the slope values needs to be - * outside the threshold for the trigger to fire. - */ - SENSOR_ATTR_SLOPE_DUR, - /** Oversampling factor */ - SENSOR_ATTR_OVERSAMPLING, - /** Sensor range, in SI units. */ - SENSOR_ATTR_FULL_SCALE, - /** - * The sensor value returned will be altered by the amount indicated by - * offset: final_value = sensor_value + offset. - */ - SENSOR_ATTR_OFFSET, - /** - * Calibration target. This will be used by the internal chip's - * algorithms to calibrate itself on a certain axis, or all of them. - */ - SENSOR_ATTR_CALIB_TARGET, - - /** - * Number of all common sensor attributes. - */ - SENSOR_ATTR_COMMON_COUNT, - - /** - * This and higher values are sensor specific. - * Refer to the sensor header file. - */ - SENSOR_ATTR_PRIV_START = SENSOR_ATTR_COMMON_COUNT, - - /** - * Maximum value describing a sensor attribute type. - */ - SENSOR_ATTR_MAX = INT16_MAX, -}; - -/** - * @typedef sensor_trigger_handler_t - * @brief Callback API upon firing of a trigger - * - * @param "struct device *dev" Pointer to the sensor device - * @param "struct sensor_trigger *trigger" The trigger - */ -typedef void (*sensor_trigger_handler_t)(struct device *dev, - struct sensor_trigger *trigger); - -/** - * @typedef sensor_attr_set_t - * @brief Callback API upon setting a sensor's attributes - * - * See sensor_attr_set() for argument description - */ -typedef int (*sensor_attr_set_t)(struct device *dev, - enum sensor_channel chan, - enum sensor_attribute attr, - const struct sensor_value *val); -/** - * @typedef sensor_trigger_set_t - * @brief Callback API for setting a sensor's trigger and handler - * - * See sensor_trigger_set() for argument description - */ -typedef int (*sensor_trigger_set_t)(struct device *dev, - const struct sensor_trigger *trig, - sensor_trigger_handler_t handler); -/** - * @typedef sensor_sample_fetch_t - * @brief Callback API for fetching data from a sensor - * - * See sensor_sample_fetch() for argument description - */ -typedef int (*sensor_sample_fetch_t)(struct device *dev, - enum sensor_channel chan); -/** - * @typedef sensor_channel_get_t - * @brief Callback API for getting a reading from a sensor - * - * See sensor_channel_get() for argument description - */ -typedef int (*sensor_channel_get_t)(struct device *dev, - enum sensor_channel chan, - struct sensor_value *val); - -struct sensor_driver_api { - sensor_attr_set_t attr_set; - sensor_trigger_set_t trigger_set; - sensor_sample_fetch_t sample_fetch; - sensor_channel_get_t channel_get; -}; - -/** - * @brief Set an attribute for a sensor - * - * @param dev Pointer to the sensor device - * @param chan The channel the attribute belongs to, if any. Some - * attributes may only be set for all channels of a device, depending on - * device capabilities. - * @param attr The attribute to set - * @param val The value to set the attribute to - * - * @return 0 if successful, negative errno code if failure. - */ -__syscall int sensor_attr_set(struct device *dev, - enum sensor_channel chan, - enum sensor_attribute attr, - const struct sensor_value *val); - -static inline int z_impl_sensor_attr_set(struct device *dev, - enum sensor_channel chan, - enum sensor_attribute attr, - const struct sensor_value *val) -{ - const struct sensor_driver_api *api = dev->driver_api; - - if (api->attr_set == NULL) { - return -ENOTSUP; - } - - return api->attr_set(dev, chan, attr, val); -} - -/** - * @brief Activate a sensor's trigger and set the trigger handler - * - * The handler will be called from a thread, so I2C or SPI operations are - * safe. However, the thread's stack is limited and defined by the - * driver. It is currently up to the caller to ensure that the handler - * does not overflow the stack. - * - * This API is not permitted for user threads. - * - * @param dev Pointer to the sensor device - * @param trig The trigger to activate - * @param handler The function that should be called when the trigger - * fires - * - * @return 0 if successful, negative errno code if failure. - */ -static inline int sensor_trigger_set(struct device *dev, - struct sensor_trigger *trig, - sensor_trigger_handler_t handler) -{ - const struct sensor_driver_api *api = dev->driver_api; - - if (api->trigger_set == NULL) { - return -ENOTSUP; - } - - return api->trigger_set(dev, trig, handler); -} - -/** - * @brief Fetch a sample from the sensor and store it in an internal - * driver buffer - * - * Read all of a sensor's active channels and, if necessary, perform any - * additional operations necessary to make the values useful. The user - * may then get individual channel values by calling @ref - * sensor_channel_get. - * - * Since the function communicates with the sensor device, it is unsafe - * to call it in an ISR if the device is connected via I2C or SPI. - * - * @param dev Pointer to the sensor device - * - * @return 0 if successful, negative errno code if failure. - */ -__syscall int sensor_sample_fetch(struct device *dev); - -static inline int z_impl_sensor_sample_fetch(struct device *dev) -{ - const struct sensor_driver_api *api = dev->driver_api; - - return api->sample_fetch(dev, SENSOR_CHAN_ALL); -} - -/** - * @brief Fetch a sample from the sensor and store it in an internal - * driver buffer - * - * Read and compute compensation for one type of sensor data (magnetometer, - * accelerometer, etc). The user may then get individual channel values by - * calling @ref sensor_channel_get. - * - * This is mostly implemented by multi function devices enabling reading at - * different sampling rates. - * - * Since the function communicates with the sensor device, it is unsafe - * to call it in an ISR if the device is connected via I2C or SPI. - * - * @param dev Pointer to the sensor device - * @param type The channel that needs updated - * - * @return 0 if successful, negative errno code if failure. - */ -__syscall int sensor_sample_fetch_chan(struct device *dev, - enum sensor_channel type); - -static inline int z_impl_sensor_sample_fetch_chan(struct device *dev, - enum sensor_channel type) -{ - const struct sensor_driver_api *api = dev->driver_api; - - return api->sample_fetch(dev, type); -} - -/** - * @brief Get a reading from a sensor device - * - * Return a useful value for a particular channel, from the driver's - * internal data. Before calling this function, a sample must be - * obtained by calling @ref sensor_sample_fetch or - * @ref sensor_sample_fetch_chan. It is guaranteed that two subsequent - * calls of this function for the same channels will yield the same - * value, if @ref sensor_sample_fetch or @ref sensor_sample_fetch_chan - * has not been called in the meantime. - * - * For vectorial data samples you can request all axes in just one call - * by passing the specific channel with _XYZ suffix. The sample will be - * returned at val[0], val[1] and val[2] (X, Y and Z in that order). - * - * @param dev Pointer to the sensor device - * @param chan The channel to read - * @param val Where to store the value - * - * @return 0 if successful, negative errno code if failure. - */ -__syscall int sensor_channel_get(struct device *dev, - enum sensor_channel chan, - struct sensor_value *val); - -static inline int z_impl_sensor_channel_get(struct device *dev, - enum sensor_channel chan, - struct sensor_value *val) -{ - const struct sensor_driver_api *api = dev->driver_api; - - return api->channel_get(dev, chan, val); -} - -/** - * @brief The value of gravitational constant in micro m/s^2. - */ -#define SENSOR_G 9806650LL - -/** - * @brief The value of constant PI in micros. - */ -#define SENSOR_PI 3141592LL - -/** - * @brief Helper function to convert acceleration from m/s^2 to Gs - * - * @param ms2 A pointer to a sensor_value struct holding the acceleration, - * in m/s^2. - * - * @return The converted value, in Gs. - */ -static inline s32_t sensor_ms2_to_g(const struct sensor_value *ms2) -{ - s64_t micro_ms2 = ms2->val1 * 1000000LL + ms2->val2; - - if (micro_ms2 > 0) { - return (micro_ms2 + SENSOR_G / 2) / SENSOR_G; - } else { - return (micro_ms2 - SENSOR_G / 2) / SENSOR_G; - } -} - -/** - * @brief Helper function to convert acceleration from Gs to m/s^2 - * - * @param g The G value to be converted. - * @param ms2 A pointer to a sensor_value struct, where the result is stored. - */ -static inline void sensor_g_to_ms2(s32_t g, struct sensor_value *ms2) -{ - ms2->val1 = ((s64_t)g * SENSOR_G) / 1000000LL; - ms2->val2 = ((s64_t)g * SENSOR_G) % 1000000LL; -} - -/** - * @brief Helper function for converting radians to degrees. - * - * @param rad A pointer to a sensor_value struct, holding the value in radians. - * - * @return The converted value, in degrees. - */ -static inline s32_t sensor_rad_to_degrees(const struct sensor_value *rad) -{ - s64_t micro_rad_s = rad->val1 * 1000000LL + rad->val2; - - if (micro_rad_s > 0) { - return (micro_rad_s * 180LL + SENSOR_PI / 2) / SENSOR_PI; - } else { - return (micro_rad_s * 180LL - SENSOR_PI / 2) / SENSOR_PI; - } -} - -/** - * @brief Helper function for converting degrees to radians. - * - * @param d The value (in degrees) to be converted. - * @param rad A pointer to a sensor_value struct, where the result is stored. - */ -static inline void sensor_degrees_to_rad(s32_t d, struct sensor_value *rad) -{ - rad->val1 = ((s64_t)d * SENSOR_PI / 180LL) / 1000000LL; - rad->val2 = ((s64_t)d * SENSOR_PI / 180LL) % 1000000LL; -} - -/** - * @brief Helper function for converting struct sensor_value to double. - * - * @param val A pointer to a sensor_value struct. - * @return The converted value. - */ -static inline double sensor_value_to_double(struct sensor_value *val) -{ - return (double)val->val1 + (double)val->val2 / 1000000; -} - -#include - -#ifdef __cplusplus -} -#endif - -/** - * @} - */ +#include #endif /* ZEPHYR_INCLUDE_SENSOR_H_ */ diff --git a/samples/boards/96b_argonkey/sensors/src/main.c b/samples/boards/96b_argonkey/sensors/src/main.c index af13a6412593..d2ed36e3785c 100644 --- a/samples/boards/96b_argonkey/sensors/src/main.c +++ b/samples/boards/96b_argonkey/sensors/src/main.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include diff --git a/samples/boards/arduino_101/environmental_sensing/ap/src/main.c b/samples/boards/arduino_101/environmental_sensing/ap/src/main.c index 56a4e0678f1d..b0c71297dc4e 100644 --- a/samples/boards/arduino_101/environmental_sensing/ap/src/main.c +++ b/samples/boards/arduino_101/environmental_sensing/ap/src/main.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #define TEMPERATURE_CUD "Temperature" diff --git a/samples/boards/arduino_101/environmental_sensing/sensor/src/main.c b/samples/boards/arduino_101/environmental_sensing/sensor/src/main.c index 3525ae0c52b0..f78f173900f8 100644 --- a/samples/boards/arduino_101/environmental_sensing/sensor/src/main.c +++ b/samples/boards/arduino_101/environmental_sensing/sensor/src/main.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #ifdef CONFIG_GROVE_LCD_RGB diff --git a/samples/boards/reel_board/mesh_badge/src/main.c b/samples/boards/reel_board/mesh_badge/src/main.c index febc8f4af110..c21255f74346 100644 --- a/samples/boards/reel_board/mesh_badge/src/main.c +++ b/samples/boards/reel_board/mesh_badge/src/main.c @@ -13,7 +13,7 @@ #include #include -#include +#include #include "mesh.h" #include "board.h" diff --git a/samples/boards/reel_board/mesh_badge/src/mesh.c b/samples/boards/reel_board/mesh_badge/src/mesh.c index e7e2b9128e02..1748c2e646d7 100644 --- a/samples/boards/reel_board/mesh_badge/src/mesh.c +++ b/samples/boards/reel_board/mesh_badge/src/mesh.c @@ -12,7 +12,7 @@ #include #include -#include +#include #include "mesh.h" #include "board.h" diff --git a/samples/boards/reel_board/mesh_badge/src/periphs.c b/samples/boards/reel_board/mesh_badge/src/periphs.c index 400c2cb9b237..6179eadd24f0 100644 --- a/samples/boards/reel_board/mesh_badge/src/periphs.c +++ b/samples/boards/reel_board/mesh_badge/src/periphs.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include "board.h" #include "mesh.h" diff --git a/samples/boards/reel_board/mesh_badge/src/reel_board.c b/samples/boards/reel_board/mesh_badge/src/reel_board.c index 88800e714bd6..aaa90b39a309 100644 --- a/samples/boards/reel_board/mesh_badge/src/reel_board.c +++ b/samples/boards/reel_board/mesh_badge/src/reel_board.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include diff --git a/samples/net/lwm2m_client/src/lwm2m-client.c b/samples/net/lwm2m_client/src/lwm2m-client.c index 4f521bc609da..d1708d81f3d3 100644 --- a/samples/net/lwm2m_client/src/lwm2m-client.c +++ b/samples/net/lwm2m_client/src/lwm2m-client.c @@ -13,7 +13,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME); #include #include -#include +#include #include #define APP_BANNER "Run LWM2M client" diff --git a/samples/sensor/adt7420/src/main.c b/samples/sensor/adt7420/src/main.c index ea5a6a6abb70..2705a424d34e 100644 --- a/samples/sensor/adt7420/src/main.c +++ b/samples/sensor/adt7420/src/main.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include diff --git a/samples/sensor/adxl362/src/main.c b/samples/sensor/adxl362/src/main.c index fe141ade6d3e..746ba634e70b 100644 --- a/samples/sensor/adxl362/src/main.c +++ b/samples/sensor/adxl362/src/main.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include K_SEM_DEFINE(sem, 0, 1); diff --git a/samples/sensor/adxl372/src/main.c b/samples/sensor/adxl372/src/main.c index 80ae741a947b..74cad1ea7176 100644 --- a/samples/sensor/adxl372/src/main.c +++ b/samples/sensor/adxl372/src/main.c @@ -5,7 +5,7 @@ */ #include -#include +#include #include #define pow2(x) ((x) * (x)) diff --git a/samples/sensor/amg88xx/src/main.c b/samples/sensor/amg88xx/src/main.c index d3dcf893167e..58814f340851 100644 --- a/samples/sensor/amg88xx/src/main.c +++ b/samples/sensor/amg88xx/src/main.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include static struct sensor_value temp_value[64]; diff --git a/samples/sensor/ams_iAQcore/src/main.c b/samples/sensor/ams_iAQcore/src/main.c index c852fa24914e..278a02d3fa7d 100644 --- a/samples/sensor/ams_iAQcore/src/main.c +++ b/samples/sensor/ams_iAQcore/src/main.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include void main(void) diff --git a/samples/sensor/apds9960/src/main.c b/samples/sensor/apds9960/src/main.c index 1bb962eba28e..98e9beb0a713 100644 --- a/samples/sensor/apds9960/src/main.c +++ b/samples/sensor/apds9960/src/main.c @@ -6,7 +6,7 @@ */ #include -#include +#include #include #include #include diff --git a/samples/sensor/bme280/src/main.c b/samples/sensor/bme280/src/main.c index 934b54fd3800..09adec7db258 100644 --- a/samples/sensor/bme280/src/main.c +++ b/samples/sensor/bme280/src/main.c @@ -6,7 +6,7 @@ #include #include -#include +#include void main(void) { diff --git a/samples/sensor/bme680/src/main.c b/samples/sensor/bme680/src/main.c index bb796c65168f..ac0582811ce1 100644 --- a/samples/sensor/bme680/src/main.c +++ b/samples/sensor/bme680/src/main.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include void main(void) diff --git a/samples/sensor/bmg160/src/main.c b/samples/sensor/bmg160/src/main.c index 43cdb1556247..ba1113462c12 100644 --- a/samples/sensor/bmg160/src/main.c +++ b/samples/sensor/bmg160/src/main.c @@ -11,7 +11,7 @@ #include #include -#include +#include #include #define MAX_TEST_TIME 15000 diff --git a/samples/sensor/bmi160/src/bmi160.c b/samples/sensor/bmi160/src/bmi160.c index de5a527fca3e..edda35ebf047 100644 --- a/samples/sensor/bmi160/src/bmi160.c +++ b/samples/sensor/bmi160/src/bmi160.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #define MAX_TEST_TIME 15000 diff --git a/samples/sensor/bmm150/src/main.c b/samples/sensor/bmm150/src/main.c index 62e73c2394ef..20e5ce6a2a55 100644 --- a/samples/sensor/bmm150/src/main.c +++ b/samples/sensor/bmm150/src/main.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include void do_main(struct device *dev) diff --git a/samples/sensor/ccs811/src/main.c b/samples/sensor/ccs811/src/main.c index e80af7ef73e8..ad0e04c4887d 100644 --- a/samples/sensor/ccs811/src/main.c +++ b/samples/sensor/ccs811/src/main.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include static void do_main(struct device *dev) diff --git a/samples/sensor/ens210/src/main.c b/samples/sensor/ens210/src/main.c index 582f3996f046..e180ce3db709 100644 --- a/samples/sensor/ens210/src/main.c +++ b/samples/sensor/ens210/src/main.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include void main(void) diff --git a/samples/sensor/fxas21002/src/main.c b/samples/sensor/fxas21002/src/main.c index 8d5bbd37e3c3..8704e9ee8358 100644 --- a/samples/sensor/fxas21002/src/main.c +++ b/samples/sensor/fxas21002/src/main.c @@ -5,7 +5,7 @@ */ #include -#include +#include #include K_SEM_DEFINE(sem, 0, 1); /* starts off "not available" */ diff --git a/samples/sensor/fxos8700-hid/src/main.c b/samples/sensor/fxos8700-hid/src/main.c index 6485d464d705..6630045a58c0 100644 --- a/samples/sensor/fxos8700-hid/src/main.c +++ b/samples/sensor/fxos8700-hid/src/main.c @@ -53,7 +53,7 @@ LOG_MODULE_REGISTER(main); #define LED LED0_GPIO_PIN #ifdef CONFIG_FXOS8700 -#include +#include #define SENSOR_ACCEL_NAME DT_INST_0_NXP_FXOS8700_LABEL #endif diff --git a/samples/sensor/fxos8700/src/main.c b/samples/sensor/fxos8700/src/main.c index b3eec471a1e1..d724b45041a4 100644 --- a/samples/sensor/fxos8700/src/main.c +++ b/samples/sensor/fxos8700/src/main.c @@ -6,7 +6,7 @@ */ #include -#include +#include #include K_SEM_DEFINE(sem, 0, 1); /* starts off "not available" */ diff --git a/samples/sensor/grove_light/src/main.c b/samples/sensor/grove_light/src/main.c index e10b42b6f645..d572e7c7540f 100644 --- a/samples/sensor/grove_light/src/main.c +++ b/samples/sensor/grove_light/src/main.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #define SLEEP_TIME 1000 diff --git a/samples/sensor/grove_temperature/src/main.c b/samples/sensor/grove_temperature/src/main.c index a71b7a056719..e411dd96ca95 100644 --- a/samples/sensor/grove_temperature/src/main.c +++ b/samples/sensor/grove_temperature/src/main.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include #ifdef CONFIG_GROVE_LCD_RGB #include diff --git a/samples/sensor/hts221/src/main.c b/samples/sensor/hts221/src/main.c index effda9c44089..af59c3768bbc 100644 --- a/samples/sensor/hts221/src/main.c +++ b/samples/sensor/hts221/src/main.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include diff --git a/samples/sensor/lsm303dlhc/src/main.c b/samples/sensor/lsm303dlhc/src/main.c index 5d7a0c11709e..961342e79791 100644 --- a/samples/sensor/lsm303dlhc/src/main.c +++ b/samples/sensor/lsm303dlhc/src/main.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include diff --git a/samples/sensor/lsm6dsl/src/main.c b/samples/sensor/lsm6dsl/src/main.c index b5d7d761fd3d..eadf63b3b626 100644 --- a/samples/sensor/lsm6dsl/src/main.c +++ b/samples/sensor/lsm6dsl/src/main.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include diff --git a/samples/sensor/magn_polling/src/main.c b/samples/sensor/magn_polling/src/main.c index 61a25ff08b59..2af2cc9ca902 100644 --- a/samples/sensor/magn_polling/src/main.c +++ b/samples/sensor/magn_polling/src/main.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include diff --git a/samples/sensor/max30101/src/main.c b/samples/sensor/max30101/src/main.c index 3a84451ec051..ba11edf3896a 100644 --- a/samples/sensor/max30101/src/main.c +++ b/samples/sensor/max30101/src/main.c @@ -5,7 +5,7 @@ */ #include -#include +#include #include void main(void) diff --git a/samples/sensor/max44009/src/main.c b/samples/sensor/max44009/src/main.c index 452dae811af4..57f27671b2d7 100644 --- a/samples/sensor/max44009/src/main.c +++ b/samples/sensor/max44009/src/main.c @@ -6,7 +6,7 @@ #include #include -#include +#include /** * @file Sample app using the MAX44009 light sensor through ARC I2C. diff --git a/samples/sensor/mcp9808/src/main.c b/samples/sensor/mcp9808/src/main.c index 29d4d97c87d6..24912c3d32be 100644 --- a/samples/sensor/mcp9808/src/main.c +++ b/samples/sensor/mcp9808/src/main.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #ifdef CONFIG_MCP9808_TRIGGER diff --git a/samples/sensor/ms5837/src/main.c b/samples/sensor/ms5837/src/main.c index 7c9dfa349c77..da79e89d914b 100644 --- a/samples/sensor/ms5837/src/main.c +++ b/samples/sensor/ms5837/src/main.c @@ -5,7 +5,7 @@ */ #include -#include +#include #include #include diff --git a/samples/sensor/sht3xd/src/main.c b/samples/sensor/sht3xd/src/main.c index 3acc56b08931..cd06df301aa5 100644 --- a/samples/sensor/sht3xd/src/main.c +++ b/samples/sensor/sht3xd/src/main.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #define ALERT_HUMIDITY 40 diff --git a/samples/sensor/sx9500/src/main.c b/samples/sensor/sx9500/src/main.c index ec690cb8fb37..dec70cee151a 100644 --- a/samples/sensor/sx9500/src/main.c +++ b/samples/sensor/sx9500/src/main.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #ifdef CONFIG_SX9500_TRIGGER diff --git a/samples/sensor/th02/src/main.c b/samples/sensor/th02/src/main.c index aaad456a1192..40aa99e181bc 100644 --- a/samples/sensor/th02/src/main.c +++ b/samples/sensor/th02/src/main.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include diff --git a/samples/sensor/thermometer/src/main.c b/samples/sensor/thermometer/src/main.c index 0a4feb798a95..2b3cc38e6db9 100644 --- a/samples/sensor/thermometer/src/main.c +++ b/samples/sensor/thermometer/src/main.c @@ -5,7 +5,7 @@ */ #include -#include +#include #include void main(void) diff --git a/samples/sensor/ti_hdc/src/main.c b/samples/sensor/ti_hdc/src/main.c index 2734b402d2bd..b39fd2b5d93c 100644 --- a/samples/sensor/ti_hdc/src/main.c +++ b/samples/sensor/ti_hdc/src/main.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include diff --git a/samples/sensor/tmp112/src/main.c b/samples/sensor/tmp112/src/main.c index e40408f4f2ae..09b7b158829b 100644 --- a/samples/sensor/tmp112/src/main.c +++ b/samples/sensor/tmp112/src/main.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include diff --git a/samples/sensor/vl53l0x/src/main.c b/samples/sensor/vl53l0x/src/main.c index 71e1f30dea0f..5c6f30a2717f 100644 --- a/samples/sensor/vl53l0x/src/main.c +++ b/samples/sensor/vl53l0x/src/main.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include diff --git a/samples/shields/x_nucleo_iks01a1/src/main.c b/samples/shields/x_nucleo_iks01a1/src/main.c index dc84a2793370..e6441adb543b 100644 --- a/samples/shields/x_nucleo_iks01a1/src/main.c +++ b/samples/shields/x_nucleo_iks01a1/src/main.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include diff --git a/samples/shields/x_nucleo_iks01a2/src/main.c b/samples/shields/x_nucleo_iks01a2/src/main.c index 7274b0402547..a3e34f340162 100644 --- a/samples/shields/x_nucleo_iks01a2/src/main.c +++ b/samples/shields/x_nucleo_iks01a2/src/main.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include