/* param base LPCMP peripheral base address. param config Pointer to "lpcmp_dac_config_t" structure. If config is "NULL", disable internal DAC.  */
void LPCMP_SetDACConfig(LPCMP_Type *base, const lpcmp_dac_config_t *config)
/* param base LPCMP peripheral base address. param config Pointer to "lpcmp_dac_config_t" structure. If config is "NULL", disable internal DAC.  */
void LPCMP_SetDACConfig(LPCMP_Type *base, const lpcmp_dac_config_t *config)
{
    uint32_t tmp32;
    if (config == NULL)
    {
        tmp32 = 0U;
    }
    else
    {
        tmp32 = LPCMP_DCR_VRSEL(config->referenceVoltageSource) | LPCMP_DCR_DAC_DATA(config->DACValue);
        if (config->enableLowPowerMode)
        {
            tmp32 |= LPCMP_DCR_DAC_HPMD_MASK;
        }
        tmp32 |= LPCMP_DCR_DAC_EN_MASK;
    }
    base->DCR = tmp32;
}