EDBG Control protocol set parameter command
This commit is contained in:
@@ -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,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user