/* Calculate the CRC16 value and start with the specified initial value.  */
uint16_t CRC_CRC16_Calculate(uint16_t u16InitValue, uint8_t u8DataWidth, const void *pvData, uint32_t u32Len)
/* Calculate the CRC16 value and start with the specified initial value.  */
uint16_t CRC_CRC16_Calculate(uint16_t u16InitValue, uint8_t u8DataWidth, const void *pvData, uint32_t u32Len)
{
    uint16_t u16CrcValue = 0U;
    if ((pvData != NULL) && (u32Len != 0UL)) {
        WRITE_REG16(CM_CRC->RESLT, u16InitValue);
        u16CrcValue = CRC_CRC16_AccumulateData(u8DataWidth, pvData, u32Len);
    }
    return u16CrcValue;
}