1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-24 05:53:49 +01:00

Merge pull request #13996 from akshaim/Kconfig_l3g4200d

drivers/l3g4200d : Expose Configurations to Kconfig
This commit is contained in:
Leandro Lanzieri 2020-05-05 11:53:46 +02:00 committed by GitHub
commit ebc415b83d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 33 additions and 7 deletions

View File

@ -19,6 +19,7 @@ rsource "ads101x/Kconfig"
rsource "bmx055/Kconfig"
rsource "fxos8700/Kconfig"
rsource "hdc1000/Kconfig"
rsource "l3g4200d/Kconfig"
rsource "lpsxxx/Kconfig"
rsource "mag3110/Kconfig"
rsource "mma8x5x/Kconfig"

View File

@ -44,13 +44,13 @@
/**
* @brief Default address
*
* The address depends on the status of SDO Pin.
* Default address corresponds to SD0 connected to GND.
* For more information on SerialBus Address, refer Section 5.1.1
* I2C Operation on datasheet.
* The address depends on the status of SDO Pin. Default
* address corresponds to SDO connected to GND. For more
* information refer to the section 'I2C Operation' in
* the datasheet.
*/
#ifndef L3G4200D_DEFAULT_ADDRESS
#define L3G4200D_DEFAULT_ADDRESS 0x68
#ifndef CONFIG_L3G4200D_DEFAULT_ADDRESS
#define CONFIG_L3G4200D_DEFAULT_ADDRESS 0x68
#endif
/** @} */

25
drivers/l3g4200d/Kconfig Normal file
View File

@ -0,0 +1,25 @@
# 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_L3G4200D
bool "Configure L3G4200D driver"
depends on MODULE_L3G4200D
help
Configure the L3G4200D driver using Kconfig.
if KCONFIG_MODULE_L3G4200D
config L3G4200D_DEFAULT_ADDRESS
hex "Default I2C address"
range 0x68 0x69
default 0x68
help
The address depends on the status of SDO Pin. Default
address corresponds to SDO connected to GND. For more
information refer to the section 'I2C Operation' in
the datasheet.
endif # KCONFIG_MODULE_L3G4200D

View File

@ -35,7 +35,7 @@ extern "C" {
#define L3G4200D_PARAM_I2C I2C_DEV(0)
#endif
#ifndef L3G4200D_PARAM_ADDR
#define L3G4200D_PARAM_ADDR (0x68)
#define L3G4200D_PARAM_ADDR (CONFIG_L3G4200D_DEFAULT_ADDRESS)
#endif
#ifndef L3G4200D_PARAM_INT1
#define L3G4200D_PARAM_INT1 (GPIO_PIN(0, 0))