Merge pull request #13915 from akshaim/Kconfig_mag3110
drivers/mag3110 : Expose Configurations to Kconfig
This commit is contained in:
commit
341916cd30
@ -19,5 +19,6 @@ endmenu # Network Device Drivers
|
|||||||
menu "Sensor Device Drivers"
|
menu "Sensor Device Drivers"
|
||||||
rsource "ads101x/Kconfig"
|
rsource "ads101x/Kconfig"
|
||||||
rsource "hdc1000/Kconfig"
|
rsource "hdc1000/Kconfig"
|
||||||
|
rsource "mag3110/Kconfig"
|
||||||
rsource "mma8x5x/Kconfig"
|
rsource "mma8x5x/Kconfig"
|
||||||
endmenu # Sensor Device Drivers
|
endmenu # Sensor Device Drivers
|
||||||
|
|||||||
@ -65,8 +65,8 @@ enum {
|
|||||||
* The address depends on part number of MAG3110.
|
* The address depends on part number of MAG3110.
|
||||||
* For more information on SerialBus Address, refer Table 1 in Technical datasheet(MAG3110).
|
* For more information on SerialBus Address, refer Table 1 in Technical datasheet(MAG3110).
|
||||||
*/
|
*/
|
||||||
#ifndef MAG3110_I2C_ADDRESS
|
#ifndef CONFIG_MAG3110_I2C_ADDRESS
|
||||||
#define MAG3110_I2C_ADDRESS 0x0E
|
#define CONFIG_MAG3110_I2C_ADDRESS 0x0E
|
||||||
#endif
|
#endif
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
|
|||||||
23
drivers/mag3110/Kconfig
Normal file
23
drivers/mag3110/Kconfig
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# 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_MAG3110
|
||||||
|
bool "Configure MAG3110 driver"
|
||||||
|
depends on MODULE_MAG3110
|
||||||
|
help
|
||||||
|
Configure the MAG3110 driver using Kconfig.
|
||||||
|
|
||||||
|
if KCONFIG_MODULE_MAG3110
|
||||||
|
|
||||||
|
config MAG3110_I2C_ADDRESS
|
||||||
|
hex "I2C default address"
|
||||||
|
range 0x0E 0x0F
|
||||||
|
default 0x0E
|
||||||
|
help
|
||||||
|
The address depends on part number of MAG3110.
|
||||||
|
For more information refer to the datasheet.
|
||||||
|
|
||||||
|
endif # KCONFIG_MODULE_MAG3110
|
||||||
@ -36,7 +36,7 @@ extern "C" {
|
|||||||
#define MAG3110_PARAM_I2C (I2C_DEV(0))
|
#define MAG3110_PARAM_I2C (I2C_DEV(0))
|
||||||
#endif
|
#endif
|
||||||
#ifndef MAG3110_PARAM_ADDR
|
#ifndef MAG3110_PARAM_ADDR
|
||||||
#define MAG3110_PARAM_ADDR (MAG3110_I2C_ADDRESS)
|
#define MAG3110_PARAM_ADDR (CONFIG_MAG3110_I2C_ADDRESS)
|
||||||
#endif
|
#endif
|
||||||
#ifndef MAG3110_PARAM_OFFSET
|
#ifndef MAG3110_PARAM_OFFSET
|
||||||
#define MAG3110_PARAM_OFFSET { 0, 0, 0 }
|
#define MAG3110_PARAM_OFFSET { 0, 0, 0 }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user