bf0_hal_crc.h
Header file of CRC HAL module.
- Author
- Sifli software development team 
- Attention
Defines
- 
HAL_CRC_POLYSIZE_7
- 
HAL_CRC_POLYSIZE_8
- 
HAL_CRC_POLYSIZE_16
- 
HAL_CRC_POLYSIZE_32
- 
HAL_CRC_DATASIZE_8
- 
HAL_CRC_DATASIZE_16
- 
HAL_CRC_DATASIZE_24
- 
HAL_CRC_DATASIZE_32
- 
__HAL_CRC_RESET_HANDLE_STATE(__HANDLE__)
- Resets CRC handle state. - 参数:
- __HANDLE__ – CRC handle 
 
- 返回值:
- None – 
 
- 
__HAL_CRC_DR_RESET(__HANDLE__)
- Resets CRC Data Register. - 参数:
- __HANDLE__ – CRC handle 
 
- 返回值:
- None – 
 
- 
__HAL_CRC_SET_IDR(__HANDLE__, __VALUE__)
- Stores a 8-bit data in the Independent Data(ID) register. - 参数:
- __HANDLE__ – CRC handle 
- __VALUE__ – 8-bit value to be stored in the ID register 
 
- 返回值:
- None – 
 
- 
__HAL_CRC_GET_IDR(__HANDLE__)
- Returns the 8-bit data stored in the Independent Data(ID) register. - 参数:
- __HANDLE__ – CRC handle 
 
- 返回值:
- 8-bit – value of the ID register 
 
- 
IS_CRC_ALL_INSTANCE(__INSTANCE__)
Enums
- 
enum HAL_CRC_StateTypeDef
- Values: - 
enumerator HAL_CRC_STATE_RESET
- CRC not yet initialized or disabled 
 - 
enumerator HAL_CRC_STATE_READY
- CRC initialized and ready for use 
 - 
enumerator HAL_CRC_STATE_BUSY
- CRC internal process is ongoing 
 - 
enumerator HAL_CRC_STATE_TIMEOUT
- CRC timeout state 
 - 
enumerator HAL_CRC_STATE_ERROR
- CRC error state 
 
- 
enumerator HAL_CRC_STATE_RESET
- 
enum HAL_CRC_Mode
- Values: - 
enumerator CRC_7_MMC
 - 
enumerator CRC_8
 - 
enumerator CRC_8_ITU
 - 
enumerator CRC_8_ROHC
 - 
enumerator CRC_8_MAXIM
 - 
enumerator CRC_16_IBM
 - 
enumerator CRC_16_MAXIM
 - 
enumerator CRC_16_USB
 - 
enumerator CRC_16_MODBUS
 - 
enumerator CRC_16_CCITT
 - 
enumerator CRC_16_CCITT_FALSE
 - 
enumerator CRC_16_X25
 - 
enumerator CRC_16_XMODEM
 - 
enumerator CRC_16_DNP
 - 
enumerator CRC_32
 - 
enumerator CRC_32_MPEG_2
 - 
enumerator CRC_MODE_NUM
 
- 
enumerator CRC_7_MMC
Functions
- 
HAL_StatusTypeDef HAL_CRC_Init(CRC_HandleTypeDef *hcrc)
- Initializes the CRC according to the specified parameters in the CRC_InitTypeDef and creates the associated handle. - 参数:
- hcrc – pointer to a CRC_HandleTypeDef structure that contains the configuration information for CRC 
 
- 返回值:
- HAL – status 
 
- 
HAL_StatusTypeDef HAL_CRC_DeInit(CRC_HandleTypeDef *hcrc)
- DeInitializes the CRC peripheral. - 参数:
- hcrc – pointer to a CRC_HandleTypeDef structure that contains the configuration information for CRC 
 
- 返回值:
- HAL – status 
 
- 
void HAL_CRC_MspInit(CRC_HandleTypeDef *hcrc)
- Initializes the CRC MSP. - 参数:
- hcrc – pointer to a CRC_HandleTypeDef structure that contains the configuration information for CRC 
 
- 返回值:
- None – 
 
- 
void HAL_CRC_MspDeInit(CRC_HandleTypeDef *hcrc)
- DeInitializes the CRC MSP. - 参数:
- hcrc – pointer to a CRC_HandleTypeDef structure that contains the configuration information for CRC 
 
- 返回值:
- None – 
 
- 
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 one. - 参数:
- hcrc – pointer to a CRC_HandleTypeDef structure that contains the configuration information for CRC 
- pBuffer – pointer to the buffer containing the data to be computed 
- BufferLength – length of the buffer to be computed 
 
- 返回值:
- 32-bit – CRC 
 
- 
uint32_t HAL_CRC_Calculate(CRC_HandleTypeDef *hcrc, uint8_t *pBuffer, uint32_t BufferLength)
- Computes the 32-bit CRC of 32-bit data buffer independently of the previous CRC value. - 参数:
- hcrc – pointer to a CRC_HandleTypeDef structure that contains the configuration information for CRC 
- pBuffer – Pointer to the buffer containing the data to be computed 
- BufferLength – Length of the buffer to be computed 
 
- 返回值:
- 32-bit – CRC 
 
- 
void HAL_CRC_Setmode(CRC_HandleTypeDef *hcrc, HAL_CRC_Mode mode)
- Set CRC mode for calculation. - 参数:
- hcrc – pointer to a CRC_HandleTypeDef structure that contains the configuration information for CRC 
- mode – for CRC calculation, please ref to CRC Mode definition 
 
 
- 
void HAL_CRC_Setmode_Customized(CRC_HandleTypeDef *hcrc, uint32_t init, uint32_t poly, HAL_CRC_Mode mode)
- Set Cutomized CRC mode for calculation. - 参数:
- hcrc – pointer to a CRC_HandleTypeDef structure that contains the configuration information for CRC 
- init – initial CRC value 
- poly – Programmable polynomial 
- mode – Mode for CRC calculation, but use customized initial value and poly 
 
 
- 
HAL_CRC_StateTypeDef HAL_CRC_GetState(CRC_HandleTypeDef *hcrc)
- Get current state of CRC module. - 参数:
- hcrc – pointer to a CRC_HandleTypeDef structure that contains the configuration information for CRC 
 
- 返回值:
- Current – state of CRC module 
 
- 
struct CRC_HandleTypeDef
- Public Members - 
CRC_TypeDef *Instance
- Register base address 
 - 
HAL_LockTypeDef Lock
- CRC locking object 
 - 
HAL_CRC_StateTypeDef State
- CRC communication state 
 - 
HAL_CRC_Mode Mode
- CRC mode 
 
- 
CRC_TypeDef *Instance
