/* Enable or disable the specified analog watchdog interrupts.  */
void ADC_AWD_IntCmd(CM_ADC_TypeDef *ADCx, uint16_t u16IntType, en_functional_state_t enNewState)
/* Enable or disable the specified analog watchdog interrupts.  */
void ADC_AWD_IntCmd(CM_ADC_TypeDef *ADCx, uint16_t u16IntType, en_functional_state_t enNewState)
{
    DDL_ASSERT(IS_ADC_UNIT(ADCx));
    DDL_ASSERT(IS_ADC_AWD_INT(u16IntType));
    DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState));
    static uint16_t u16AWDIntSeq = 0U;
    if (enNewState == ENABLE) {
        SET_REG16_BIT(ADCx->AWDCR, u16IntType | ADC_AWDCR_AWDIEN);
        u16AWDIntSeq |= u16IntType;
    } else {
        u16AWDIntSeq &= ~u16IntType;
        CLR_REG16_BIT(ADCx->AWDCR, u16IntType);
        if (u16AWDIntSeq == 0U) {
            CLR_REG16_BIT(ADCx->AWDCR, ADC_AWDCR_AWDIEN);
        }
    }
}