Merge pull request #14000 from akshaim/Kconfig_lpsxxx

drivers/lpsxxx : Expose Configurations to Kconfig
This commit is contained in:
Leandro Lanzieri 2020-05-05 09:09:30 +02:00 committed by GitHub
commit 28eedd6459
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 33 additions and 6 deletions

View File

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

View File

@ -44,12 +44,13 @@ extern "C" {
/**
* @brief The sensors default I2C address
*
* Default address corresponds to SDO/SA0 pad connected to ground. If SDO/SA0
* pad is connected to power supply, I2C address is 0x5C.
* Refer to 'I2C Operation' section on the datasheet
* The address depends on the status of SDO/SA0 Pin. Default
* address corresponds to SDO/SA0 connected to VDD. For more
* information refer to the section 'I2C operation' in the
* datasheet.
*/
#ifndef LPSXXX_DEFAULT_ADDRESS
#define LPSXXX_DEFAULT_ADDRESS (0x5d)
#ifndef CONFIG_LPSXXX_DEFAULT_ADDRESS
#define CONFIG_LPSXXX_DEFAULT_ADDRESS (0x5d)
#endif
/** @} */

25
drivers/lpsxxx/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_LPSXXX
bool "Configure LPSXXX driver"
depends on MODULE_LPSXXX
help
Configure the LPSXXX driver using Kconfig.
if KCONFIG_MODULE_LPSXXX
config LPSXXX_DEFAULT_ADDRESS
hex "Default I2C address"
range 0x5c 0x5d
default 0x5d
help
The address depends on the status of SDO/SA0 Pin. Default
address corresponds to SDO/SA0 connected to VDD. For more
information refer to the section 'I2C operation' in the
datasheet.
endif # KCONFIG_MODULE_LPSXXX

View File

@ -37,7 +37,7 @@ extern "C" {
#define LPSXXX_PARAM_I2C I2C_DEV(0)
#endif
#ifndef LPSXXX_PARAM_ADDR
#define LPSXXX_PARAM_ADDR (LPSXXX_DEFAULT_ADDRESS)
#define LPSXXX_PARAM_ADDR (CONFIG_LPSXXX_DEFAULT_ADDRESS)
#endif
#ifndef LPSXXX_PARAM_RATE
#define LPSXXX_PARAM_RATE (LPSXXX_DEFAULT_RATE)