Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 043ba08
Merge: eb0d626 277a5d5
Author: OnlineCaveman <[email protected]>
Date:   Fri Oct 28 22:09:18 2022 +0200

    Merge branch 'w5500'

commit 277a5d5
Merge: cf44c4e 187ab2e
Author: OnlineCaveman <[email protected]>
Date:   Fri Oct 28 19:35:32 2022 +0200

    Merge branch 'w5500' of https://github.com/OnlineCaveman/knx-samd51 into w5500

commit cf44c4e
Author: OnlineCaveman <[email protected]>
Date:   Fri Oct 28 19:35:02 2022 +0200

    Added functionality for W5500

    Initialisation works. Compiling fails on "htonl" expansion. If commented out it compiles fine.

commit 187ab2e
Merge: b0238cf eef3a85
Author: OnlineCaveman <[email protected]>
Date:   Thu Oct 27 14:30:17 2022 +0200

    Merge branch 'thelsing:master' into w5500

commit eb0d626
Merge: b0238cf eef3a85
Author: OnlineCaveman <[email protected]>
Date:   Thu Oct 27 14:29:49 2022 +0200

    Merge branch 'thelsing:master' into master

commit b0238cf
Author: OnlineCaveman <[email protected]>
Date:   Tue Oct 25 17:28:00 2022 +0200

    Changed comment lines

    Changed the comment lines to reflect the current possibilities TP and RF

commit d24f6de
Author: OnlineCaveman <[email protected]>
Date:   Tue Oct 25 17:24:55 2022 +0200

    Added the RF (0x27B0)

    Added checks for RF 0x27B0 as that should work ootb I suppose.

    Builds and uploads successfully.
    Gives the debug output "ERROR, RF transceiver not responding" since I have no RF hw to test.

    Same goes for the TP 0x07B0. Build and uploads successfully.
    Gives the debug output "ERROR, TPUART not responding" since no I have no TP uart hw to test.

commit 7373ab0
Author: OnlineCaveman <[email protected]>
Date:   Tue Oct 25 16:19:53 2022 +0200

    No IP version yet

commit 7676257
Author: OnlineCaveman <[email protected]>
Date:   Tue Oct 25 15:56:34 2022 +0200

    Ifdef include requested change

commit 02565a0
Author: OnlineCaveman <[email protected]>
Date:   Mon Oct 17 21:10:23 2022 +0200

    Cleanup

    Removed unnecesary Qspi stuff for now. Compiles fine for samd51 and samd21. Have no samd21 platform or tpuart to do thorough testing but nothing fundamental was changed in samd_platform other than the ifdef checks.

commit 598f6bd
Merge: 37e056a b403480
Author: OnlineCaveman <[email protected]>
Date:   Mon Oct 17 20:38:08 2022 +0200

    Merge branch 'master' of https://github.com/OnlineCaveman/knx-samd51

commit 37e056a
Author: OnlineCaveman <[email protected]>
Date:   Mon Oct 17 20:37:44 2022 +0200

    ARCH_SAMD

    Now checking for __SAMD21__ and __SAMD51__ in knx_facade, samd_platform (samd21) and samd51_platform (samd51)

    Preparation for external flash functionality in platform.h

commit b403480
Merge: c0e5621 a0134e6
Author: OnlineCaveman <[email protected]>
Date:   Mon Oct 17 19:59:28 2022 +0200

    Merge branch 'thelsing:master' into master

commit c0e5621
Author: OnlineCaveman <[email protected]>
Date:   Mon Oct 17 19:52:10 2022 +0200

    Rename back to original

commit 6c4a10e
Author: OnlineCaveman <[email protected]>
Date:   Mon Oct 17 19:51:31 2022 +0200

    Fault in change tracking

    Renaming subdir knx to force changes

commit b8107fd
Author: OnlineCaveman <[email protected]>
Date:   Mon Oct 17 19:48:09 2022 +0200

    SAMD51/SAMD21 files

    Separate files for SAMD51 and SAMD21 platforms.

