/**************************************************************************//** * @file crc.h * @version V1.00 * $Revision: 2 $ * $Date: 15/12/01 9:57a $ * @brief NUC472/NUC442 series CRC driver header file * * @note * Copyright (C) 2015 Nuvoton Technology Corp. All rights reserved. *****************************************************************************/ #ifndef __CRC_H__ #define __CRC_H__ #ifdef __cplusplus extern "C" { #endif /** @addtogroup NUC472_442_Device_Driver NUC472/NUC442 Device Driver @{ */ /** @addtogroup NUC472_442_CRC_Driver CRC Driver @{ */ /** @addtogroup NUC472_442_CRC_EXPORTED_CONSTANTS CRC Exported Constants @{ */ /*---------------------------------------------------------------------------------------------------------*/ /* CRC Polynomial Mode Constant Definitions */ /*---------------------------------------------------------------------------------------------------------*/ #define CRC_CCITT 0x00000000UL /*!SEED = (u32Seed); CRC->CTL |= CRC_CTL_CRCRST_Msk; } /** * @brief Get CRC Seed Value * * @param None * * @return CRC seed value * * @details This macro gets the current CRC seed value. */ #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. */ #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 NUC472_442_CRC_EXPORTED_FUNCTIONS */ /*@}*/ /* end of group NUC472_442_CRC_Driver */ /*@}*/ /* end of group NUC472_442_Device_Driver */ #ifdef __cplusplus } #endif #endif //__CRC_H__ /*** (C) COPYRIGHT 2015 Nuvoton Technology Corp. ***/