drivers/sensors: Make naming configuration compliant for two more drivers. Still several to go.
This commit is contained in:
parent
7f4af7b690
commit
269107afc8
@ -99,29 +99,29 @@ config SENSOR_KXTJ9
|
||||
default n
|
||||
select I2C
|
||||
|
||||
if SENSOR_KXTJ9
|
||||
if SENSORS_KXTJ9
|
||||
|
||||
config SENSOR_KXTJ9_I2C_BUS_SPEED
|
||||
config KXTJ9_I2C_BUS_SPEED
|
||||
int "Kionix KXTJ9 Bus Speed in Hz"
|
||||
default 400000
|
||||
|
||||
endif # SENSOR_KXTJ9
|
||||
endif # SENSORS_KXTJ9
|
||||
|
||||
config LIS2DH
|
||||
config SENSORS_LIS2DH
|
||||
bool "STMicro LIS2DH device support"
|
||||
default n
|
||||
select I2C
|
||||
---help---
|
||||
Enable driver support for the STMicro LIS2DH accelerometer
|
||||
|
||||
if LIS2DH
|
||||
if SENSORS_LIS2DH
|
||||
|
||||
config LIS2DH_I2C_FREQUENCY
|
||||
int "LIS2DH I2C frequency"
|
||||
default 400000
|
||||
range 1 400000
|
||||
|
||||
config DEBUG_LIS2DH
|
||||
config LIS2DH_DEBUG
|
||||
bool "Debug support for the LIS2DH"
|
||||
default n
|
||||
---help---
|
||||
@ -139,7 +139,7 @@ config LIS2DH_DRIVER_SELFTEST
|
||||
---help---
|
||||
Enable selftest in LIS2DH driver
|
||||
|
||||
endif # LIS2DH
|
||||
endif # SENSORS_LIS2DH
|
||||
|
||||
config LIS3DSH
|
||||
bool "STMicro LIS3DSH 3-Axis accelerometer support"
|
||||
|
@ -53,11 +53,11 @@ ifeq ($(CONFIG_SENSORS_AS5048B),y)
|
||||
CSRCS += as5048b.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SENSOR_KXTJ9),y)
|
||||
ifeq ($(CONFIG_SENSORS_KXTJ9),y)
|
||||
CSRCS += kxtj9.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LIS2DH),y)
|
||||
ifeq ($(CONFIG_SENSORS_LIS2DH),y)
|
||||
CSRCS += lis2dh.c
|
||||
endif
|
||||
|
||||
|
@ -53,7 +53,7 @@
|
||||
#include <nuttx/sensors/kxtj9.h>
|
||||
#include <nuttx/random.h>
|
||||
|
||||
#if defined(CONFIG_I2C) && defined(CONFIG_SENSOR_KXTJ9)
|
||||
#if defined(CONFIG_I2C) && defined(CONFIG_SENSORS_KXTJ9)
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
@ -61,8 +61,8 @@
|
||||
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
#ifndef CONFIG_SENSOR_KXTJ9_I2C_BUS_SPEED
|
||||
# define CONFIG_SENSOR_KXTJ9_I2C_BUS_SPEED 400000
|
||||
#ifndef CONFIG_KXTJ9_I2C_BUS_SPEED
|
||||
# define CONFIG_KXTJ9_I2C_BUS_SPEED 400000
|
||||
#endif
|
||||
|
||||
/* Register Definitions *****************************************************/
|
||||
@ -216,7 +216,7 @@ static int kxtj9_reg_read(FAR struct kxtj9_dev_s *priv, uint8_t regaddr,
|
||||
|
||||
buf[0] = regaddr;
|
||||
|
||||
msg[0].frequency = CONFIG_SENSOR_KXTJ9_I2C_BUS_SPEED,
|
||||
msg[0].frequency = CONFIG_KXTJ9_I2C_BUS_SPEED,
|
||||
msg[0].addr = priv->address;
|
||||
msg[0].flags = 0;
|
||||
msg[0].buffer = buf;
|
||||
@ -224,7 +224,7 @@ static int kxtj9_reg_read(FAR struct kxtj9_dev_s *priv, uint8_t regaddr,
|
||||
|
||||
/* The second is a read with a restart containing the register data */
|
||||
|
||||
msg[1].frequency = CONFIG_SENSOR_KXTJ9_I2C_BUS_SPEED,
|
||||
msg[1].frequency = CONFIG_KXTJ9_I2C_BUS_SPEED,
|
||||
msg[1].addr = priv->address;
|
||||
msg[1].flags = I2C_M_READ;
|
||||
msg[1].buffer = regval;
|
||||
@ -262,7 +262,7 @@ static int kxtj9_reg_write(FAR struct kxtj9_dev_s *priv, uint8_t regaddr,
|
||||
buf[0] = regaddr;
|
||||
buf[1] = regval;
|
||||
|
||||
msg.frequency = CONFIG_SENSOR_KXTJ9_I2C_BUS_SPEED,
|
||||
msg.frequency = CONFIG_KXTJ9_I2C_BUS_SPEED,
|
||||
msg.addr = priv->address;
|
||||
msg.flags = 0;
|
||||
msg.buffer = buf;
|
||||
@ -685,4 +685,4 @@ int kxtj9_register(FAR const char *devpath, FAR struct i2c_master_s *i2c,
|
||||
return OK;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_I2C && CONFIG_SENSOR_KXTJ9 */
|
||||
#endif /* CONFIG_I2C && CONFIG_SENSORS_KXTJ9 */
|
||||
|
@ -59,7 +59,7 @@
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_DEBUG_LIS2DH
|
||||
#ifdef CONFIG_LIS2DH_DEBUG
|
||||
# define lis2dh_dbg(x, ...) _info(x, ##__VA_ARGS__)
|
||||
#else
|
||||
# define lis2dh_dbg(x, ...) sninfo(x, ##__VA_ARGS__)
|
||||
|
@ -46,7 +46,7 @@
|
||||
#include <stdint.h>
|
||||
#include <nuttx/sensors/ioctl.h>
|
||||
|
||||
#if defined(CONFIG_I2C) && defined(CONFIG_SENSOR_KXTJ9)
|
||||
#if defined(CONFIG_I2C) && defined(CONFIG_SENSORS_KXTJ9)
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
@ -115,5 +115,5 @@ int kxtj9_register(FAR const char *devpath, FAR struct i2c_master_s *i2c,
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_I2C && CONFIG_SENSOR_KXTJ9 */
|
||||
#endif /* CONFIG_I2C && CONFIG_SENSORS_KXTJ9 */
|
||||
#endif /* __INCLUDE_NUTTX_SENSORS_KXTJ9_H */
|
||||
|
Loading…
Reference in New Issue
Block a user