drivers/sensors: fix various coding style issues

fix various coding style issues for drivers/sensors:

- remove redundant `#define CONFIG_XXX` that should be provided from Kconfig
- correct section banners
- remove empty section banners
- fix some function banners

Signed-off-by: raiden00pl <raiden00@railab.me>
This commit is contained in:
raiden00pl 2025-05-22 16:10:12 +02:00 committed by Alan C. Assis
parent 442bc1c041
commit d68476796a
78 changed files with 128 additions and 353 deletions

View file

@ -143,6 +143,11 @@ config SENSORS_AS726X
---help---
Enable driver support for the AS726X Spectral Sensor.
config AS726X_I2C_FREQUENCY
int "AS726X I2C frequency"
default 100000
depends on SENSORS_AS726X
config SENSORS_BH1749NUC
bool "Rohm BH1749NUC Color Sensor support"
default n
@ -201,6 +206,20 @@ config SENSORS_NAU7802
---help---
Enable driver support for the Adafruit NAU7802 sensor.
if SENSORS_NAU7802
config NAU7802_I2C_FREQUENCY
int "NAU7802 I2C frequency"
default 100000
config SENSORS_NAU7802_THREAD_STACKSIZE
int "NAU7802 worker thread stack size"
default 1024
---help---
The stack size for the worker threads that perform measurements.
endif # SENSORS_NAU7802
config BH1750FVI_I2C_FREQUENCY
int "BH1750FVI I2C frequency"
default 400000
@ -979,6 +998,11 @@ config SENSORS_MSA301
---help---
Enable driver support for the MSA301.
config MSA301_I2C_FREQUENCY
int "MSA301 I2C frequency"
default 400000
depends on SENSORS_MSA301
config LSM9DS1_I2C_FREQUENCY
int "LSM9DS1 I2C frequency"
default 400000
@ -1587,7 +1611,7 @@ config SENSORS_LIS2MDL
if SENSORS_LIS2MDL
config SENSORS_LIS2MDL_FREQUENCY
config SENSORS_LIS2MDL_I2C_FREQUENCY
int "LIS2MDL I2C frequency"
default 1000000
range 1 3400000
@ -1737,14 +1761,12 @@ config SENSORS_AHT10
---help---
Enable driver support for the ASAIR AHT10 temperature and humidity sensors.
if SENSORS_AHT10
config AHT10_I2C_FREQUENCY
int "AHT10 I2C frequency"
depends on SENSORS_AHT10
default 400000
range 1 400000
endif # SENSORS_AHT10
config SENSORS_SHT21
bool "Sensirion SHT21 temperature and humidity sensor"
default n
@ -1938,6 +1960,11 @@ config SENSORS_ADT7320
---help---
Enables support for the ADT7320 Driver
config ADT7320_SPI_FREQUENCY
int "ADT7320 SPI frequency"
depends on SENSORS_ADT7320
default 1000000
config SENSORS_HDC1008
bool "TI HDC1008 temperature and humidity sensor"
default n

View file

@ -46,10 +46,6 @@
* Pre-processor Definitions
****************************************************************************/
#ifndef CONFIG_ADT7320_SPI_FREQUENCY
# define CONFIG_ADT7320_SPI_FREQUENCY 1000000
#endif
#define ADT7320_SPI_MODE (SPIDEV_MODE3) /* SPI Mode 3: CPOL=1,CPHA=1 */
/* Centigrade to Fahrenheit conversion: F = 9*C/5 + 32 */
@ -58,7 +54,7 @@
#define B16_32 (32 * 65536)
/****************************************************************************
* Private
* Private Types
****************************************************************************/
struct adt7320_dev_s

View file

@ -42,11 +42,7 @@
#if defined(CONFIG_SENSORS_ADXL345)
/****************************************************************************
* Private Types
****************************************************************************/
/****************************************************************************
* Private Functions
* Private Functions Prototypes
****************************************************************************/
/* Character driver methods */

View file

@ -47,7 +47,7 @@
#define ADXL372_INITIAL_CR_SIZE 7
/****************************************************************************
* Private structure definitions
* Private Types
****************************************************************************/
struct sensor_data_s

View file

@ -44,10 +44,6 @@
* Pre-processor Definitions
****************************************************************************/
#ifndef CONFIG_AHT10_I2C_FREQUENCY
# define CONFIG_AHT10_I2C_FREQUENCY 400000
#endif
/* I2C command bytes */
#define AHT10_SOFT_INIT 0xe1
@ -56,7 +52,7 @@
#define AHT10_NORMAL_CMD 0xa8
/****************************************************************************
* Private
* Private Types
****************************************************************************/
struct aht10_dev_s

View file

