/**************************************************************************//** * @file crc.h * @version V1.00 * @brief M480 series CRC driver header file * * @copyright (C) 2016 Nuvoton Technology Corp. All rights reserved. *****************************************************************************/ #ifndef __CRC_H__ #define __CRC_H__ #ifdef __cplusplus extern "C" { #endif /** @addtogroup Standard_Driver Standard Driver @{ */ /** @addtogroup CRC_Driver CRC Driver @{ */ /** @addtogroup CRC_EXPORTED_CONSTANTS CRC Exported Constants @{ */ /*---------------------------------------------------------------------------------------------------------*/ /* CRC Polynomial Mode Constant Definitions */ /*---------------------------------------------------------------------------------------------------------*/ #define CRC_CCITT (0UL << CRC_CTL_CRCMODE_Pos) /*!SEED = (u32Seed); CRC->CTL |= CRC_CTL_CHKSINIT_Msk; }while(0) /** * @brief Get CRC Seed Value * * @param None * * @return CRC seed value * * @details This macro gets the current CRC seed value. * \hideinitializer */ #define CRC_GET_SEED() (CRC->SEED) /** * @brief CRC Write Data * * @param[in] u32Data Write data * * @return None * * @details User can write data directly to CRC Write Data Register(CRC_DAT) by this macro to perform CRC operation. * \hideinitializer */ #define CRC_WRITE_DATA(u32Data) (CRC->DAT = (u32Data)) void CRC_Open(uint32_t u32Mode, uint32_t u32Attribute, uint32_t u32Seed, uint32_t u32DataLen); uint32_t CRC_GetChecksum(void); /*@}*/ /* end of group CRC_EXPORTED_FUNCTIONS */ /*@}*/ /* end of group CRC_Driver */ /*@}*/ /* end of group Standard_Driver */ #ifdef __cplusplus } #endif #endif /*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/