/* param base CMP peripheral base address. param config Pointer to the configuration structure. "NULL" disables the feature.  */
void CMP_SetDACConfig(CMP_Type *base, const cmp_dac_config_t *config)
/* param base CMP peripheral base address. param config Pointer to the configuration structure. "NULL" disables the feature.  */
void CMP_SetDACConfig(CMP_Type *base, const cmp_dac_config_t *config)
{
    uint8_t tmp8 = 0U;
    if (NULL == config)
    {
        base->DACCR = 0U;
        return;
    }
    tmp8 |= CMP_DACCR_DACEN_MASK;
    if (kCMP_VrefSourceVin2 == config->referenceVoltageSource)
    {
        tmp8 |= CMP_DACCR_VRSEL_MASK;
    }
    tmp8 |= CMP_DACCR_VOSEL(config->DACValue);
    base->DACCR = tmp8;
}