summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile10
-rw-r--r--include/driver/soft_i2c.h4
-rw-r--r--include/driver/tsl2591.h2
-rw-r--r--src/app/bme680-max44009-logger/main.cc2
-rw-r--r--src/app/button-and-motion-logger/main.cc2
-rw-r--r--src/app/ccs811test/main.cc2
-rw-r--r--src/app/datalogger/main.cc4
-rw-r--r--src/app/i2cbench/main.cc2
-rw-r--r--src/app/i2cdetect/main.cc2
-rw-r--r--src/app/luxlog/main.cc2
-rw-r--r--src/app/mpu9250_motionlog/main.cc2
-rw-r--r--src/app/ssd1306test/main.cc2
-rw-r--r--src/arch/msp430fr5969lp/driver/i2c.cc2
-rw-r--r--src/arch/msp430fr5994lp/driver/i2c.cc2
-rw-r--r--src/driver/am2320.cc2
-rw-r--r--src/driver/bme680_util.cc2
-rw-r--r--src/driver/ccs811.cc2
-rw-r--r--src/driver/eeprom24lc64.cc2
-rw-r--r--src/driver/hdc1080.cc2
-rw-r--r--src/driver/lm75.cc2
-rw-r--r--src/driver/max44009.cc2
-rw-r--r--src/driver/mmsimple.cc2
-rw-r--r--src/driver/mmsubstate.cc2
-rw-r--r--src/driver/mpu9250.cc2
-rw-r--r--src/driver/s5851a.cc2
-rw-r--r--src/driver/scd4x.cc2
-rw-r--r--src/driver/soft_i2c.cc14
-rw-r--r--src/driver/ssd1306.cc2
-rw-r--r--src/driver/tsl2591.cc4
29 files changed, 42 insertions, 42 deletions
diff --git a/Makefile b/Makefile
index dde01f3..acd8aef 100644
--- a/Makefile
+++ b/Makefile
@@ -279,7 +279,7 @@ endif
ifdef CONFIG_driver_softi2c
CXX_TARGETS += src/driver/soft_i2c.cc
- COMMON_FLAGS += -DDRIVER_SOFTI2C
+ COMMON_FLAGS += -DCONFIG_driver_softi2c
endif
ifdef CONFIG_meta_driver_hardware_i2c
@@ -318,25 +318,25 @@ ifdef CONFIG_driver_softi2c_pullup_dynamic_internal
softi2c_pullup=internal
endif
ifeq (${softi2c_pullup}, internal)
- COMMON_FLAGS += -DSOFTI2C_PULLUP_INTERNAL
+ COMMON_FLAGS += -DCONFIG_driver_softi2c_pullup_dynamic_internal
endif
ifdef CONFIG_driver_softi2c_pullup_dynamic_external
softi2c_pullup=external
endif
ifeq (${softi2c_pullup}, external)
- COMMON_FLAGS += -DSOFTI2C_PULLUP_EXTERNAL
+ COMMON_FLAGS += -DCONFIG_driver_softi2c_pullup_dynamic_external
endif
ifdef CONFIG_driver_softi2c_pullup_external
softi2c_pullup=gpio
endif
ifeq (${softi2c_pullup}, gpio)
- COMMON_FLAGS += -DSOFTI2C_PULLUP_FIXED_GPIO
+ COMMON_FLAGS += -DCONFIG_driver_softi2c_pullup_external
endif
ifeq (${i2c_pullup}, gpio)
- COMMON_FLAGS += -DI2C_PULLUP_FIXED_GPIO
+ COMMON_FLAGS += -DCONFIG_I2C_PULLUP_FIXED_GPIO
endif
ifeq (${softi2c_timer}, 1)
diff --git a/include/driver/soft_i2c.h b/include/driver/soft_i2c.h
index b581a38..e53b13e 100644
--- a/include/driver/soft_i2c.h
+++ b/include/driver/soft_i2c.h
@@ -11,7 +11,7 @@ class SoftI2C {
SoftI2C(const SoftI2C &copy);
unsigned char sda, scl;
-#if SOFTI2C_PULLUP_EXTERNAL
+#if CONFIG_driver_softi2c_pullup_dynamic_external
unsigned char sda_pull, scl_pull;
#endif
@@ -21,7 +21,7 @@ class SoftI2C {
unsigned char rx(bool send_ack);
public:
-#if SOFTI2C_PULLUP_EXTERNAL
+#if CONFIG_driver_softi2c_pullup_dynamic_external
SoftI2C(unsigned char sda, unsigned char scl,
unsigned char sda_pull, unsigned char scl_pull) :
sda(sda), scl(scl), sda_pull(sda_pull), scl_pull(scl_pull) {}
diff --git a/include/driver/tsl2591.h b/include/driver/tsl2591.h
index 0e9e8c8..faf837e 100644
--- a/include/driver/tsl2591.h
+++ b/include/driver/tsl2591.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2020 Daniel Friesel
+ * Copyright 2021 Daniel Friesel
*
* SPDX-License-Identifier: BSD-2-Clause
*/
diff --git a/src/app/bme680-max44009-logger/main.cc b/src/app/bme680-max44009-logger/main.cc
index 5ea1cee..ac742d8 100644
--- a/src/app/bme680-max44009-logger/main.cc
+++ b/src/app/bme680-max44009-logger/main.cc
@@ -6,7 +6,7 @@
#include "arch.h"
#include "driver/gpio.h"
#include "driver/stdout.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/app/button-and-motion-logger/main.cc b/src/app/button-and-motion-logger/main.cc
index 99172bf..ac60205 100644
--- a/src/app/button-and-motion-logger/main.cc
+++ b/src/app/button-and-motion-logger/main.cc
@@ -6,7 +6,7 @@
#include "arch.h"
#include "driver/gpio.h"
#include "driver/stdout.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/app/ccs811test/main.cc b/src/app/ccs811test/main.cc
index bd53999..da51546 100644
--- a/src/app/ccs811test/main.cc
+++ b/src/app/ccs811test/main.cc
@@ -6,7 +6,7 @@
#include "arch.h"
#include "driver/gpio.h"
#include "driver/stdout.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/app/datalogger/main.cc b/src/app/datalogger/main.cc
index 46ff6b0..0119d27 100644
--- a/src/app/datalogger/main.cc
+++ b/src/app/datalogger/main.cc
@@ -9,7 +9,7 @@
#if defined(DRIVER_I2C)
#include "driver/i2c.h"
-#elif defined(DRIVER_SOFTI2C)
+#elif defined(CONFIG_driver_softi2c)
#include "driver/soft_i2c.h"
#endif
@@ -159,7 +159,7 @@ int main(void)
gpio.setup();
kout.setup();
-#if defined(DRIVER_I2C) || defined(DRIVER_SOFTI2C)
+#if defined(DRIVER_I2C) || defined(CONFIG_driver_softi2c)
if (i2c.setup() != 0) {
kout << "I2C setup FAILED" << endl;
return 1;
diff --git a/src/app/i2cbench/main.cc b/src/app/i2cbench/main.cc
index ba24bc3..db2ad51 100644
--- a/src/app/i2cbench/main.cc
+++ b/src/app/i2cbench/main.cc
@@ -6,7 +6,7 @@
#include "arch.h"
#include "driver/gpio.h"
#include "driver/stdout.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/app/i2cdetect/main.cc b/src/app/i2cdetect/main.cc
index 95a34bb..ab954d7 100644
--- a/src/app/i2cdetect/main.cc
+++ b/src/app/i2cdetect/main.cc
@@ -9,7 +9,7 @@
#ifdef DRIVER_HARDWARE_I2C
#include "driver/i2c.h"
#endif
-#ifdef DRIVER_SOFTI2C
+#ifdef CONFIG_driver_softi2c
#include "driver/soft_i2c.h"
#endif
diff --git a/src/app/luxlog/main.cc b/src/app/luxlog/main.cc
index ebaecfb..7b17462 100644
--- a/src/app/luxlog/main.cc
+++ b/src/app/luxlog/main.cc
@@ -6,7 +6,7 @@
#include "arch.h"
#include "driver/gpio.h"
#include "driver/stdout.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/app/mpu9250_motionlog/main.cc b/src/app/mpu9250_motionlog/main.cc
index 7b47f71..6b7e80e 100644
--- a/src/app/mpu9250_motionlog/main.cc
+++ b/src/app/mpu9250_motionlog/main.cc
@@ -6,7 +6,7 @@
#include "arch.h"
#include "driver/gpio.h"
#include "driver/stdout.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/app/ssd1306test/main.cc b/src/app/ssd1306test/main.cc
index 909d26d..c8a5703 100644
--- a/src/app/ssd1306test/main.cc
+++ b/src/app/ssd1306test/main.cc
@@ -6,7 +6,7 @@
#include "arch.h"
#include "driver/gpio.h"
#include "driver/stdout.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/arch/msp430fr5969lp/driver/i2c.cc b/src/arch/msp430fr5969lp/driver/i2c.cc
index a923f88..7c6cbbf 100644
--- a/src/arch/msp430fr5969lp/driver/i2c.cc
+++ b/src/arch/msp430fr5969lp/driver/i2c.cc
@@ -35,7 +35,7 @@ inline void await_i2c_int(unsigned int ie_flags, unsigned int ifg_flags)
signed char I2C::setup()
{
-#ifdef I2C_PULLUP_FIXED_GPIO
+#ifdef CONFIG_I2C_PULLUP_FIXED_GPIO
P1DIR |= BIT4 | BIT5;
P1OUT |= BIT4 | BIT5;
#endif
diff --git a/src/arch/msp430fr5994lp/driver/i2c.cc b/src/arch/msp430fr5994lp/driver/i2c.cc
index 589a68c..b1ca5fc 100644
--- a/src/arch/msp430fr5994lp/driver/i2c.cc
+++ b/src/arch/msp430fr5994lp/driver/i2c.cc
@@ -35,7 +35,7 @@ inline void await_i2c_int(unsigned int ie_flags, unsigned int ifg_flags)
signed char I2C::setup()
{
-#ifdef I2C_PULLUP_FIXED_GPIO
+#ifdef CONFIG_I2C_PULLUP_FIXED_GPIO
P8DIR |= BIT2 | BIT3;
P8OUT |= BIT2 | BIT3;
#endif
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"