EDBG target power management interface for Xplained Nano debug tool

This commit is contained in:
Nav
2022-03-16 17:38:52 +00:00
parent 80e5678ddf
commit 78b96ed277
2 changed files with 17 additions and 0 deletions

View File

@@ -8,6 +8,8 @@ namespace Bloom::DebugToolDrivers
using namespace Protocols::CmsisDap::Edbg::Avr; using namespace Protocols::CmsisDap::Edbg::Avr;
using namespace Bloom::Exceptions; using namespace Bloom::Exceptions;
using Protocols::CmsisDap::Edbg::EdbgTargetPowerManagementInterface;
void XplainedNano::init() { void XplainedNano::init() {
UsbDevice::init(); UsbDevice::init();
@@ -30,6 +32,10 @@ namespace Bloom::DebugToolDrivers
this->startSession(); this->startSession();
} }
this->targetPowerManagementInterface = std::make_unique<EdbgTargetPowerManagementInterface>(
this->edbgInterface
);
this->edbgAvr8Interface = std::make_unique<EdbgAvr8Interface>(this->edbgInterface); this->edbgAvr8Interface = std::make_unique<EdbgAvr8Interface>(this->edbgInterface);
this->setInitialised(true); this->setInitialised(true);
} }

View File

@@ -7,8 +7,12 @@
#include "src/DebugToolDrivers/DebugTool.hpp" #include "src/DebugToolDrivers/DebugTool.hpp"
#include "src/DebugToolDrivers/USB/UsbDevice.hpp" #include "src/DebugToolDrivers/USB/UsbDevice.hpp"
#include "src/DebugToolDrivers/USB/HID/HidInterface.hpp" #include "src/DebugToolDrivers/USB/HID/HidInterface.hpp"
#include "src/DebugToolDrivers/Protocols/CMSIS-DAP/CmsisDapInterface.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/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/EdbgAvr8Interface.hpp"
#include "src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/CommandFrames/AvrCommandFrames.hpp" #include "src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/CommandFrames/AvrCommandFrames.hpp"
@@ -40,6 +44,10 @@ namespace Bloom::DebugToolDrivers
return this->edbgInterface; return this->edbgInterface;
} }
DebugToolDrivers::TargetInterfaces::TargetPowerManagementInterface* getTargetPowerManagementInterface() override {
return this->targetPowerManagementInterface.get();
}
TargetInterfaces::Microchip::Avr::Avr8::Avr8DebugInterface* getAvr8DebugInterface() override { TargetInterfaces::Microchip::Avr::Avr8::Avr8DebugInterface* getAvr8DebugInterface() override {
return this->edbgAvr8Interface.get(); return this->edbgAvr8Interface.get();
} }
@@ -68,6 +76,9 @@ namespace Bloom::DebugToolDrivers
private: private:
Protocols::CmsisDap::Edbg::EdbgInterface edbgInterface = Protocols::CmsisDap::Edbg::EdbgInterface(); Protocols::CmsisDap::Edbg::EdbgInterface edbgInterface = Protocols::CmsisDap::Edbg::EdbgInterface();
std::unique_ptr<Protocols::CmsisDap::Edbg::Avr::EdbgAvr8Interface> edbgAvr8Interface = nullptr; std::unique_ptr<Protocols::CmsisDap::Edbg::Avr::EdbgAvr8Interface> edbgAvr8Interface = nullptr;
std::unique_ptr<
Protocols::CmsisDap::Edbg::EdbgTargetPowerManagementInterface
> targetPowerManagementInterface = nullptr;
bool sessionStarted = false; bool sessionStarted = false;
}; };