Add demo-coupler for MCUs

This commit is contained in:
Nanosonde 2020-09-04 17:42:30 +02:00
parent e544824042
commit 28d0f7ada9
5 changed files with 163 additions and 25 deletions

View File

@ -0,0 +1,38 @@
#include <knx.h>
void setup()
{
Serial.begin(115200);
ArduinoPlatform::SerialDebug = &Serial;
randomSeed(millis());
// read adress table, association table, groupobject table and parameters from eeprom
knx.readMemory();
// print values of parameters if device is already configured
if (knx.configured())
{
Serial.println("Coupler configured.");
}
// pin or GPIO the programming led is connected to. Default is LED_BUILTIN
// knx.ledPin(LED_BUILTIN);
// is the led active on HIGH or low? Default is LOW
// knx.ledPinActiveOn(HIGH);
// pin or GPIO programming button is connected to. Default is 0
// knx.buttonPin(0);
// start the framework.
knx.start();
}
void loop()
{
// don't delay here to much. Otherwise you might lose packages or mess up the timing with ETS
knx.loop();
// only run the application code if the device was configured with ETS
if (!knx.configured())
return;
}

View File

@ -0,0 +1,43 @@
;PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
;--- SAMD --------------------------------------------------
[env:adafruit_feather_m0_tp_rf]
platform = atmelsam
board = adafruit_feather_m0
framework = arduino
lib_deps =
SPI
https://github.com/thelsing/FlashStorage.git
knx
build_flags =
-DMASK_VERSION=0x2920
-Wno-unknown-pragmas
;-----------------------------------------------------------
;--- ESP8266 -----------------------------------------------
;---------------------------------------------------------
;--- ESP32 -----------------------------------------------
[env:esp32dev_ip_tp]
platform = espressif32
board = esp32dev
framework = arduino
lib_deps =
knx
build_flags =
-DMASK_VERSION=0x091A
-Wno-unknown-pragmas

View File

@ -0,0 +1,56 @@
;PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
; We have to keep libdeps dir out the project directory otherwise,
; library scanner seems to have issues so compilation fails
libdeps_dir = /tmp/libdeps
src_dir = .
;--- SAMD --------------------------------------------------
[env:adafruit_feather_m0_tp_rf]
platform = atmelsam
board = adafruit_feather_m0
framework = arduino
; We consider that the this projects is opened within its project directory
; while working with VS Code.
lib_extra_dirs = ../../../
lib_deps =
SPI
https://github.com/thelsing/FlashStorage.git
knx
build_flags =
-DMASK_VERSION=0x2920
-Wno-unknown-pragmas
;-----------------------------------------------------------
;--- ESP8266 -----------------------------------------------
;---------------------------------------------------------
;--- ESP32 -----------------------------------------------
[env:esp32dev_ip_tp]
platform = espressif32
board = esp32dev
framework = arduino
; We consider that the this projects is opened within its project directory
; while working with VS Code.
lib_extra_dirs = ../../../
lib_deps =
knx
build_flags =
-DMASK_VERSION=0x091A
-Wno-unknown-pragmas

View File

@ -9,7 +9,7 @@
; https://docs.platformio.org/page/projectconf.html
;--- SAMD --------------------------------------------------
[env:adafruit_feather_m0]
[env:adafruit_feather_m0_rf]
platform = atmelsam
board = adafruit_feather_m0
framework = arduino
@ -25,23 +25,23 @@ build_flags =
;--- ESP8266 -----------------------------------------------
[env:nodemcuv2]
platform = espressif8266
board = nodemcuv2
framework = arduino
lib_deps =
WifiManager
knx
#[env:nodemcuv2]
#platform = espressif8266
#board = nodemcuv2
#framework = arduino
#lib_deps =
# WifiManager
# knx
build_flags =
-DMASK_VERSION=0x57B0
-Wno-unknown-pragmas
#build_flags =
# -DMASK_VERSION=0x57B0
# -Wno-unknown-pragmas
;---------------------------------------------------------
;--- ESP32 -----------------------------------------------
[env:esp32dev]
[env:esp32dev_ip]
platform = espressif32
board = esp32dev
framework = arduino

View File

@ -14,7 +14,7 @@ libdeps_dir = /tmp/libdeps
src_dir = .
;--- SAMD --------------------------------------------------
[env:adafruit_feather_m0]
[env:adafruit_feather_m0_rf]
platform = atmelsam
board = adafruit_feather_m0
framework = arduino
@ -34,27 +34,27 @@ build_flags =
;--- ESP8266 -----------------------------------------------
[env:nodemcuv2]
platform = espressif8266
board = nodemcuv2
framework = arduino
#[env:nodemcuv2]
#platform = espressif8266
#board = nodemcuv2
#framework = arduino
; We consider that the this projects is opened within its project directory
; while working with VS Code.
lib_extra_dirs = ../../../
#lib_extra_dirs = ../../../
lib_deps =
WifiManager@0.15.0
knx
#lib_deps =
# WifiManager
# knx
build_flags =
-DMASK_VERSION=0x57B0
-Wno-unknown-pragmas
#build_flags =
# -DMASK_VERSION=0x57B0
# -Wno-unknown-pragmas
;---------------------------------------------------------
;--- ESP32 -----------------------------------------------
[env:esp32dev]
[env:esp32dev_ip]
platform = espressif32
board = esp32dev
framework = arduino
@ -68,3 +68,4 @@ lib_deps =
build_flags =
-DMASK_VERSION=0x57B0
-Wno-unknown-pragmas