Go to the documentation of this file.
46 #include "stm32h7xx_hal.h"
57 #ifdef HAL_CRC_MODULE_ENABLED
299 for (index = 0U; index < BufferLength; index++)
307 temp = CRC_Handle_8(
hcrc, (uint8_t *)pBuffer, BufferLength);
311 temp = CRC_Handle_16(
hcrc, (uint16_t *)(
void *)pBuffer, BufferLength);
355 for (index = 0U; index < BufferLength; index++)
364 temp = CRC_Handle_8(
hcrc, (uint8_t *)pBuffer, BufferLength);
369 temp = CRC_Handle_16(
hcrc, (uint16_t *)(
void *)pBuffer, BufferLength);
441 for (i = 0U; i < (BufferLength / 4U); i++)
444 ((uint32_t)pBuffer[(4U * i) + 1U] << 16U) | \
445 ((uint32_t)pBuffer[(4U * i) + 2U] << 8U) | \
446 (uint32_t)pBuffer[(4U * i) + 3U];
449 if ((BufferLength % 4U) != 0U)
451 if ((BufferLength % 4U) == 1U)
455 if ((BufferLength % 4U) == 2U)
457 data = ((uint16_t)(pBuffer[4U * i]) << 8U) | (uint16_t)pBuffer[(4U * i) + 1U];
461 if ((BufferLength % 4U) == 3U)
463 data = ((uint16_t)(pBuffer[4U * i]) << 8U) | (uint16_t)pBuffer[(4U * i) + 1U];
491 for (i = 0U; i < (BufferLength / 2U); i++)
493 hcrc->
Instance->
DR = ((uint32_t)pBuffer[2U * i] << 16U) | (uint32_t)pBuffer[(2U * i) + 1U];
495 if ((BufferLength % 2U) != 0U)
498 *pReg = pBuffer[2U * i];
#define assert_param(expr)
Include module's header file.
uint32_t InputDataInversionMode
#define IS_DEFAULT_POLYNOMIAL(DEFAULT)
HAL_StatusTypeDef HAL_CRC_Init(CRC_HandleTypeDef *hcrc)
HAL_StatusTypeDef
HAL Status structures definition
#define IS_CRC_ALL_INSTANCE(INSTANCE)
#define IS_DEFAULT_INIT_VALUE(VALUE)
uint8_t DefaultInitValueUse
#define DEFAULT_INIT_VALUE_ENABLE
#define DEFAULT_CRC_INITVALUE
#define DEFAULT_CRC32_POLY
#define DEFAULT_POLYNOMIAL_ENABLE
#define CLEAR_BIT(REG, BIT)
uint32_t HAL_CRC_Accumulate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t BufferLength)
#define CRC_POLYLENGTH_32B
#define MODIFY_REG(REG, CLEARMASK, SETMASK)
__IO HAL_CRC_StateTypeDef State
uint32_t GeneratingPolynomial
HAL_StatusTypeDef HAL_CRCEx_Polynomial_Set(CRC_HandleTypeDef *hcrc, uint32_t Pol, uint32_t PolyLength)
CRC Handle Structure definition.
#define __HAL_UNLOCK(__HANDLE__)
uint32_t HAL_CRC_Calculate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t BufferLength)
HAL_StatusTypeDef HAL_CRC_DeInit(CRC_HandleTypeDef *hcrc)
#define __HAL_CRC_DR_RESET(__HANDLE__)
Reset CRC Data Register.
#define WRITE_REG(REG, VAL)
HAL_CRC_StateTypeDef HAL_CRC_GetState(CRC_HandleTypeDef *hcrc)
#define IS_CRC_INPUTDATA_FORMAT(FORMAT)
#define IS_CRC_INPUTDATA_INVERSION_MODE(MODE)
uint8_t DefaultPolynomialUse
uint32_t OutputDataInversionMode
void HAL_CRC_MspInit(CRC_HandleTypeDef *hcrc)
CRC MSP Initialization This function configures the hardware resources used in this example.
#define IS_CRC_OUTPUTDATA_INVERSION_MODE(MODE)
HAL_CRC_StateTypeDef
CRC HAL State Structure definition.
void HAL_CRC_MspDeInit(CRC_HandleTypeDef *hcrc)
CRC MSP De-Initialization This function freeze the hardware resources used in this example.