加入大疆C板例程bsp

This commit is contained in:
2026-04-12 20:34:47 +08:00
parent 7475077b9e
commit b68ac54a34
51 changed files with 5950 additions and 1290 deletions

22
bsp/boards/bsp_crc32.c Normal file
View File

@@ -0,0 +1,22 @@
#include "bsp_crc32.h"
#include "main.h"
extern CRC_HandleTypeDef hcrc;
uint32_t get_crc32_check_sum(uint32_t *data, uint32_t len)
{
return HAL_CRC_Calculate(&hcrc, data, len);
}
bool_t verify_crc32_check_sum(uint32_t *data, uint32_t len)
{
static uint32_t crc32;
crc32 = get_crc32_check_sum(data, len-1);
return (crc32 == data[len-1]);
}
void append_crc32_check_sum(uint32_t *data, uint32_t len)
{
uint32_t crc32;
crc32 = get_crc32_check_sum(data, len-1);
data[len-1] = crc32;
}