diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2021-05-28 13:49:46 +0200 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2021-05-28 13:49:46 +0200 |
commit | cf3ba89c46301bb8c0a1eda470c353801117fc0b (patch) | |
tree | 4b9c954fc1af7fce01bbae8106a56a586a2d170c /src/driver | |
parent | 060efcf52cb596194a037b4e11f5035fc969efd6 (diff) |
softi2c driver: move to kconfig-first approach
Diffstat (limited to 'src/driver')
-rw-r--r-- | src/driver/am2320.cc | 2 | ||||
-rw-r--r-- | src/driver/bme680_util.cc | 2 | ||||
-rw-r--r-- | src/driver/ccs811.cc | 2 | ||||
-rw-r--r-- | src/driver/eeprom24lc64.cc | 2 | ||||
-rw-r--r-- | src/driver/hdc1080.cc | 2 | ||||
-rw-r--r-- | src/driver/lm75.cc | 2 | ||||
-rw-r--r-- | src/driver/max44009.cc | 2 | ||||
-rw-r--r-- | src/driver/mmsimple.cc | 2 | ||||
-rw-r--r-- | src/driver/mmsubstate.cc | 2 | ||||
-rw-r--r-- | src/driver/mpu9250.cc | 2 | ||||
-rw-r--r-- | src/driver/s5851a.cc | 2 | ||||
-rw-r--r-- | src/driver/scd4x.cc | 2 | ||||
-rw-r--r-- | src/driver/soft_i2c.cc | 14 | ||||
-rw-r--r-- | src/driver/ssd1306.cc | 2 | ||||
-rw-r--r-- | src/driver/tsl2591.cc | 4 |
15 files changed, 22 insertions, 22 deletions
diff --git a/src/driver/am2320.cc b/src/driver/am2320.cc index f928b0b..7157add 100644 --- a/src/driver/am2320.cc +++ b/src/driver/am2320.cc @@ -4,7 +4,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ #include "driver/am2320.h" -#if defined(MULTIPASS_ARCH_HAS_I2C) && !defined(DRIVER_SOFTI2C) +#if defined(MULTIPASS_ARCH_HAS_I2C) && !defined(CONFIG_driver_softi2c) #include "driver/i2c.h" #else #include "driver/soft_i2c.h" diff --git a/src/driver/bme680_util.cc b/src/driver/bme680_util.cc index 1fa2ab6..46b1368 100644 --- a/src/driver/bme680_util.cc +++ b/src/driver/bme680_util.cc @@ -4,7 +4,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ #include "arch.h" -#if defined(MULTIPASS_ARCH_HAS_I2C) && !defined(DRIVER_SOFTI2C) +#if defined(MULTIPASS_ARCH_HAS_I2C) && !defined(CONFIG_driver_softi2c) #include "driver/i2c.h" #else #include "driver/soft_i2c.h" diff --git a/src/driver/ccs811.cc b/src/driver/ccs811.cc index 8c16b8a..66c238a 100644 --- a/src/driver/ccs811.cc +++ b/src/driver/ccs811.cc @@ -5,7 +5,7 @@ */ #include "driver/ccs811.h" #include "driver/gpio.h" -#if defined(MULTIPASS_ARCH_HAS_I2C) && !defined(DRIVER_SOFTI2C) +#if defined(MULTIPASS_ARCH_HAS_I2C) && !defined(CONFIG_driver_softi2c) #include "driver/i2c.h" #else #include "driver/soft_i2c.h" diff --git a/src/driver/eeprom24lc64.cc b/src/driver/eeprom24lc64.cc index a1c8de2..1c8158a 100644 --- a/src/driver/eeprom24lc64.cc +++ b/src/driver/eeprom24lc64.cc @@ -5,7 +5,7 @@ */ #include <stdlib.h> #include "driver/eeprom24lc64.h" -#if defined(MULTIPASS_ARCH_HAS_I2C) && !defined(DRIVER_SOFTI2C) +#if defined(MULTIPASS_ARCH_HAS_I2C) && !defined(CONFIG_driver_softi2c) #include "driver/i2c.h" #else #include "driver/soft_i2c.h" diff --git a/src/driver/hdc1080.cc b/src/driver/hdc1080.cc index e303e0a..af828fd 100644 --- a/src/driver/hdc1080.cc +++ b/src/driver/hdc1080.cc @@ -5,7 +5,7 @@ */ #include "driver/hdc1080.h" #include "arch.h" -#if defined(MULTIPASS_ARCH_HAS_I2C) && !defined(DRIVER_SOFTI2C) +#if defined(MULTIPASS_ARCH_HAS_I2C) && !defined(CONFIG_driver_softi2c) #include "driver/i2c.h" #else #include "driver/soft_i2c.h" diff --git a/src/driver/lm75.cc b/src/driver/lm75.cc index 2f2599f..6c6c60a 100644 --- a/src/driver/lm75.cc +++ b/src/driver/lm75.cc @@ -4,7 +4,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ #include "driver/lm75.h" -#if defined(MULTIPASS_ARCH_HAS_I2C) && !defined(DRIVER_SOFTI2C) +#if defined(MULTIPASS_ARCH_HAS_I2C) && !defined(CONFIG_driver_softi2c) #include "driver/i2c.h" #else #include "driver/soft_i2c.h" diff --git a/src/driver/max44009.cc b/src/driver/max44009.cc index e124787..bab4da5 100644 --- a/src/driver/max44009.cc +++ b/src/driver/max44009.cc @@ -4,7 +4,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ #include "driver/max44009.h" -#if defined(MULTIPASS_ARCH_HAS_I2C) && !defined(DRIVER_SOFTI2C) +#if defined(MULTIPASS_ARCH_HAS_I2C) && !defined(CONFIG_driver_softi2c) #include "driver/i2c.h" #else #include "driver/soft_i2c.h" diff --git a/src/driver/mmsimple.cc b/src/driver/mmsimple.cc index 649d118..fa7d9e3 100644 --- a/src/driver/mmsimple.cc +++ b/src/driver/mmsimple.cc @@ -4,7 +4,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ #include "driver/mmsimple.h" -#if defined(MULTIPASS_ARCH_HAS_I2C) && !defined(DRIVER_SOFTI2C) +#if defined(MULTIPASS_ARCH_HAS_I2C) && !defined(CONFIG_driver_softi2c) #include "driver/i2c.h" #else #include "driver/soft_i2c.h" diff --git a/src/driver/mmsubstate.cc b/src/driver/mmsubstate.cc index 0865599..cce2526 100644 --- a/src/driver/mmsubstate.cc +++ b/src/driver/mmsubstate.cc @@ -4,7 +4,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ #include "driver/mmsubstate.h" -#if defined(MULTIPASS_ARCH_HAS_I2C) && !defined(DRIVER_SOFTI2C) +#if defined(MULTIPASS_ARCH_HAS_I2C) && !defined(CONFIG_driver_softi2c) #include "driver/i2c.h" #else #include "driver/soft_i2c.h" diff --git a/src/driver/mpu9250.cc b/src/driver/mpu9250.cc index 3801f55..e34a4a7 100644 --- a/src/driver/mpu9250.cc +++ b/src/driver/mpu9250.cc @@ -1,6 +1,6 @@ #include "driver/mpu9250.h" #include "arch.h" -#if defined(MULTIPASS_ARCH_HAS_I2C) && !defined(DRIVER_SOFTI2C) +#if defined(MULTIPASS_ARCH_HAS_I2C) && !defined(CONFIG_driver_softi2c) #include "driver/i2c.h" #else #include "driver/soft_i2c.h" diff --git a/src/driver/s5851a.cc b/src/driver/s5851a.cc index 2684534..fecb219 100644 --- a/src/driver/s5851a.cc +++ b/src/driver/s5851a.cc @@ -4,7 +4,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ #include "driver/s5851a.h" -#if defined(MULTIPASS_ARCH_HAS_I2C) && !defined(DRIVER_SOFTI2C) +#if defined(MULTIPASS_ARCH_HAS_I2C) && !defined(CONFIG_driver_softi2c) #include "driver/i2c.h" #else #include "driver/soft_i2c.h" diff --git a/src/driver/scd4x.cc b/src/driver/scd4x.cc index 3d52975..d129bf7 100644 --- a/src/driver/scd4x.cc +++ b/src/driver/scd4x.cc @@ -5,7 +5,7 @@ */ #include "driver/scd4x.h" #include "driver/gpio.h" -#if defined(MULTIPASS_ARCH_HAS_I2C) && !defined(DRIVER_SOFTI2C) +#if defined(MULTIPASS_ARCH_HAS_I2C) && !defined(CONFIG_driver_softi2c) #include "driver/i2c.h" #else #include "driver/soft_i2c.h" diff --git a/src/driver/soft_i2c.cc b/src/driver/soft_i2c.cc index 8b87e93..83aa20c 100644 --- a/src/driver/soft_i2c.cc +++ b/src/driver/soft_i2c.cc @@ -16,12 +16,12 @@ volatile unsigned char timer_done = 0; #endif -#ifdef SOFTI2C_PULLUP_INTERNAL +#ifdef CONFIG_driver_softi2c_pullup_dynamic_internal #define SDA_HIGH gpio.input(sda, 1) #define SDA_LOW gpio.output(sda, 0) #define SCL_HIGH gpio.input(scl, 1) #define SCL_LOW gpio.output(scl, 0) -#elif SOFTI2C_PULLUP_EXTERNAL +#elif CONFIG_driver_softi2c_pullup_dynamic_external #define SDA_HIGH { gpio.input(sda); gpio.write(sda_pull, 1); } #define SDA_LOW { gpio.write(sda_pull, 0); gpio.output(sda); } #define SCL_HIGH { gpio.input(scl); gpio.write(scl_pull, 1); } @@ -63,11 +63,11 @@ inline void i2c_wait() signed char SoftI2C::setup() { -#ifdef SOFTI2C_PULLUP_EXTERNAL +#ifdef CONFIG_driver_softi2c_pullup_dynamic_external gpio.output(sda_pull); gpio.output(scl_pull); #endif -#ifdef SOFTI2C_PULLUP_FIXED_GPIO +#ifdef CONFIG_driver_softi2c_pullup_external #if MULTIPASS_ARCH_msp430fr5969lp gpio.output(GPIO::p1_4, 1); gpio.output(GPIO::p1_5, 1); @@ -77,7 +77,7 @@ signed char SoftI2C::setup() #else #error "softi2c_pullup=gpio not supported on this architecture" #endif /* MULTIPASS_ARCH_* */ -#endif /* SOFTI2C_PULLUP_FIXED_GPIO */ +#endif /* CONFIG_driver_softi2c_pullup_external */ SDA_HIGH; SCL_HIGH; #ifdef SOFTI2C_TIMER @@ -237,7 +237,7 @@ ON_TIMER_INTERRUPT_tail #ifndef DRIVER_HARDWARE_I2C -#if SOFTI2C_PULLUP_EXTERNAL +#if CONFIG_driver_softi2c_pullup_dynamic_external #ifdef MULTIPASS_ARCH_msp430fr5969lp SoftI2C i2c(GPIO::p1_6, GPIO::p1_7, GPIO::p1_4, GPIO::p1_5); #elif MULTIPASS_ARCH_msp430fr5994lp @@ -259,6 +259,6 @@ SoftI2C i2c(GPIO::p5_0, GPIO::p5_1); #elif MULTIPASS_ARCH_posix SoftI2C i2c(GPIO::px00, GPIO::px01); #endif /* MULTIPASS_ARCH_* */ -#endif /* !SOFTI2C_PULLUP_EXTERNAL */ +#endif /* !CONFIG_driver_softi2c_pullup_dynamic_external */ #endif /* !DRIVER_HARDWARE_I2C */ diff --git a/src/driver/ssd1306.cc b/src/driver/ssd1306.cc index 1d4e1f3..4ad47ec 100644 --- a/src/driver/ssd1306.cc +++ b/src/driver/ssd1306.cc @@ -4,7 +4,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ #include "driver/ssd1306.h" -#if defined(MULTIPASS_ARCH_HAS_I2C) && !defined(DRIVER_SOFTI2C) +#if defined(MULTIPASS_ARCH_HAS_I2C) && !defined(CONFIG_driver_softi2c) #include "driver/i2c.h" #else #include "driver/soft_i2c.h" diff --git a/src/driver/tsl2591.cc b/src/driver/tsl2591.cc index 6356477..1f6dd6c 100644 --- a/src/driver/tsl2591.cc +++ b/src/driver/tsl2591.cc @@ -1,10 +1,10 @@ /* - * Copyright 2020 Daniel Friesel + * Copyright 2021 Daniel Friesel * * SPDX-License-Identifier: BSD-2-Clause */ #include "driver/tsl2591.h" -#if defined(MULTIPASS_ARCH_HAS_I2C) && !defined(DRIVER_SOFTI2C) +#if defined(MULTIPASS_ARCH_HAS_I2C) && !defined(CONFIG_driver_softi2c) #include "driver/i2c.h" #else #include "driver/soft_i2c.h" |