From ed5188a2ef87f20a2ed0b1f96b0d91cfa95eb221 Mon Sep 17 00:00:00 2001 From: Nav Date: Wed, 16 Mar 2022 17:39:08 +0000 Subject: [PATCH] EDBG target power management interface for Curiosity Nano debug tool --- .../Microchip/CuriosityNano/CuriosityNano.cpp | 6 ++++++ .../Microchip/CuriosityNano/CuriosityNano.hpp | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/DebugToolDrivers/Microchip/CuriosityNano/CuriosityNano.cpp b/src/DebugToolDrivers/Microchip/CuriosityNano/CuriosityNano.cpp index 3847b77d..1e5a90b4 100644 --- a/src/DebugToolDrivers/Microchip/CuriosityNano/CuriosityNano.cpp +++ b/src/DebugToolDrivers/Microchip/CuriosityNano/CuriosityNano.cpp @@ -8,6 +8,8 @@ namespace Bloom::DebugToolDrivers using namespace Protocols::CmsisDap::Edbg::Avr; using namespace Bloom::Exceptions; + using Protocols::CmsisDap::Edbg::EdbgTargetPowerManagementInterface; + void CuriosityNano::init() { UsbDevice::init(); @@ -30,6 +32,10 @@ namespace Bloom::DebugToolDrivers this->startSession(); } + this->targetPowerManagementInterface = std::make_unique( + this->edbgInterface + ); + this->edbgAvr8Interface = std::make_unique(this->edbgInterface); this->edbgAvrIspInterface = std::make_unique(this->edbgInterface); diff --git a/src/DebugToolDrivers/Microchip/CuriosityNano/CuriosityNano.hpp b/src/DebugToolDrivers/Microchip/CuriosityNano/CuriosityNano.hpp index d9715377..c97c324a 100644 --- a/src/DebugToolDrivers/Microchip/CuriosityNano/CuriosityNano.hpp +++ b/src/DebugToolDrivers/Microchip/CuriosityNano/CuriosityNano.hpp @@ -7,8 +7,12 @@ #include "src/DebugToolDrivers/DebugTool.hpp" #include "src/DebugToolDrivers/USB/UsbDevice.hpp" #include "src/DebugToolDrivers/USB/HID/HidInterface.hpp" + #include "src/DebugToolDrivers/Protocols/CMSIS-DAP/CmsisDapInterface.hpp" #include "src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/EdbgInterface.hpp" + +#include "src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/EdbgTargetPowerManagementInterface.hpp" + #include "src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.hpp" #include "src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvrIspInterface.hpp" #include "src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/CommandFrames/AvrCommandFrames.hpp" @@ -41,6 +45,10 @@ namespace Bloom::DebugToolDrivers return this->edbgInterface; } + DebugToolDrivers::TargetInterfaces::TargetPowerManagementInterface* getTargetPowerManagementInterface() override { + return this->targetPowerManagementInterface.get(); + } + TargetInterfaces::Microchip::Avr::Avr8::Avr8DebugInterface* getAvr8DebugInterface() override { return this->edbgAvr8Interface.get(); } @@ -74,6 +82,9 @@ namespace Bloom::DebugToolDrivers Protocols::CmsisDap::Edbg::EdbgInterface edbgInterface = Protocols::CmsisDap::Edbg::EdbgInterface(); std::unique_ptr edbgAvr8Interface = nullptr; std::unique_ptr edbgAvrIspInterface = nullptr; + std::unique_ptr< + Protocols::CmsisDap::Edbg::EdbgTargetPowerManagementInterface + > targetPowerManagementInterface = nullptr; bool sessionStarted = false; };