35 lines
662 B
C++
35 lines
662 B
C++
/*
|
|
* commands.h
|
|
*
|
|
* Created on: 11 èþíÿ 2016 ã.
|
|
* Author: Sergey
|
|
*/
|
|
|
|
#ifndef COMMANDS_H_
|
|
#define COMMANDS_H_
|
|
|
|
#include <cstdint>
|
|
|
|
constexpr uint32_t FourCC(char const p[5]) {
|
|
return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
|
|
}
|
|
|
|
struct CommandId {
|
|
static constexpr auto Unknown = FourCC("unkn");
|
|
static constexpr auto EEPROMReadBuffer = FourCC("EeRd");
|
|
static constexpr auto EEPROMWriteBuffer = FourCC("EeWr");
|
|
static constexpr auto Echo = FourCC("Echo");
|
|
};
|
|
|
|
struct CmdEEPROMReadBufferArgs {
|
|
uint32_t startAddress;
|
|
uint32_t size;
|
|
};
|
|
|
|
struct CmdEEPROMWriteBufferArgs {
|
|
uint32_t startAddress;
|
|
uint32_t size;
|
|
};
|
|
|
|
#endif /* COMMANDS_H_ */
|