/* Configure channel parameters by channel or operation.Support configure several channels at the same time.  */
TSC_ErrorTypeDef TSC_SetChannelCfg(TSC_Module *TSC_Def, TSC_ChnCfg *ChnCfg, uint32_t Channels)
/* Configure channel parameters by channel or operation.Support configure several channels at the same time.  */
TSC_ErrorTypeDef TSC_SetChannelCfg(TSC_Module *TSC_Def, TSC_ChnCfg *ChnCfg, uint32_t Channels)
{
    TSC_ErrorTypeDef err;
    if (TSC_Def != TSC)
        return TSC_ERROR_PARAMETER;
    if (0 == ChnCfg)
        return TSC_ERROR_PARAMETER;
    err = TSC_ConfigInternalResistor(TSC_Def, Channels, ChnCfg->TSC_ResisValue);
    if (err != TSC_ERROR_OK)
        return err;
    err = TSC_ConfigThreshold(TSC_Def, Channels, ChnCfg->TSC_Base, ChnCfg->TSC_Delta);
    return err;
}