commit 4248a1f
Author: OnlineCaveman <[email protected]>
Date:   Sat Oct 15 16:15:32 2022 +0200

    Updated for samd51 flash storage compatibility
  • Loading branch information
thelsing committed Sep 13, 2024
1 parent ae60d24 commit a510042
Show file tree
Hide file tree
Showing 10 changed files with 646 additions and 172 deletions.
5 changes: 5 additions & 0 deletions examples/knx-demo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.pio
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch
20 changes: 18 additions & 2 deletions examples/knx-demo/platformio-ci.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

;--- SAMD --------------------------------------------------
;--- SAMD21 --------------------------------------------------
[env:adafruit_feather_m0_rf]
platform = atmelsam
board = adafruit_feather_m0
Expand All @@ -21,8 +21,24 @@ build_flags =
-DMASK_VERSION=0x27B0
-Wno-unknown-pragmas
-DUSE_DATASECURE
;-----------------------------------------------------------

;--- SAMD51 --------------------------------------------------

[env:feather_m4_w5500]
platform = atmelsam
board = adafruit_feather_m4
framework = arduino

lib_deps =
WifiManager
knx
Ethernet

build_flags =
-DMASK_VERSION=0x57B0
-DUSE_W5X00=1
-DKNX_NO_SPI=1
-Wno-unknown-pragmas

;--- ESP8266 -----------------------------------------------
[env:nodemcuv2_ip]
Expand Down
21 changes: 7 additions & 14 deletions examples/knx-demo/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ 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
knx
knx=file://../../../knx

build_flags =
-DMASK_VERSION=0x27B0
Expand All @@ -39,11 +38,10 @@ build_flags =
#framework = arduino
; We consider that the this projects is opened within its project directory
; while working with VS Code.
#lib_extra_dirs = ../../../

#lib_deps =
# WifiManager
# knx
# knx=file://../../../knx

#build_flags =
# -DMASK_VERSION=0x57B0
Expand All @@ -55,11 +53,10 @@ 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_deps =
[email protected]
knx
knx=file://../../../knx

build_flags =
-DMASK_VERSION=0x07B0
Expand All @@ -75,11 +72,10 @@ 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 =
https://github.com/tzapu/WiFiManager.git
knx
knx=file://../../../knx

build_flags =
-DMASK_VERSION=0x57B0
Expand All @@ -91,10 +87,9 @@ 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
knx=file://../../../knx

build_flags =
-DMASK_VERSION=0x07B0
Expand All @@ -107,10 +102,9 @@ board = genericSTM32F103CB
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
knx=file://../../../knx

build_flags =
-DENABLE_HWSERIAL1
Expand All @@ -130,10 +124,9 @@ board = genericSTM32F103CB
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
knx=file://../../../knx

