From 0ad2d7dce3ec9d3541c09fe9404dab97d8c02073 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Tue, 4 Apr 2023 18:51:34 +0200 Subject: [PATCH] Support C33 --- src/local/BLELocalDevice.cpp | 20 ++++++++++++++++++++ src/utility/HCIUartTransport.cpp | 2 ++ 2 files changed, 22 insertions(+) diff --git a/src/local/BLELocalDevice.cpp b/src/local/BLELocalDevice.cpp index 20de8222..79e43bf5 100644 --- a/src/local/BLELocalDevice.cpp +++ b/src/local/BLELocalDevice.cpp @@ -73,6 +73,26 @@ int BLELocalDevice::begin() // BT_REG_ON -> HIGH pinMode(BT_REG_ON, OUTPUT); digitalWrite(BT_REG_ON, HIGH); +#elif defined(ARDUINO_PORTENTA_C33) +#define NINA_GPIO0 (100) +#define NINA_RESETN (101) + pinMode(NINA_GPIO0, OUTPUT); + pinMode(NINA_RESETN, OUTPUT); + Serial5.begin(921600); + + digitalWrite(NINA_GPIO0, HIGH); + delay(100); + digitalWrite(NINA_RESETN, HIGH); + digitalWrite(NINA_RESETN, LOW); + digitalWrite(NINA_RESETN, HIGH); + auto _start = millis(); + while (millis() - _start < 500) { + if (Serial5.available()) { + Serial5.read(); + } + } + //pinMode(94, OUTPUT); + //digitalWrite(94, LOW); #endif diff --git a/src/utility/HCIUartTransport.cpp b/src/utility/HCIUartTransport.cpp index 1b1a513a..1cd44495 100644 --- a/src/utility/HCIUartTransport.cpp +++ b/src/utility/HCIUartTransport.cpp @@ -29,6 +29,8 @@ // SerialHCI is already defined in the variant #elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION) #define SerialHCI Serial2 +#elif defined(ARDUINO_PORTENTA_C33) +#define SerialHCI Serial5 #else #error "Unsupported board selected!" #endif