diff --git a/drivers/Kconfig b/drivers/Kconfig index 969a6d9e3b5a..829c69c45589 100644 --- a/drivers/Kconfig +++ b/drivers/Kconfig @@ -14,6 +14,7 @@ rsource "Kconfig.net" menu "Sensor Device Drivers" rsource "ads101x/Kconfig" +rsource "bmx055/Kconfig" rsource "fxos8700/Kconfig" rsource "hdc1000/Kconfig" rsource "mag3110/Kconfig" diff --git a/drivers/bmx055/Kconfig b/drivers/bmx055/Kconfig new file mode 100644 index 000000000000..d9837608fb56 --- /dev/null +++ b/drivers/bmx055/Kconfig @@ -0,0 +1,42 @@ +# Copyright (c) 2020 Freie Universitaet Berlin +# +# This file is subject to the terms and conditions of the GNU Lesser +# General Public License v2.1. See the file LICENSE in the top level +# directory for more details. +# +menuconfig KCONFIG_MODULE_BMX055 + bool "Configure BMX055 driver" + depends on MODULE_BMX055 + help + Configure the BMX055 driver using Kconfig. + +if KCONFIG_MODULE_BMX055 + +config BMX055_MAG_ADDR_DEFAULT + hex "I2C Address of magnetometer" + range 0x10 0x13 + default 0x10 + help + The address depends on the state of SDO1, SDO2 and CSB3 pins. + For more information refer to the section 'Inter-Integrated + Circuit (I²C)' in the datasheet. + +config BMX055_ACC_ADDR_DEFAULT + hex "I2C Address of accelerometer" + range 0x18 0x19 + default 0x18 + help + The address depends on the state of SDO1, SDO2 and CSB3 pins. + For more information refer to the section 'Inter-Integrated + Circuit (I²C)' in the datasheet. + +config BMX055_GYRO_ADDR_DEFAULT + hex "I2C Address of gyroscope" + range 0x68 0x69 + default 0x68 + help + The address depends on the state of SDO1, SDO2 and CSB3 pins. + For more information refer to the section 'Inter-Integrated + Circuit (I²C)' in the datasheet. + +endif # KCONFIG_MODULE_BMX055 diff --git a/drivers/bmx055/include/bmx055_params.h b/drivers/bmx055/include/bmx055_params.h index 0cedccf5e1fc..c4e20afc5cd5 100644 --- a/drivers/bmx055/include/bmx055_params.h +++ b/drivers/bmx055/include/bmx055_params.h @@ -33,13 +33,13 @@ extern "C" { #define BMX055_PARAM_I2C I2C_DEV(0) #endif #ifndef BMX055_PARAM_MAG_ADDR -#define BMX055_PARAM_MAG_ADDR BMX055_MAG_ADDR_DEFAULT +#define BMX055_PARAM_MAG_ADDR CONFIG_BMX055_MAG_ADDR_DEFAULT #endif #ifndef BMX055_PARAM_ACC_ADDR -#define BMX055_PARAM_ACC_ADDR BMX055_ACC_ADDR_DEFAULT +#define BMX055_PARAM_ACC_ADDR CONFIG_BMX055_ACC_ADDR_DEFAULT #endif #ifndef BMX055_PARAM_GYRO_ADDR -#define BMX055_PARAM_GYRO_ADDR BMX055_GYRO_ADDR_DEFAULT +#define BMX055_PARAM_GYRO_ADDR CONFIG_BMX055_GYRO_ADDR_DEFAULT #endif #ifndef BMX055_PARAM_INT1 #define BMX055_PARAM_INT1 GPIO_PIN(0, 0) diff --git a/drivers/include/bmx055.h b/drivers/include/bmx055.h index bb33fb955d81..755f64c50442 100644 --- a/drivers/include/bmx055.h +++ b/drivers/include/bmx055.h @@ -43,31 +43,34 @@ extern "C" { /** * @brief Magnetometer default address * - * The address depends on part number of SDO1, SDO2 and CSB3. - * For more information on SerialBus Address, refer section 11.2 in datasheet. + * The address depends on the state of SDO1, SDO2 and CSB3 pins. + * For more information refer to the section 'Inter-Integrated + * Circuit (I²C)' in the datasheet. */ -#ifndef BMX055_MAG_ADDR_DEFAULT -#define BMX055_MAG_ADDR_DEFAULT (0x10U) +#ifndef CONFIG_BMX055_MAG_ADDR_DEFAULT +#define CONFIG_BMX055_MAG_ADDR_DEFAULT (0x10U) #endif /** * @brief Accelerometer default address * - * The address depends on part number of SDO1, SDO2 and CSB3. - * For more information on SerialBus Address, refer section 11.2 in datasheet. + * The address depends on the state of SDO1, SDO2 and CSB3 pins. + * For more information refer to the section 'Inter-Integrated + * Circuit (I²C)' in the datasheet. */ -#ifndef BMX055_ACC_ADDR_DEFAULT -#define BMX055_ACC_ADDR_DEFAULT (0x18U) +#ifndef CONFIG_BMX055_ACC_ADDR_DEFAULT +#define CONFIG_BMX055_ACC_ADDR_DEFAULT (0x18U) #endif /** * @brief Gyroscope default address * - * The address depends on part number of SDO1, SDO2 and CSB3. - * For more information on SerialBus Address, refer section 11.2 in datasheet. + * The address depends on the state of SDO1, SDO2 and CSB3 pins. + * For more information refer to the section 'Inter-Integrated + * Circuit (I²C)' in the datasheet. */ -#ifndef BMX055_GYRO_ADDR_DEFAULT -#define BMX055_GYRO_ADDR_DEFAULT (0x68U) +#ifndef CONFIG_BMX055_GYRO_ADDR_DEFAULT +#define CONFIG_BMX055_GYRO_ADDR_DEFAULT (0x68U) #endif /** @} */