/*
 * 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_widget_config.h"

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

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

/*******************************************************************************
 * the globals
 ******************************************************************************/

/* button config */
ButtonDrv_ElemCfgType g_button0ElementsCfg[TOUCH_BUTTON0_ELEMENT_NUM] =
{
    {
        .phase = TOUCHDRV_Phase0,
        .thr = 500,
        .hyst = 100,
        .onDebNum = 2,
        .offDebNum = 2,
        .onMaxNum = 0,
        .rawFltCoef = 256,//256
        .baseFltPosCoef = 2, //16/1024 = 1/64
        .baseFltNegCoef = 256, //256/1024 = 1/4
    },
};

ButtonDrv_ElemVarType g_button0ElementsVar[TOUCH_BUTTON0_ELEMENT_NUM];

ButtonDrv_WidgetCfgType g_buttonsCfg[TOUCH_BUTTON_NUM] =
{
    {
        .elementNum = TOUCH_BUTTON0_ELEMENT_NUM,
        .autoDetectionEn = false,
        .elemsCfg = g_button0ElementsCfg,
    },
};

ButtonDrv_WidgetVarType g_buttonsVar[TOUCH_BUTTON_NUM] =
{
    {
        .event = BUTTON_STATE_OFF,
        .elemsVar = g_button0ElementsVar,
    },
};

ButtonDrv_CfgType g_button_cfg =
{
    .buttonNum = TOUCH_BUTTON_NUM,
    .buttonsCfg = g_buttonsCfg,
    .buttonsVar = g_buttonsVar,
    .touchDrvCfg = &g_touchCfg,
};


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