/**
  ******************************************************************************
  * @file     CRC_CFG.c
  * @author   SINOMCU-AE
  * @brief    CRC config
  *    
  *          This file provides functions to CRC config:
  *              CRC32:X32+X26+X23+X22+X16+X12+X11+X10+X8+X7+X5+X4+X2+X+1
  *              POLY:04C11DB7,init:FFFFFFFF;
  *    check result:http://www.ip33.com/crc.html ,XOR FFFFFFF,need ~result;
  ******************************************************************************
  * @attention 
  *                           DISCLAIMER
  * The present firmware which is for guidance only aims at providing customers
  * with coding information regarding their products in order for them to save
  * time. As a result, SinoMCU shall not be held liable for any direct,indirect
  * or consequential damages with respect to any claims arising from the content 
  * of such firmware and/or the use made by customers of the coding information 
  * contained herein in connection with their products.
  *
  * <h2><center>&copy; Copyright (c) 2021 sinomcu All rights reserved.</center></h2>
  *
  ******************************************************************************
  */

#include "CRC_CFG.h"

/**
  * @brief  CRC Initialization Function
  * @param  None
  * @retval None
  */
void crc_init(void) {
  MS32_CRC_InitTypeDef CrcInitStruct;
  MS32_CRC_StructInit(&CrcInitStruct);
  CrcInitStruct.InitValue = MS32_CRC_DEFAULT_CRC_INITVALUE;               // INT FFFFFFFF
  CrcInitStruct.InputDataInversionMode  = MS32_CRC_INDATA_REVERSE_BYTE;   // REFIN  yes
  CrcInitStruct.OutputDataInversionMode = MS32_CRC_OUTDATA_REVERSE_BIT;   // REFOUT yes
  MS32_CRC_Init(&CrcInitStruct);                                          // init function had enable clock
}

/******************************** END OF FILE *********************************/
