/*
 * Copyright (c) 2022, Shenzhen CVA Innovation CO.,LTD
 * All rights reserved.
 *
 * Shenzhen CVA Innovation CO.,LTD (CVA chip) is supplying this file for use
 * exclusively with CVA's microcontroller products. This file can be freely
 * distributed within development tools that are supporting such microcontroller
 * products.
 *
 * THIS SOFTWARE IS PROVIDED "AS IS".  NO WARRANTIES, WHETHER EXPRESS, IMPLIED
 * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
 * CVA SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL,
 * OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
*/

/******************************************************************************
 * the includes
 *****************************************************************************/

#include "touch_config.h"

/*******************************************************************************
 * the defines
 ******************************************************************************/

/*******************************************************************************
 * the typedefs
 ******************************************************************************/

/*******************************************************************************
 * the globals
 ******************************************************************************/
const TouchDrv_PhaseCfgType g_touchPhaseCfg[APP_TOUCH_SCAN_PHASE_NUM] =
{
    /* phase0 config */
    {
        .phaseIndex = TOUCHDRV_Phase0,

        .tk00Func = TOUCHDRV_CSIO_FUNC_NONE,
        .tk01Func = TOUCHDRV_CSIO_FUNC_NONE,
        .tk02Func = TOUCHDRV_CSIO_FUNC_NONE,
        .tk03Func = TOUCHDRV_CSIO_FUNC_NONE,
        .tk04Func = TOUCHDRV_CSIO_FUNC_NONE,
        .tk05Func = TOUCHDRV_CSIO_FUNC_NONE,
        .tk06Func = TOUCHDRV_CSIO_FUNC_NONE,
        .tk07Func = TOUCHDRV_CSIO_FUNC_NONE,
        .tk08Func = TOUCHDRV_CSIO_FUNC_NONE,
        .tk09Func = TOUCHDRV_CSIO_FUNC_NONE,
        .tk10Func = TOUCHDRV_CSIO_FUNC_NONE,
        .tk11Func = TOUCHDRV_CSIO_FUNC_NONE,
        .tk12Func = TOUCHDRV_CSIO_FUNC_NONE,
        .tk13Func = TOUCHDRV_CSIO_FUNC_NONE,
        .tk14Func = TOUCHDRV_CSIO_FUNC_NONE,
        .tk15Func = TOUCHDRV_CSIO_FUNC_NONE,
		
        .tk16Func = TOUCHDRV_CSIO_FUNC_NONE,
        .tk17Func = TOUCHDRV_CSIO_FUNC_NONE,
        .tk18Func = TOUCHDRV_CSIO_FUNC_NONE,
        .tk19Func = TOUCHDRV_CSIO_FUNC_NONE,
        .tk20Func = TOUCHDRV_CSIO_FUNC_NONE,
        .tk21Func = TOUCHDRV_CSIO_FUNC_NONE,
        .tk22Func = TOUCHDRV_CSIO_FUNC_NONE,
        .tk23Func = TOUCHDRV_CSIO_FUNC_NONE,
        .tk24Func = TOUCHDRV_CSIO_FUNC_NONE,
        .tk25Func = TOUCHDRV_CSIO_FUNC_NONE,
        .tk26Func = TOUCHDRV_CSIO_FUNC_NONE,
        .tk27Func = TOUCHDRV_CSIO_FUNC_NONE,
        .tk28Func = TOUCHDRV_CSIO_FUNC_SHD,
        .tk29Func = TOUCHDRV_CSIO_FUNC_INPUT,

        .afeMode = TOUCHDRV_SELF_LIGHT,
        .bitSel = 10,
        .cf = 14,
        .rf = 0,
        .rfEn = 0,
        .freq = 18,
        .num = TOUCHDRV_NSMP_2048,
        .trst = 2,
        .td = 0,

        .adcFltEn = 0,
        .adcFltWin = 0,
        .adcFltInCoef = 0,
        .adcFltUnderCoef = 0,
        .adcFltOverCoef = 0,
    },
};

TouchDrv_CfgType g_touchCfg =
{
    .phaseCfg = g_touchPhaseCfg,
    .phaseCfgNum = APP_TOUCH_SCAN_PHASE_NUM,

    .irqEn = TOUCHDRV_IRQ_CONVDONE_EN,
    .scanPeriod = 5,
    .dozeMul = TOUCHDRV_DOZE_MUL_BYPASS,
    .sensingPhaseSel = TOUCHDRV_Phase0_MASK,
    .autoDetectionPhaseSel = TOUCHDRV_PhaseNone_MASK,
    .ndPhaseSel = TOUCHDRV_PhaseNone_MASK,
    .touchAndSel = TOUCHDRV_PhaseNone_MASK,
    .noTouchAndSel = TOUCHDRV_PhaseNone_MASK,
    .senScen = 0,
};

/*******************************************************************************
 * the functions
 ******************************************************************************/
