diff --git a/CISLibrary/tools/CRC.cpp b/CISLibrary/tools/CRC.cpp new file mode 100644 index 00000000..7ceb5b35 --- /dev/null +++ b/CISLibrary/tools/CRC.cpp @@ -0,0 +1,22 @@ +#pragma once + +#include "CRC.h" + +#define key 0x2F + +char CRC8(const char * data, int length) { + char crc = 0x00; + for (int i = 0; i < length; ++i) { + crc ^= *(data + i); + + for (int j = 0; j < 8; ++j) { + if ((crc & 0x80)) { + crc = ((crc << 1) ^ key); + } else { + crc <<= 1; + } + } + } + + return crc; +} \ No newline at end of file diff --git a/CISLibrary/tools/CRC.h b/CISLibrary/tools/CRC.h new file mode 100644 index 00000000..5ff87436 --- /dev/null +++ b/CISLibrary/tools/CRC.h @@ -0,0 +1,3 @@ +#pragma once + +char CRC8(const char * data, int length); \ No newline at end of file diff --git a/CougSat1-ADCS/docs/IHU communication.pdf b/CougSat1-ADCS/docs/IHU communication.pdf new file mode 100644 index 00000000..08d36756 Binary files /dev/null and b/CougSat1-ADCS/docs/IHU communication.pdf differ diff --git a/CougSat1-IHU/docs/IHU communication.pdf b/CougSat1-IHU/docs/IHU communication.pdf new file mode 100644 index 00000000..08d36756 Binary files /dev/null and b/CougSat1-IHU/docs/IHU communication.pdf differ