Updated DebugTool interface and implemented getRiscVDebugInterface() for WCH-Link debug tools

This commit is contained in:
Nav
2023-11-21 22:04:27 +00:00
parent 826da3e921
commit 9e223f9f9f
2 changed files with 22 additions and 2 deletions

View File

@@ -3,12 +3,14 @@
#include "TargetInterfaces/TargetPowerManagementInterface.hpp" #include "TargetInterfaces/TargetPowerManagementInterface.hpp"
#include "TargetInterfaces/Microchip/AVR/AVR8/Avr8DebugInterface.hpp" #include "TargetInterfaces/Microchip/AVR/AVR8/Avr8DebugInterface.hpp"
#include "TargetInterfaces/Microchip/AVR/AvrIspInterface.hpp"
#include "src/Targets/Microchip/AVR/AVR8/Avr8TargetConfig.hpp" #include "src/Targets/Microchip/AVR/AVR8/Avr8TargetConfig.hpp"
#include "src/Targets/Microchip/AVR/AVR8/Family.hpp" #include "src/Targets/Microchip/AVR/AVR8/Family.hpp"
#include "src/Targets/Microchip/AVR/AVR8/TargetParameters.hpp" #include "src/Targets/Microchip/AVR/AVR8/TargetParameters.hpp"
#include "src/Targets/TargetRegister.hpp"
#include "TargetInterfaces/Microchip/AVR/AvrIspInterface.hpp" #include "TargetInterfaces/RiscV/RiscVDebugInterface.hpp"
#include "src/Targets/TargetRegister.hpp"
/** /**
* A debug tool can be any device that provides access to the connected target. Debug tools are usually connected * A debug tool can be any device that provides access to the connected target. Debug tools are usually connected
@@ -97,6 +99,20 @@ public:
return nullptr; return nullptr;
} }
/**
* All debug tools that support interfacing with RISC-V targets must provide an implementation of the
* RiscVDebugInterface class, via this function.
*
* For debug tools that do not support this interface, a nullptr should be returned.
*
* Note: the caller of this function will not manage the lifetime of the returned instance.
*
* @return
*/
virtual DebugToolDrivers::TargetInterfaces::RiscV::RiscVDebugInterface* getRiscVDebugInterface() {
return nullptr;
}
[[nodiscard]] bool isInitialised() const { [[nodiscard]] bool isInitialised() const {
return this->initialised; return this->initialised;
} }

View File

@@ -32,6 +32,10 @@ namespace DebugToolDrivers::Wch
std::string getFirmwareVersionString() override; std::string getFirmwareVersionString() override;
DebugToolDrivers::TargetInterfaces::RiscV::RiscVDebugInterface* getRiscVDebugInterface() override {
return this->wchLinkInterface.get();
}
protected: protected:
WchLinkVariant variant; WchLinkVariant variant;