久久精品国产精品国产一区,少妇扒开毛毛自慰喷水,国产精品无码电影在线观看 ,久久天天躁夜夜躁狠狠85麻豆

思澈科技軟件開發(fā)工具包  2.20
CRC

CRC模塊可用于進行特定位寬,任意生成多項式,任意初始值的CRC計算。數(shù)據(jù)最小輸入單元為單字節(jié),沒有最長字節(jié)數(shù)限制。單周期即能夠完成單字節(jié)輸入的計算。數(shù)據(jù)輸入全部完成后即可快速得到校驗結果。支持輸入數(shù)據(jù)倒轉和輸出數(shù)據(jù)倒轉。支持不同有效位寬的輸入數(shù)據(jù)。

  • 7/8/16/32比特CRC計算,支持這些位寬所有主流格式
  • 任意生成多項式
  • 任意初始值
  • 輸入數(shù)據(jù)支持單字節(jié)/雙字節(jié)/三字節(jié)/四字節(jié)有效位寬
  • 輸入數(shù)據(jù)按字節(jié)/雙字節(jié)/四字節(jié)高低位比特倒轉
  • 輸出數(shù)據(jù)高低位比特倒轉

使用 CRC

以下是CRC的代碼片段:

{
CRC_HandleTypeDef CrcHandle; // CRC handle declaration
CrcHandle.Instance = CRC; // Initialize CRC handle
uint8_t g_test_data[]= { // Raw data
1,2,3,4,5,6,7,8,9,10
}
HAL_CRC_Init(&CrcHandle); // Initialize CRC module
HAL_CRC_Setmode(&CrcHandle, CRC_8_ITU); // Set CRC mode to CRC-8/ITU standard
uint32_t crc=HAL_CRC_Accumulate(&CrcHandle, // Calculate CRC result for g_test_data
&(g_test_data[offset]), sizeof(g_test_data));
}

使用完全自定義的初始值和多項式

{
CRC_HandleTypeDef CrcHandle; // CRC handle declaration
CrcHandle.Instance = CRC; // Initialize CRC handle
uint8_t g_test_data[]= { // Raw data
1,2,3,4,5,6,7,8,9,10
}
uint32_t init = 0xFF; // Initial value
uint32_t poly = 0x1D; // CRC polynomial
HAL_CRC_Init(&CrcHandle); // Initialize CRC module
HAL_CRC_Setmode_Customized(hcrc, init, poly, CRC_8); // Set CRC mode to CRC-8 standard
uint32_t crc=HAL_CRC_Accumulate(&CrcHandle, // Calculate CRC result for g_test_data
&(g_test_data[offset]), sizeof(g_test_data));
}
HAL_CRC_Setmode
void HAL_CRC_Setmode(CRC_HandleTypeDef *hcrc, HAL_CRC_Mode mode)
Set CRC mode for calculation.
CRC_HandleTypeDef
Definition: bf0_hal_crc.h:123
HAL_CRC_Accumulate
uint32_t HAL_CRC_Accumulate(CRC_HandleTypeDef *hcrc, uint8_t *pBuffer, uint32_t BufferLength)
Computes the 32-bit CRC of 32-bit data buffer using combination of the previous CRC value and the new...
CRC_HandleTypeDef::Instance
CRC_TypeDef * Instance
Definition: bf0_hal_crc.h:124
HAL_CRC_Setmode_Customized
void HAL_CRC_Setmode_Customized(CRC_HandleTypeDef *hcrc, uint32_t init, uint32_t poly, HAL_CRC_Mode mode)
Set Cutomized CRC mode for calculation.
HAL_CRC_Init
HAL_StatusTypeDef HAL_CRC_Init(CRC_HandleTypeDef *hcrc)
Initializes the CRC according to the specified parameters in the CRC_InitTypeDef and creates the asso...