/* Check the CRC16 calculating result with the expected value.  */
en_flag_status_t CRC_CRC16_CheckData(uint16_t u16InitValue, uint8_t u8DataWidth, const void *pvData, uint32_t u32Len, uint16_t u16ExpectValue)
/* Check the CRC16 calculating result with the expected value.  */
en_flag_status_t CRC_CRC16_CheckData(uint16_t u16InitValue, uint8_t u8DataWidth, const void *pvData, uint32_t u32Len, uint16_t u16ExpectValue)
{
    __IO uint32_t u32Count = CRC_CALC_CLK_COUNT;
    en_flag_status_t enStatus = RESET;
    uint32_t u32Expect_Value = u16ExpectValue;
    if ((pvData != NULL) && (u32Len != 0UL)) {
        (void)CRC_CRC16_Calculate(u16InitValue, u8DataWidth, pvData, u32Len);
        u32Expect_Value = CRC_ConvertCrcValue(u32Expect_Value);
        (void)CRC_WriteData16((uint16_t *)((void *)&u32Expect_Value), 1UL);
        while (u32Count-- != 0UL) {
            __NOP();
        }
        enStatus = CRC_GetResultStatus();
    }
    return enStatus;
}