From 86a47de181f59a21689754a1e068463f02b35834 Mon Sep 17 00:00:00 2001 From: Nav Date: Wed, 16 Mar 2022 17:10:16 +0000 Subject: [PATCH] EDBG Control protocol set parameter command --- .../EDBGControl/SetParameter.hpp | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/CommandFrames/EDBGControl/SetParameter.hpp diff --git a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/CommandFrames/EDBGControl/SetParameter.hpp b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/CommandFrames/EDBGControl/SetParameter.hpp new file mode 100644 index 00000000..e70900b6 --- /dev/null +++ b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/CommandFrames/EDBGControl/SetParameter.hpp @@ -0,0 +1,35 @@ +#pragma once + +#include + +#include "EdbgControlCommandFrame.hpp" + +namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr::CommandFrames::EdbgControl +{ + class SetParameter: public EdbgControlCommandFrame> + { + public: + explicit SetParameter(const EdbgParameter& parameter, unsigned char value) { + assert(parameter.size == 1); + + /* + * The EDBG Set Parameter command consists of 6 bytes: + * + * 1. Command ID (0x01) + * 2. Version (0x00) + * 3. Parameter context + * 4. Parameter + * 5. Parameter size + * 6. Parameter value + */ + this->payload = { + 0x01, + 0x00, + parameter.context, + parameter.id, + parameter.size, + value, + }; + } + }; +}