drivers/lis2dh12: explicit bus variant selection
This commit is contained in:
parent
0080a27636
commit
cfdd941f9b
@ -5,20 +5,18 @@
|
|||||||
# directory for more details.
|
# directory for more details.
|
||||||
#
|
#
|
||||||
|
|
||||||
config HAVE_LIS2DH12
|
config MODULE_LIS2DH12
|
||||||
bool
|
bool
|
||||||
select MODULE_LIS2DH12 if MODULE_SAUL_DEFAULT
|
prompt "LIS2DH12 Accelerometer" if !(MODULE_SAUL_DEFAULT && HAVE_LIS2DH12)
|
||||||
help
|
default (MODULE_SAUL_DEFAULT && HAVE_LIS2DH12)
|
||||||
Indicates that a lisdh12 is present
|
|
||||||
|
|
||||||
menuconfig MODULE_LIS2DH12
|
|
||||||
bool "LIS2DH12 Accelerometer"
|
|
||||||
depends on TEST_KCONFIG
|
depends on TEST_KCONFIG
|
||||||
|
|
||||||
if MODULE_LIS2DH12
|
if MODULE_LIS2DH12
|
||||||
|
|
||||||
choice
|
choice
|
||||||
bool "Device interface"
|
bool "Device interface"
|
||||||
|
default MODULE_LIS2DH12_I2C if HAVE_LIS2DH12_I2C
|
||||||
|
default MODULE_LIS2DH12_SPI if HAVE_LIS2DH12_SPI
|
||||||
|
|
||||||
config MODULE_LIS2DH12_I2C
|
config MODULE_LIS2DH12_I2C
|
||||||
bool "I2C"
|
bool "I2C"
|
||||||
@ -40,3 +38,21 @@ config MODULE_LIS2DH12_INT
|
|||||||
select MODULE_PERIPH_GPIO_IRQ
|
select MODULE_PERIPH_GPIO_IRQ
|
||||||
|
|
||||||
endif # MODULE_LIS2DH12
|
endif # MODULE_LIS2DH12
|
||||||
|
|
||||||
|
config HAVE_LIS2DH12
|
||||||
|
bool
|
||||||
|
select MODULE_LIS2DH12 if MODULE_SAUL_DEFAULT
|
||||||
|
help
|
||||||
|
Indicates that a LIS2DH12 Accelerometer is present.
|
||||||
|
|
||||||
|
config HAVE_LIS2DH12_I2C
|
||||||
|
bool
|
||||||
|
select HAVE_LIS2DH12
|
||||||
|
help
|
||||||
|
Indicates that a LIS2DH12 Accelerometer on the I2C bus is present.
|
||||||
|
|
||||||
|
config HAVE_LIS2DH12_SPI
|
||||||
|
bool
|
||||||
|
select HAVE_LIS2DH12
|
||||||
|
help
|
||||||
|
Indicates that a LIS2DH12 Accelerometer on the SPI bus is present.
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
ifneq (,$(filter lis2dh12_spi,$(USEMODULE)))
|
ifneq (,$(filter lis2dh12_spi,$(USEMODULE)))
|
||||||
FEATURES_REQUIRED += periph_gpio
|
FEATURES_REQUIRED += periph_gpio
|
||||||
FEATURES_REQUIRED += periph_spi
|
FEATURES_REQUIRED += periph_spi
|
||||||
else
|
endif
|
||||||
|
|
||||||
|
ifneq (,$(filter lis2dh12_i2c,$(USEMODULE)))
|
||||||
FEATURES_REQUIRED += periph_i2c
|
FEATURES_REQUIRED += periph_i2c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user