Implemented first version of Chm30Utility

This commit is contained in:
Yury Shuvakin
2025-03-17 19:12:22 +09:00
commit 6be3459a37
83 changed files with 10515 additions and 0 deletions

21
CanStructs.cpp Normal file
View File

@@ -0,0 +1,21 @@
#include "CanStructs.h"
uint32_t CanId::serialize() const
{
uint32_t id = 0;
id |= source;
id |= destination << 8;
id |= command << 16;
id |= device << 22;
id |= error << 26;
return id;
}
void CanId::deserialize(uint32_t id)
{
source = id & 0xFF;
destination = (id >> 8) & 0xFF;
command = (id >> 16) & 0x3F;
device = (id >> 22) & 0xF;
error = (id >> 26) & 0x3;
}