EDBG Control protocol set parameter command

This commit is contained in:
Nav
2022-03-16 17:10:16 +00:00
parent acb38c3a64
commit 86a47de181

View File

@@ -0,0 +1,35 @@
#pragma once
#include <cstdint>
#include "EdbgControlCommandFrame.hpp"
namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr::CommandFrames::EdbgControl
{
class SetParameter: public EdbgControlCommandFrame<std::array<unsigned char, 6>>
{
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,
};
}
};
}