/* param base CRC peripheral address. param config CRC protocol configuration structure  */
void CRC_GetConfig(CRC_Type *base, crc_config_t *config)
/* param base CRC peripheral address. param config CRC protocol configuration structure  */
void CRC_GetConfig(CRC_Type *base, crc_config_t *config)
{
    uint32_t mode = base->MODE;
    config->polynomial =
        (crc_polynomial_t)(uint32_t)(((uint32_t)(mode & CRC_MODE_CRC_POLY_MASK)) >> CRC_MODE_CRC_POLY_SHIFT);
    config->reverseIn     = (bool)(mode & CRC_MODE_BIT_RVS_WR_MASK);
    config->complementIn  = (bool)(mode & CRC_MODE_CMPL_WR_MASK);
    config->reverseOut    = (bool)(mode & CRC_MODE_BIT_RVS_SUM_MASK);
    config->complementOut = (bool)(mode & CRC_MODE_CMPL_SUM_MASK);
    base->MODE = mode & ~((1U << CRC_MODE_BIT_RVS_SUM_SHIFT) | (1U << CRC_MODE_CMPL_SUM_SHIFT));
    config->seed = base->SUM;
    base->MODE = mode;
}