build_flags =
-DENABLE_HWSERIAL1
Expand Down
12 changes: 8 additions & 4 deletions src/knx.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,11 @@ package platform
{
class Platform [[class_platform.html]]
class ArduinoPlatform [[class_arduino_platform.html]]
class SamdPlatform [[class_samd_platform.html]]
class Samd21Platform [[class_samd21_platform.html]]
class Samd51Platform [[class_samd51_platform.html]]
Platform<|--ArduinoPlatform
ArduinoPlatform<|--SamdPlatform
ArduinoPlatform<|--Samd21Platform
ArduinoPlatform<|--Samd51Platform
class EspPlatform [[class_esp_platform.html]]
ArduinoPlatform<|--EspPlatform
class Esp32Platform [[class_esp32_platform.html]]
Expand Down Expand Up @@ -219,9 +221,11 @@ package platform
{
class Platform [[class_platform.html]]
class ArduinoPlatform [[class_arduino_platform.html]]
class SamdPlatform [[class_samd_platform.html]]
class Samd21Platform [[class_samd21_platform.html]]
class Samd51Platform [[class_samd51_platform.html]]
Platform<|--ArduinoPlatform
ArduinoPlatform<|--SamdPlatform
ArduinoPlatform<|--Samd21Platform
ArduinoPlatform<|--Samd51Platform
class EspPlatform [[class_esp_platform.html]]
ArduinoPlatform<|--EspPlatform
class Esp32Platform [[class_esp32_platform.html]]
Expand Down
113 changes: 62 additions & 51 deletions src/knx/knx_facade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,65 +44,76 @@ ICACHE_RAM_ATTR void buttonEvent()
}
#endif

#ifdef ARDUINO_ARCH_SAMD
// predefined global instance for TP or RF or TP/RF coupler
#if MASK_VERSION == 0x07B0
Knx::KnxFacade<Knx::SamdPlatform, Knx::Bau07B0> knx(buttonEvent);
#elif MASK_VERSION == 0x27B0
Knx::KnxFacade<Knx::SamdPlatform, Knx::Bau27B0> knx(buttonEvent);
#elif MASK_VERSION == 0x2920
Knx::KnxFacade<Knx::SamdPlatform, Knx::Bau2920> knx(buttonEvent);
#else
#error "Mask version not supported on ARDUINO_ARCH_SAMD"
#endif
#ifdef __SAMD51__
// predefined global instance for TP or RF
#if MASK_VERSION == 0x07B0
Knx::KnxFacade<Knx::Samd51Platform, Knx::Bau07B0> knx(buttonEvent);
#elif MASK_VERSION == 0x27B0
Knx::KnxFacade<Knx::Samd51Platform, Knx::Bau2920> knx(buttonEvent);
#elif MASK_VERSION == 0x57B0
Knx::KnxFacade<Knx::Samd51Platform, Knx::Bau57B0> knx(buttonEvent);
#else
#error "Mask version not supported on SAMD51"
#endif
#elif defined(_SAMD21_)
// predefined global instance for TP or RF or TP/RF coupler
#if MASK_VERSION == 0x07B0
Knx::KnxFacade<Knx::Samd21Platform, Knx::Bau07B0> knx(buttonEvent);
#elif MASK_VERSION == 0x27B0
Knx::KnxFacade<Knx::Samd21Platform, Knx::Bau27B0> knx(buttonEvent);
#elif MASK_VERSION == 0x2920
Knx::KnxFacade<Knx::Samd21Platform, Knx::Bau2920> knx(buttonEvent);
#else
#error "Mask version not supported on SAMD21"
#endif
#elif defined(ARDUINO_ARCH_RP2040)
// predefined global instance for TP or RF or IP or TP/RF coupler or TP/IP coupler
#if MASK_VERSION == 0x07B0
Knx::KnxFacade<Knx::RP2040ArduinoPlatform, Knx::Bau07B0> knx(buttonEvent);
#elif MASK_VERSION == 0x27B0
Knx::KnxFacade<Knx::RP2040ArduinoPlatform, Knx::Bau27B0> knx(buttonEvent);
#elif MASK_VERSION == 0x57B0
Knx::KnxFacade<Knx::RP2040ArduinoPlatform, Knx::Bau57B0> knx(buttonEvent);
#elif MASK_VERSION == 0x2920
Knx::KnxFacade<Knx::RP2040ArduinoPlatform, Knx::Bau2920> knx(buttonEvent);
#elif MASK_VERSION == 0x091A
Knx::KnxFacade<Knx::RP2040ArduinoPlatform, Knx::Bau091A> knx(buttonEvent);
#else
#error "Mask version not supported on ARDUINO_ARCH_RP2040"
#endif
// predefined global instance for TP or RF or IP or TP/RF coupler or TP/IP coupler
#if MASK_VERSION == 0x07B0
Knx::KnxFacade<Knx::RP2040ArduinoPlatform, Knx::Bau07B0> knx(buttonEvent);
#elif MASK_VERSION == 0x27B0
Knx::KnxFacade<Knx::RP2040ArduinoPlatform, Knx::Bau27B0> knx(buttonEvent);
#elif MASK_VERSION == 0x57B0
Knx::KnxFacade<Knx::RP2040ArduinoPlatform, Knx::Bau57B0> knx(buttonEvent);
#elif MASK_VERSION == 0x2920
Knx::KnxFacade<Knx::RP2040ArduinoPlatform, Knx::Bau2920> knx(buttonEvent);
#elif MASK_VERSION == 0x091A
Knx::KnxFacade<Knx::RP2040ArduinoPlatform, Knx::Bau091A> knx(buttonEvent);
#else
#error "Mask version not supported on ARDUINO_ARCH_RP2040"
#endif

#elif defined(ARDUINO_ARCH_ESP8266)
// predefined global instance for TP or IP or TP/IP coupler
#if MASK_VERSION == 0x07B0
Knx::KnxFacade<Knx::EspPlatform, Knx::Bau07B0> knx(buttonEvent);
#elif MASK_VERSION == 0x57B0
Knx::KnxFacade<Knx::EspPlatform, Knx::Bau57B0> knx(buttonEvent);
#elif MASK_VERSION == 0x091A
Knx::KnxFacade<Knx::EspPlatform, Knx::Bau091A> knx(buttonEvent);
#else
#error "Mask version not supported on ARDUINO_ARCH_ESP8266"
#endif
// predefined global instance for TP or IP or TP/IP coupler
#if MASK_VERSION == 0x07B0
Knx::KnxFacade<Knx::EspPlatform, Knx::Bau07B0> knx(buttonEvent);
#elif MASK_VERSION == 0x57B0
Knx::KnxFacade<Knx::EspPlatform, Knx::Bau57B0> knx(buttonEvent);
#elif MASK_VERSION == 0x091A
Knx::KnxFacade<Knx::EspPlatform, Knx::Bau091A> knx(buttonEvent);
#else
#error "Mask version not supported on ARDUINO_ARCH_ESP8266"
#endif

#elif defined(ARDUINO_ARCH_ESP32)
// predefined global instance for TP or IP or TP/IP coupler
#if MASK_VERSION == 0x07B0
Knx::KnxFacade<Knx::Esp32Platform, Knx::Bau07B0> knx(buttonEvent);
#elif MASK_VERSION == 0x57B0
Knx::KnxFacade<Knx::Esp32Platform, Knx::Bau57B0> knx(buttonEvent);
#elif MASK_VERSION == 0x091A
Knx::KnxFacade<Knx::Esp32Platform, Knx::Bau091A> knx(buttonEvent);
#else
#error "Mask version not supported on ARDUINO_ARCH_ESP32"
#endif
// predefined global instance for TP or IP or TP/IP coupler
#if MASK_VERSION == 0x07B0
Knx::KnxFacade<Knx::Esp32Platform, Knx::Bau07B0> knx(buttonEvent);
#elif MASK_VERSION == 0x57B0
Knx::KnxFacade<Knx::Esp32Platform, Knx::Bau57B0> knx(buttonEvent);
#elif MASK_VERSION == 0x091A
Knx::KnxFacade<Knx::Esp32Platform, Knx::Bau091A> knx(buttonEvent);
#else
#error "Mask version not supported on ARDUINO_ARCH_ESP32"
#endif

#elif defined(ARDUINO_ARCH_STM32)
#if MASK_VERSION == 0x07B0
Knx::KnxFacade<Knx::Stm32Platform, Knx::Bau07B0> knx(buttonEvent);
#else
#error "Mask version not supported on ARDUINO_ARCH_STM32"
#endif
#if MASK_VERSION == 0x07B0
Knx::KnxFacade<Knx::Stm32Platform, Knx::Bau07B0> knx(buttonEvent);
#else
#error "Mask version not supported on ARDUINO_ARCH_STM32"
#endif
#else // Non-Arduino platforms and Linux platform
// no predefined global instance
// no predefined global instance
#endif

#endif // KNX_NO_AUTOMATIC_GLOBAL_INSTANCE
Loading

0 comments on commit a510042

Please sign in to comment.