@ -129,7 +129,7 @@ do { \
((low & 0xff) | ((high << 8) & ~0xff))
/****************************************************************************
* Private Type Definitions
* Private Types
****************************************************************************/
/* Structure for compensating data. */

View file

@ -195,6 +195,7 @@ static const struct file_operations g_amg88xx_fops =
* Write to an amg88xx register transaction pattern:
* Write COMMAND at REGISTER
* Sensor Address / W - Register Address - Command
*
****************************************************************************/
static inline int amg88xx_i2c_write_addr(FAR struct amg88xx_dev_s *priv,
@ -230,6 +231,7 @@ static inline int amg88xx_i2c_write_addr(FAR struct amg88xx_dev_s *priv,
* Read to an amg88xx register transaction pattern:
* Read COMMAND from REGISTER
* Sensor Address / W - Register Address - Sensor Address / R - Command
*
****************************************************************************/
static inline int amg88xx_i2c_read_addr(FAR struct amg88xx_dev_s *priv,

View file

@ -49,18 +49,6 @@
* Pre-process Definitions
****************************************************************************/
#ifndef CONFIG_APDS9922_I2C_FREQUENCY
# define CONFIG_APDS9922_I2C_FREQUENCY 400000
#endif
#ifndef CONFIG_APDS9922_ALS_NPOLLWAITERS
# define CONFIG_APDS9922_ALS_NPOLLWAITERS 2
#endif
#ifndef CONFIG_APDS9922_PS_NPOLLWAITERS
# define CONFIG_APDS9922_PS_NPOLLWAITERS 2
#endif
/* Helper macros */
#ifdef CONFIG_ENDIAN_BIG

View file

@ -48,14 +48,6 @@
#if defined(CONFIG_I2C) && defined(CONFIG_SENSORS_APDS9960)
/****************************************************************************
* Pre-process Definitions
****************************************************************************/
#ifndef CONFIG_APDS9960_I2C_FREQUENCY
# define CONFIG_APDS9960_I2C_FREQUENCY 400000
#endif
/****************************************************************************
* Private Types
****************************************************************************/

View file

@ -60,10 +60,6 @@
* Pre-process Definitions
****************************************************************************/
#ifndef CONFIG_AS726X_I2C_FREQUENCY
# define CONFIG_AS726X_I2C_FREQUENCY 100000
#endif
#define AS726X_INTEGRATION_TIME 50
#define AS726X_GAIN 0b01 /* Set gain to 64x */
#define AS726X_MEASURMENT_MODE 0b10 /* One-shot reading of VBGYOR or RSTUVW */

View file

@ -28,10 +28,6 @@
#include "bh1749nuc_base.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/

View file

@ -37,15 +37,7 @@
#include "bh1749nuc_base.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private Type Definitions
* Private Types
****************************************************************************/
enum bh1749nuc_idx_e

View file

@ -41,14 +41,6 @@
#if defined(CONFIG_I2C) && defined(CONFIG_SENSORS_BH1750FVI)
/****************************************************************************
* Pre-process Definitions
****************************************************************************/
#ifndef CONFIG_BH1750FVI_I2C_FREQUENCY
# define CONFIG_BH1750FVI_I2C_FREQUENCY 400000
#endif
/****************************************************************************
* Private Types
****************************************************************************/

View file

@ -270,7 +270,7 @@ const float const_array2[16] =
((type) >= BME680_OS_SKIPPED && (type) <= BME680_OS_16X)
/****************************************************************************
* Private Type Definitions
* Private Types
****************************************************************************/
struct bme680_data_s

View file

@ -218,7 +218,7 @@
((type) >= BME688_OS_SKIPPED && (type) <= BME688_OS_16X)
/****************************************************************************
* Private Type Definitions
* Private Types
****************************************************************************/
struct bme688_data_s

View file

@ -42,7 +42,7 @@
#if defined(CONFIG_SPI) && defined(CONFIG_SENSORS_BMG160)
/****************************************************************************
* Private
* Private Types
****************************************************************************/
struct bmg160_sensor_data_s

View file

@ -30,10 +30,6 @@
#if defined(CONFIG_SENSORS_BMI088)
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private Types
****************************************************************************/

View file

@ -28,14 +28,6 @@
#if defined(CONFIG_SENSORS_BMI088)
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private Types
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
@ -59,10 +51,6 @@ static void bmi088_configspi(FAR struct spi_dev_s *spi)
}
#endif
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/

View file

@ -28,14 +28,6 @@
#if defined(CONFIG_SENSORS_BMI160)
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private Types
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/

View file

@ -28,14 +28,6 @@
#if defined(CONFIG_SENSORS_BMI160)
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private Types
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/

View file

@ -108,7 +108,7 @@
#define INTCFG_EN_Z (1 << 5)
/****************************************************************************
* Private Type Definitions
* Private Types
****************************************************************************/
struct bmm150_trim_s

View file

@ -30,14 +30,6 @@
#if defined(CONFIG_I2C) && defined(CONFIG_SENSORS_BMP180)
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private Type Definitions
****************************************************************************/
/****************************************************************************
* Private Function Prototypes
****************************************************************************/

View file

@ -20,8 +20,6 @@
*
****************************************************************************/
/* Character driver for the Freescale BMP1801 Barometer Sensor */
/****************************************************************************
* Included Files
****************************************************************************/
@ -31,23 +29,7 @@
#if defined(CONFIG_I2C) && defined(CONFIG_SENSORS_BMP180)
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private Type Definitions
****************************************************************************/
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
* Public Functions
****************************************************************************/
/****************************************************************************

View file

@ -94,7 +94,7 @@
#define CURRENT_OSS (BMP180_OVERSAMPLE8X)
/****************************************************************************
* Private Type Definitions
* Private Type
****************************************************************************/
struct bmp180_dev_s

View file

@ -40,7 +40,7 @@
#define BMP180_MIN_INTERVAL 30000
/****************************************************************************
* Private Type Definitions
* Private Type
****************************************************************************/
struct bmp180_dev_uorb_s
@ -52,6 +52,7 @@ struct bmp180_dev_uorb_s
uint32_t interval; /* Sensor acquisition interval. */
struct bmp180_dev_s dev;
};
/****************************************************************************
* Private Function Prototypes
****************************************************************************/

View file

@ -125,7 +125,7 @@
#define COMBINE(d) (((int)(d)[0] << 12) | ((int)(d)[1] << 4) | ((int)(d)[2] >> 4))
/****************************************************************************
* Private Type Definitions
* Private Type
****************************************************************************/
struct bmp280_dev_s

View file

@ -71,7 +71,7 @@
#define DHT22_MAX_TEMP 80.0F
/****************************************************************************
* Private Type Definitions
* Private Type
****************************************************************************/
struct dhtxx_dev_s

View file

@ -48,7 +48,7 @@
#define FS3000_ADDR 0x28
/****************************************************************************
* Private Type Definitions
* Private Type
****************************************************************************/
struct fs3000_dev_s
@ -96,6 +96,7 @@ static const struct sensor_ops_s g_sensor_ops =
*
* Return value:
* Zero (OK) on success; a negated errno value on failure
*
****************************************************************************/
static int fs3000_get_data(FAR struct fs3000_dev_s *priv,
@ -136,6 +137,7 @@ static int fs3000_get_data(FAR struct fs3000_dev_s *priv,
*
* Return value:
* Zero (OK) on success; a negated errno value on failure
*
****************************************************************************/
static int fs3000_get_velocity(FAR struct fs3000_dev_s *priv, uint8_t *data,
@ -181,6 +183,7 @@ static int fs3000_get_velocity(FAR struct fs3000_dev_s *priv, uint8_t *data,
*
* Return value:
* Zero (OK) on success; a negated errno value on failure
*
****************************************************************************/
static int fs3000_thread(int argc, char** argv)
@ -233,6 +236,7 @@ thread_sleep:
*
* Return value:
* Zero (OK) on success; a negated errno value on failure
*
****************************************************************************/
int fs3000_register(FAR struct i2c_master_s *i2c)

View file

@ -46,7 +46,7 @@
#include <arch/irq.h>
/****************************************************************************
* Private Type Definitions
* Private Types
****************************************************************************/
/* This structure describes the state of the upper half driver */

View file

@ -52,10 +52,6 @@
# define hdc1008_dbg(x, ...) sninfo(x, ##__VA_ARGS__)
#endif
#ifndef CONFIG_SHT21_I2C_FREQUENCY
# define CONFIG_SHT21_I2C_FREQUENCY 400000
#endif
/* Macros to convert raw temperature and humidity to real values. Temperature
* is scaled by 100, humidity by 10.
*/
@ -99,7 +95,7 @@
#define HDC1008_CONFIGURATION_RST (1 << 15) /* Bit 15: Software reset bit */
/****************************************************************************
* Private
* Private Types
****************************************************************************/
struct hdc1008_dev_s

View file

@ -54,10 +54,6 @@
# define hts221_dbg(x, ...) sninfo(x, ##__VA_ARGS__)
#endif
#ifndef CONFIG_HTS221_I2C_FREQUENCY
# define CONFIG_HTS221_I2C_FREQUENCY 400000
#endif
#define HTS221_WHO_AM_I 0x0f
#define HTS221_AV_CONF 0x10
#define HTS221_CTRL_REG1 0x20

View file

@ -65,10 +65,6 @@
#define INA219_CONFIG_OPMODE_BCONT (6 << INA219_CONFIG_OPMODE_SHIFT)
#define INA219_CONFIG_OPMODE_SBCONT (7 << INA219_CONFIG_OPMODE_SHIFT)
#ifndef CONFIG_INA219_I2C_FREQUENCY
# define CONFIG_INA219_I2C_FREQUENCY 400000
#endif
#define I2C_NOSTARTSTOP_MSGS 2
#define I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX 0
#define I2C_NOSTARTSTOP_DATA_MSG_INDEX 1

View file

@ -44,10 +44,6 @@
# error i2c support required
#endif
#ifndef CONFIG_INA226_I2C_FREQUENCY
# define CONFIG_INA226_I2C_FREQUENCY 400000
#endif
#define I2C_NOSTARTSTOP_MSGS 2
#define I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX 0
#define I2C_NOSTARTSTOP_DATA_MSG_INDEX 1

View file

@ -68,10 +68,6 @@
#define INA3221_CONFIG_RST (1 << 15)
#ifndef CONFIG_INA3221_I2C_FREQUENCY
# define CONFIG_INA3221_I2C_FREQUENCY 400000
#endif
#define I2C_NOSTARTSTOP_MSGS 2
#define I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX 0
#define I2C_NOSTARTSTOP_DATA_MSG_INDEX 1

View file

@ -45,10 +45,6 @@
* Pre-Processor Definitions
****************************************************************************/
#ifndef CONFIG_ISL29023_I2C_FREQUENCY
# define CONFIG_ISL29023_I2C_FREQUENCY 400000
#endif
/* Registers definitions */
#define ISL29023_COMMAND_1 0x00

View file

@ -45,12 +45,6 @@
* Pre-processor Definitions
****************************************************************************/
/* Configuration ************************************************************/
#ifndef CONFIG_KXTJ9_I2C_BUS_SPEED
# define CONFIG_KXTJ9_I2C_BUS_SPEED 400000
#endif
/* Register Definitions *****************************************************/
/* Output registers */

View file

@ -46,10 +46,6 @@
#if defined(CONFIG_SPI) && defined(CONFIG_SENSORS_L3GD20)
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private Types
****************************************************************************/

View file

@ -51,10 +51,6 @@
# define lis2dh_dbg(x, ...) sninfo(x, ##__VA_ARGS__)
#endif
#ifndef CONFIG_LIS2DH_I2C_FREQUENCY
# define CONFIG_LIS2DH_I2C_FREQUENCY 400000
#endif
#ifdef CONFIG_LIS2DH_DRIVER_SELFTEST
# define LSB_AT_10BIT_RESOLUTION 4
# define LSB_AT_12BIT_RESOLUTION 1
@ -74,7 +70,7 @@
#define LIS2DH_COUNT_INTS
/****************************************************************************
* Private Data Types
* Private Types
****************************************************************************/
enum interrupts

View file

@ -49,12 +49,6 @@
* Pre-processor Definitions
****************************************************************************/
/* The LIS2MDL supports up to 3.4MHz bus speeds */
#ifndef CONFIG_SENSORS_LIS2MDL_I2C_FREQUENCY
#define CONFIG_SENSORS_LIS2MDL_I2C_FREQUENCY 1000000
#endif
/* The value that should be in the "who am I" register */
#define WHO_AM_I_VAL 0x40

View file

@ -42,10 +42,6 @@
* Pre-processor Definitions
****************************************************************************/
#ifndef CONFIG_LIS331DL_I2C_FREQUENCY
# define CONFIG_LIS331DL_I2C_FREQUENCY 100000
#endif
/* LIS331DL Internal Registers **********************************************/
#define ST_LIS331DL_WHOAMI 0x0F /* who am I register */
@ -80,7 +76,7 @@
#define ST_LIS331DL_OUT_Z 0x2D
/****************************************************************************
* Private Data Types
* Private Types
****************************************************************************/
struct lis331dl_dev_s

View file

@ -42,7 +42,7 @@
#if defined(CONFIG_SPI) && defined(CONFIG_LIS3DSH)
/****************************************************************************
* Private
* Private Types
****************************************************************************/
struct lis3dsh_sensor_data_s

View file

@ -42,7 +42,7 @@
#if defined(CONFIG_SPI) && defined(CONFIG_SENSORS_LIS3MDL)
/****************************************************************************
* Private
* Private Types
****************************************************************************/
struct lis3mdl_sensor_data_s

View file

@ -45,17 +45,13 @@
* Pre-processor Definitions
****************************************************************************/
#ifndef CONFIG_LM75_I2C_FREQUENCY
# define CONFIG_LM75_I2C_FREQUENCY 100000
#endif
/* Centigrade to Fahrenheit conversion: F = 9*C/5 + 32 */
#define B16_9DIV5 (9 * 65536 / 5)
#define B16_32 (32 * 65536)
/****************************************************************************
* Private
* Private Types
****************************************************************************/
struct lm75_dev_s

View file

@ -44,17 +44,13 @@
* Pre-processor Definitions
****************************************************************************/
#ifndef CONFIG_LM92_I2C_FREQUENCY
# define CONFIG_LM92_I2C_FREQUENCY 400000
#endif
/* Centigrade to Fahrenheit conversion: F = 9*C/5 + 32 */
#define B16_9DIV5 (9 * 65536 / 5)
#define B16_32 (32 * 65536)
/****************************************************************************
* Private
* Private Types
****************************************************************************/
struct lm92_dev_s

View file

@ -48,10 +48,6 @@
# define lps25h_dbg(x, ...) sninfo(x, ##__VA_ARGS__)
#endif
#ifndef CONFIG_LPS25H_I2C_FREQUENCY
# define CONFIG_LPS25H_I2C_FREQUENCY 400000
#endif
#define LPS25H_PRESSURE_INTERNAL_DIVIDER 4096
/* 'AN4450 - Hardware and software guidelines for use of LPS25H pressure

View file

@ -58,14 +58,6 @@
#if defined(CONFIG_I2C) && defined(CONFIG_SENSORS_LSM303AGR)
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#ifndef CONFIG_LSM303AGR_I2C_FREQUENCY
# define CONFIG_LSM303AGR_I2C_FREQUENCY 400000
#endif
/****************************************************************************
* Private Function Prototypes
****************************************************************************/

View file

@ -48,7 +48,7 @@
#define LSM330_INITIAL_GYROCR_SIZE 5
/****************************************************************************
* Private structure definitions
* Private Types
****************************************************************************/
struct sensor_data_s

View file

@ -63,10 +63,6 @@
* Pre-processor Definitions
****************************************************************************/
#ifndef CONFIG_LSM6DSL_I2C_FREQUENCY
# define CONFIG_LSM6DSL_I2C_FREQUENCY 400000
#endif
/* Self test limits. */
#define LSM6DSL_MIN_ST_LIMIT_MG 50.0f /* Accelerator min limit */

View file

@ -58,10 +58,6 @@
#define MDPS_TO_RADS (3.141592653f / (180.0f * 1000.0f))
#ifndef CONFIG_SENSORS_LSM6DSO32_I2C_FREQUENCY
#define CONFIG_SENSORS_LSM6DSO32_I2C_FREQUENCY 400000
#endif /* CONFIG_SENSORS_LSM6DSO32_I2C_FREQUENCY */
/* Number of measurement rounds for gyro self test */
#define GYRO_SELFTEST_ROUNDS 5

View file

@ -26,10 +26,6 @@
#include "lsm9ds1_base.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private Function Prototypes
****************************************************************************/

View file

@ -43,16 +43,12 @@
* Pre-processor Definitions
****************************************************************************/
#ifndef CONFIG_LTC4151_I2C_FREQUENCY
# define CONFIG_LTC4151_I2C_FREQUENCY 400000
#endif
#define I2C_NOSTARTSTOP_MSGS 2
#define I2C_NOSTARTSTOP_ADDRESS_MSG_INDEX 0
#define I2C_NOSTARTSTOP_DATA_MSG_INDEX 1
/****************************************************************************
* Private
* Private Types
****************************************************************************/
struct ltc4151_dev_s

View file

@ -56,7 +56,7 @@
#define LTR308_DATA_0 0x0D
/****************************************************************************
* Private Type Definitions
* Private Types
****************************************************************************/
struct ltr308_sensor_s
@ -118,6 +118,7 @@ static const struct sensor_ops_s g_sensor_ops =
*
* Return value:
* Zero (OK) on success; a negated errno value on failure
*
****************************************************************************/
static int ltr308_set_reg8(FAR struct ltr308_dev_s *priv, uint8_t regaddr,
@ -153,6 +154,7 @@ static int ltr308_set_reg8(FAR struct ltr308_dev_s *priv, uint8_t regaddr,
*
* Return value:
* Zero (OK) on success; a negated errno value on failure
*
****************************************************************************/
static int ltr308_get_reg8(FAR struct ltr308_dev_s *priv, uint8_t regaddr,
@ -190,6 +192,7 @@ static int ltr308_get_reg8(FAR struct ltr308_dev_s *priv, uint8_t regaddr,
*
* Return value:
* Zero (OK) on success; a negated errno value on failure
*
****************************************************************************/
static int ltr308_get_reg24(FAR struct ltr308_dev_s *priv, uint8_t regaddr,
@ -219,6 +222,7 @@ static int ltr308_get_reg24(FAR struct ltr308_dev_s *priv, uint8_t regaddr,
*
* Return value:
* Zero (OK) on success; a negated errno value on failure
*
****************************************************************************/
static int ltr308_checkid(FAR struct ltr308_dev_s *priv)
@ -247,6 +251,7 @@ static int ltr308_checkid(FAR struct ltr308_dev_s *priv)
*
* Return value:
* Zero (OK) on success; a negated errno value on failure
*
****************************************************************************/
static int ltr308_get_status(FAR struct ltr308_dev_s *priv,
@ -292,6 +297,7 @@ static int ltr308_get_status(FAR struct ltr308_dev_s *priv,
*
* Return value:
* Zero (OK) on success; a negated errno value on failure
*
****************************************************************************/
static int ltr308_get_lux(FAR struct ltr308_dev_s *priv, uint8_t gain,
@ -375,6 +381,7 @@ static int ltr308_get_lux(FAR struct ltr308_dev_s *priv, uint8_t gain,
*
* Return value:
* Zero (OK) on success; a negated errno value on failure
*
****************************************************************************/
static int ltr308_activate(FAR struct sensor_lowerhalf_s *lower,
@ -418,6 +425,7 @@ static int ltr308_activate(FAR struct sensor_lowerhalf_s *lower,
*
* Return value:
* Zero (OK) on success; a negated errno value on failure
*
****************************************************************************/
static int ltr308_calibrate(FAR struct sensor_lowerhalf_s *lower,
@ -503,6 +511,7 @@ err_out:
*
* Return value:
* Zero (OK) on success; a negated errno value on failure
*
****************************************************************************/
static int ltr308_thread(int argc, char** argv)
@ -581,6 +590,7 @@ thread_sleep:
*
* Return value:
* Zero (OK) on success; a negated errno value on failure
*
****************************************************************************/
int ltr308_register(int devno, FAR struct i2c_master_s *i2c)

View file

@ -52,10 +52,6 @@
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private
****************************************************************************/
#define MAX31855_FAULT (1 << 16)
#define MAX31855_SHORT_VCC (1 << 2)
#define MAX31855_SHORT_GND (1 << 1)
@ -63,6 +59,10 @@
#define MAX31855_TEMP_COUPLE 0xffffc000
#define MAX31855_TEMP_JUNCTION 0xfff0
/****************************************************************************
* Private Types
****************************************************************************/
struct max31855_dev_s
{
FAR struct spi_dev_s *spi; /* Saved SPI driver instance */

View file

@ -54,10 +54,6 @@
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private
****************************************************************************/
#define MAX31865_CONFIG_REG 0x00
# define MAX31865_BIAS_ON (1 << 7)
# define MAX31865_AUTO_CONVERSION (1 << 6)
@ -87,6 +83,10 @@
#define RTD_A (3.9083e-3)
#define RTD_B (-5.775e-7)
/****************************************************************************
* Private Types
****************************************************************************/
struct max31865_dev_s
{
FAR struct spi_dev_s *spi; /* Saved SPI driver instance */

View file

@ -50,10 +50,6 @@
# define max44009_dbg(x, ...) sninfo(x, ##__VA_ARGS__)
#endif
#ifndef CONFIG_MAX44009_I2C_FREQUENCY
# define CONFIG_MAX44009_I2C_FREQUENCY 400000
#endif
/* Registers */
#define MAX44009_INT_STS 0x0

View file

@ -51,15 +51,15 @@
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private
****************************************************************************/
#define MAX6675_THREE_STATE (1 << 0)
#define MAX6675_DEV_ID (1 << 1)
#define MAX6675_OPEN_CIRCUIT (1 << 2)
#define MAX6675_TEMP_COUPLE 0x7ff8
/****************************************************************************
* Private Types
****************************************************************************/
struct max6675_dev_s
{
FAR struct spi_dev_s *spi; /* Saved SPI driver instance */

View file

@ -39,14 +39,6 @@
#if defined(CONFIG_I2C) && defined(CONFIG_SENSORS_MB7040)
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#ifndef CONFIG_MB7040_I2C_FREQUENCY
# define CONFIG_MB7040_I2C_FREQUENCY 400000
#endif
/****************************************************************************
* Private Types
****************************************************************************/

View file

@ -47,12 +47,6 @@
* Pre-processor Definitions
****************************************************************************/
/* I2C frequency to use during transfers */
#ifdef CONFIG_MCP9600_I2C_FREQUENCY
#define CONFIG_MCP9600_I2C_FREQUENCY 100000
#endif
#define REG_THERMO_HOT_JUNC 0x0 /* Thermocouple Hot-Junction, T H */
#define REG_JUNC_TEMP_DELTA 0x1 /* Junctions Temperature Delta, TΔ */
#define REG_COLD_JUNC_TEMP 0x2 /* Cold-Junction Temperature, T C */

View file

@ -38,14 +38,6 @@
#if defined(CONFIG_I2C) && defined(CONFIG_SENSORS_MCP9844)
/****************************************************************************
* Pre-process Definitions
****************************************************************************/
#ifndef CONFIG_MCP9844_I2C_FREQUENCY
# define CONFIG_MCP9844_I2C_FREQUENCY 400000
#endif
/****************************************************************************
* Private Types
****************************************************************************/

View file

@ -42,7 +42,7 @@
#if defined(CONFIG_SPI) && defined(CONFIG_SENSORS_MLX90393)
/****************************************************************************
* Private
* Private Types
****************************************************************************/
struct mlx90393_sensor_data_s

View file

@ -47,10 +47,6 @@
#if defined(CONFIG_I2C) && defined(CONFIG_SENSORS_MLX90614)
/****************************************************************************
* Pre-process Definitions
****************************************************************************/
/****************************************************************************
* Private Types
****************************************************************************/

View file

@ -43,11 +43,7 @@
#if defined(CONFIG_SPI) && defined(CONFIG_SENSORS_MPL115A)
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private
* Private Types
****************************************************************************/
struct mpl115a_dev_s

View file

@ -68,7 +68,7 @@
#define MS56XX_CMD_ADC_PROM_READ(i) (0xa0 + (i)*2) /* 0xA0 - 0xAE */
/****************************************************************************
* Private Type Definitions
* Private Types
****************************************************************************/
struct ms56xx_calib_s

View file

@ -45,10 +45,6 @@
* Pre-processor Definitions
****************************************************************************/
#ifndef CONFIG_MS58XX_I2C_FREQUENCY
# define CONFIG_MS58XX_I2C_FREQUENCY 400000
#endif
/* Register Definitions *****************************************************/
/* Register Addresses */

View file

@ -63,14 +63,6 @@ struct msa301_ops_s
CODE int (*sensor_read)(FAR struct msa301_dev_s *priv);
};
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
# ifndef CONFIG_MSA301_I2C_FREQUENCY
# define CONFIG_MSA301_I2C_FREQUENCY 400000
# endif
/****************************************************************************
* Private Function Prototypes
****************************************************************************/

View file

@ -45,13 +45,9 @@
#include <nuttx/signal.h>
#include <nuttx/wqueue.h>
#ifndef CONFIG_SENSORS_NAU7802_I2C_FREQUENCY
#define CONFIG_SENSORS_NAU7802_I2C_FREQUENCY 100000
#endif
#ifndef CONFIG_SENSORS_NAU7802_THREAD_STACKSIZE
#define CONFIG_SENSORS_NAU7802_THREAD_STACKSIZE 10000
#endif
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Registers */
@ -86,6 +82,10 @@
#define CAL_START 0x2
#define CAL_ERR 0x3
/****************************************************************************
* Private Types
****************************************************************************/
/* ODR to Interval */
static const uint32_t ODR_TO_INTERVAL[] =
@ -117,6 +117,7 @@ typedef struct
*
* Description:
* Read `nbytes` from the register at `addr` into `buf`.
*
****************************************************************************/
static int nau7802_read_reg(FAR nau7802_dev_s *dev, uint8_t addr, void *buf,
@ -147,6 +148,7 @@ static int nau7802_read_reg(FAR nau7802_dev_s *dev, uint8_t addr, void *buf,
*
* Description:
* Write `nbytes` from `buf` to the registers starting at `addr`.
*
****************************************************************************/
static int nau7802_write_reg(FAR nau7802_dev_s *dev, uint8_t addr, void *buf,
@ -174,13 +176,16 @@ static int nau7802_write_reg(FAR nau7802_dev_s *dev, uint8_t addr, void *buf,
/****************************************************************************
* Name: nau7802_set_bits
*
* Description:
* Helper function to set bits in a register.
*
* Arguments:
* addr - The address of the register to modify
* n_bits - The number of bits to set
* n_bit_shifts - The number of bits to shift
* value - The value to set
*
****************************************************************************/
static int nau7802_set_bits(FAR nau7802_dev_s *dev, uint8_t addr,
@ -276,8 +281,10 @@ static int nau7802_reset(FAR nau7802_dev_s *dev)
/****************************************************************************
* Name: nau7802_enable
*
* Description:
* Enable or disable the NAU7802.
*
****************************************************************************/
static int nau7802_enable(FAR nau7802_dev_s *dev, bool enable)
@ -332,8 +339,10 @@ static int nau7802_enable(FAR nau7802_dev_s *dev, bool enable)
/****************************************************************************
* Name: nau7802_data_available
*
* Description:
* Check if data is available over I2C.
*
****************************************************************************/
static int nau7802_data_available(FAR nau7802_dev_s *dev, bool *val)
@ -346,6 +355,7 @@ static int nau7802_data_available(FAR nau7802_dev_s *dev, bool *val)
*
* Description:
* Read the ADC data from the NAU7802 into the sensor_force structure.
*
****************************************************************************/
static int nau7802_read_data(FAR nau7802_dev_s *dev,
@ -394,8 +404,10 @@ static int nau7802_read_data(FAR nau7802_dev_s *dev,
/****************************************************************************
* Name: nau7802_set_ldo
*
* Description:
* Set the LDO voltage.
*
****************************************************************************/
static int nau7802_set_ldo(FAR nau7802_dev_s *dev, nau7802_ldo_e voltage)
@ -441,6 +453,7 @@ static int nau7802_set_interval(FAR nau7802_dev_s *dev,
* Description:
* Reads some data with exclusive device access and pushed it to the UORB
* upper half.
*
****************************************************************************/
static int nau7802_push_data(FAR nau7802_dev_s *dev)
@ -483,8 +496,10 @@ unlock_ret:
/****************************************************************************
* Name: nau7802_get_calibvalue
*
* Description:
* Get the gain calibration value.
*
****************************************************************************/
static int nau7802_get_calibvalue(FAR nau7802_dev_s *dev, unsigned long arg)
@ -527,8 +542,10 @@ static int nau7802_get_calibvalue(FAR nau7802_dev_s *dev, unsigned long arg)
/****************************************************************************
* Name: nau7802_set_calibvalue
*
* Description:
* Set the gain calibration value.
*
****************************************************************************/
static int nau7802_set_calibvalue(FAR struct sensor_lowerhalf_s *lower,
@ -571,10 +588,12 @@ static int nau7802_set_calibvalue(FAR struct sensor_lowerhalf_s *lower,
/****************************************************************************
* Name: nau7802_calibrate
*
* Description:
* Perform either an INTERNAL, OFFSET or GAIN calibration.
* The gain calibration value is saved and can be retrieved via the
* SNIOC_GET_GAIN_CALIBVALUE command
*
****************************************************************************/
static int nau7802_calibrate(FAR struct sensor_lowerhalf_s *lower,
@ -795,6 +814,7 @@ static int nau7802_get_info(FAR struct sensor_lowerhalf_s *lower,
*
* Description:
* Kernel thread to poll the NAU7802
*
****************************************************************************/
static int nau7802_thread(int argc, FAR char *argv[])
@ -859,6 +879,7 @@ static const struct sensor_ops_s g_sensor_ops =
*
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
*
****************************************************************************/
int nau7802_register(FAR struct i2c_master_s *i2c, int devno, uint8_t addr)

View file

@ -48,13 +48,7 @@
#ifdef CONFIG_SENSORS_QENCODER
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Debug ********************************************************************/
/****************************************************************************
* Private Type Definitions
* Private Types
****************************************************************************/
/* This structure describes the state of the upper half driver */

View file

@ -55,10 +55,6 @@
# define scd30_dbg(x, ...) sninfo(x, ##__VA_ARGS__)
#endif
#ifndef CONFIG_SCD30_I2C_FREQUENCY
# define CONFIG_SCD30_I2C_FREQUENCY 100000
#endif
#define SCD30_I2C_RETRIES 3
/* SCD30 command words */
@ -80,7 +76,7 @@
#define SCD30_DEFAULT_TEMPERATURE_OFFSET 0
/****************************************************************************
* Private
* Private Types
****************************************************************************/
struct scd30_dev_s

View file

@ -55,10 +55,6 @@
# define scd41_dbg(x, ...) sninfo(x, ##__VA_ARGS__)
#endif
#ifndef CONFIG_SCD41_I2C_FREQUENCY
# define CONFIG_SCD41_I2C_FREQUENCY 100000
#endif
#define SCD41_I2C_RETRIES 3
/* SCD41 command words */
@ -90,7 +86,7 @@
#define SCD41_DEFAULT_TEMPERATURE_OFFSET 0
/****************************************************************************
* Private
* Private Types
****************************************************************************/
struct scd41_dev_s

View file

@ -55,16 +55,12 @@
# define sgp30_dbg(x, ...) sninfo(x, ##__VA_ARGS__)
#endif
#ifndef CONFIG_SGP30_I2C_FREQUENCY
# define CONFIG_SGP30_I2C_FREQUENCY 100000
#endif
#define SGP30_I2C_RETRIES 3
#define SGP30_INIT_RETRIES 5
#define SGP30_INIT_LIMIT_MS 10
/****************************************************************************
* Private
* Private Types
****************************************************************************/
struct sgp30_dev_s

View file

@ -51,10 +51,6 @@
# define sht21_dbg(x, ...) sninfo(x, ##__VA_ARGS__)
#endif
#ifndef CONFIG_SHT21_I2C_FREQUENCY
# define CONFIG_SHT21_I2C_FREQUENCY 400000
#endif
/* I2C command bytes */
#define SHT21_TRIG_T_MEAS_HM 0xe3
@ -64,7 +60,7 @@
#define SHT21_SOFT_RESET 0xfe
/****************************************************************************
* Private
* Private Types
****************************************************************************/
struct sht21_dev_s

View file

@ -51,10 +51,6 @@
# define sht3x_dbg(x, ...) sninfo(x, ##__VA_ARGS__)
#endif
#ifndef CONFIG_SHT3X_I2C_FREQUENCY
# define CONFIG_SHT3X_I2C_FREQUENCY 400000
#endif
/* Commands */
#define SHT3X_READ_SERIALNBR 0x3780 /* read serial number */
@ -98,7 +94,7 @@
#define SHT3X_DEFAULT_MEAS_MODE SHT3X_MEAS_PERI_1_H
/****************************************************************************
* Private
* Private Types
****************************************************************************/
struct sht3x_dev_s

View file

@ -47,10 +47,6 @@
* Pre-processor Definitions
****************************************************************************/
#ifndef CONFIG_SHT4X_I2C_FREQUENCY
#define CONFIG_SHT4X_I2C_FREQUENCY 400000
#endif
#define SHT4X_CRC_INIT 0xFF /* Initial value of the calculated CRC. */
#define SHT4X_CRC_POLY 0x31 /* CRC calculation polynomial. */
@ -67,7 +63,7 @@
#define SHT4X_HEAT_20_P1 0x15 /* Activate heater with 20mW for 0.1s. */
/****************************************************************************
* Private
* Private Types
****************************************************************************/
/* Sensor information for the lowerhalf sensors.

View file

@ -55,10 +55,6 @@
# define sps30_dbg(x, ...) sninfo(x, ##__VA_ARGS__)
#endif
#ifndef CONFIG_SPS30_I2C_FREQUENCY
# define CONFIG_SPS30_I2C_FREQUENCY 100000
#endif
#define SPS30_MEASUREMENT_INTERVAL 1 /* one second, fixed in hw */
#define SPS30_MEASUREMENT_MODE 0x0300
@ -77,7 +73,7 @@
#define SPS30_CMD_SOFT_RESET 0xd304
/****************************************************************************
* Private
* Private Types
****************************************************************************/
struct sps30_dev_s

View file

@ -42,14 +42,6 @@
#if defined(CONFIG_I2C) && defined(CONFIG_SENSORS_VEML6070)
/****************************************************************************
* Pre-process Definitions
****************************************************************************/
#ifndef CONFIG_VEML6070_I2C_FREQUENCY
# define CONFIG_VEML6070_I2C_FREQUENCY 100000
#endif
/****************************************************************************
* Private Types
****************************************************************************/

View file

@ -64,7 +64,7 @@
#define VL53L1X_ADDR 0x29
/****************************************************************************
* Private Type Definitions
* Private Types
****************************************************************************/
struct vl53l1x_dev_s

View file

@ -88,10 +88,6 @@ struct wtgahrs2_dev_s
unsigned char gnss_mask;
};
/****************************************************************************
* Private
****************************************************************************/
/****************************************************************************
* Private Function Prototypes
****************************************************************************/

View file

@ -49,7 +49,7 @@
#ifdef CONFIG_SENSORS_ZEROCROSS
/****************************************************************************
* Private Type Definitions
* Private Types
****************************************************************************/
/* This structure describes the state of the upper half driver */