/*******************************************************************************
* Copyright (C) 2012-2013, FocalTech Systems (R)£¬All Rights Reserved.
*
* File Name: CfgAutoTune.h
*
* Author: linjianjun
*
* Created: 2014-01-03
*
* Abstract: This file includes all data structures for panel automatic tuning.
*
* ×¢òa£¬½á11ìå×÷ÎaáaoÏìåμÄ3éÔ±£¬2»ÄüòÔêy×é¿aí·£¬2»è»3õê¼»ˉ£¬óÅÏè′|àíoffset3éÔ±
* μ¼ÖÂ1y¶à3õê¼»ˉ±¨′í
* Reference:
*
*******************************************************************************/
#ifndef __CFG_AUTO_TUNE_H__
#define __CFG_AUTO_TUNE_H__
/*******************************************************************************
* Conditional Compiler Options
*******************************************************************************/
#if (FT_SENSOR_PATTERN_TYPE != FT_2_POINTS_PATTERN)
/*******************************************************************************
* 1.Included files
*******************************************************************************/
#include "CfgPlatform.h"
#include "CfgGlobal.h"
/*******************************************************************************
* 2.Global constant and macro definitions using #define
*******************************************************************************/
//------------------------------------------------------------------------------
/*
* 1. projrct information
*/
/*
* Pattern Type:
* 0: 3-3-3 or 4-4-4 triangle pattern
* 1: 2-4-2 or 1-2-1 triangle pattern
*/
#define PATTERN_TYPE 0x01
#define I2C_SLAVE_ADDR 0x70
#define CFG_PANEL_VENDOR_ID 0x11
#define CFG_PROJECT_CODE "FTS0000P000"
#define CFG_CUSTOMER_CODE "0000"
//------------------------------------------------------------------------------
/*
* IC Type
*/
/*
* FT6236U 0 //40 Pin 28Ch
* FT6336G 1 //40 Pin 31Ch
* FT6336U 2 //48 Pin 39Ch
* FT6436U 3 //56 Pin 46Ch
*/
#define CHIP_TYPE 0
/*
* 1. Channel Information
*/
/* VA area CH number */
#define TP_CHANNEL_NUM 20
/* virtually key area CH number*/
#define TP_KEY_NUM 0
/* virtually key number */
#define TP_LOGIC_KEY_NUM 3
/* How many chnanels from last is invalid*/
#define KEY_CH_INVALID_NUM 0
#define TP_CHANNEL_ORDER {9,10,8,11,7,12,6,13,5,14,4,15,3,16,2,17,1,18,0,19}
//------------------------------------------------------------------------------
/*
*2. AFE setting information
*/
/*
* AFE Scan mode
* 0: Single mode
* 1: Double mode(Scan two channels at one time)
* 2: Four mode (Scan four channels at one time)
* 3: Eight mode (Scan eight channels at one time)
* "Double mode" will improve the anti power noise ability
* Usually use 3(Eight mode) as default
*/
#define AFE_SCAN_MODE 3
/*
* Seleted sensor scan times for every channel, we will get the ACC value of
* all times for the raw data
* scan times = (AFE_SAMPLE_CYCLE + 1) * 8
* Max value 31
* More scan times will get more accuracy, but lower report rate.
* Usually use 7 as default for Single mode and 15 as default for multi scan mode
*/
#define AFE_SAMPLE_CYCLE 15
/*
* AFE water proof level selection
* 0: No Water proof;
* 1: Level 1;
* 2: Level 2;
* 3: Level 3;
* Usually use 3(Level 3) as default
*/
#define AFE_WATERPROOF_LVL 3
/*
* AFE scan frequency is (AFE clock / (AFE_SCAN_K1_DELAY + AFE_SCAN_K2_DELAY)) Khz.
* For example, if AFE_CLK_DIV = 10, AFE_SCAN_K1_DELAY=12, AFE_SCAN_K2_DELAY=18,
* AFE scan frequency is "3000/(12+18) = 100 Khz".
*/
/*
* Set scan sample time (K1_Delay), the range is
* Eight mode from 0x07 to 0xff.
* Four mode from 0x05 to 0xff.
* Double mode from 0x04 to 0xff.
*/
#define AFE_SCAN_K1_AREA1 28//36//23
/*
* Set scan charge time (K2_Delay), the range is
* Eight mode from 0x07 to 0xff.
* Four mode from 0x06 to 0xff.
* Double mode from 0x04 to 0xff.
*/
#define AFE_SCAN_K2_AREA1 38//36//23
/*
* ADC sample mode
* 0-> Single sampling 1->Bilateral sampling
* Usually use 1 as default
*/
#define AFE_SAMPLE_MODE 1
/*
* NLC ACTION ENABLE
*/
#define AFE_NLC_EN 0
/*
* THRESHOLD OF NLC faction
*/
#define AFE_NLC_THR 312
/*
* IIR FACTION ENABLE
*/
#define AFE_IIR_EN 0
//------------------------------------------------------------------------------
/* halitus handle afe paramter */
#define AFE_SAMPLE_CYCLE_HALITUS 0
/* = AFE SCAN K1 AREA1 */
#define AFE_SCAN_K1_AREA1_HALITUS 27
/* = AFE SCAN K2 AREA1 */
#define AFE_SCAN_K2_AREA1_HALITUS 27
#define AFE_WATERPROOF_LVL_HALITUS 0
//------------------------------------------------------------------------------
/* HOPPING HANDLE AFE PARAMTER */
#define AFE_SAMPLE_CYCLE_MAIN 0
/* = AFE SCAN K1 AREA1 */
#define AFE_SCAN_K1_AREA1_MAIN 27
/* = AFE SCAN K2 AREA1 */
#define AFE_SCAN_K2_AREA1_MAIN 27
/* = AFE WATERPROOF LVL */
#define AFE_WATERPROOF_LVL_MAIN 3
/* = AFE SCAN K1 AREA1 + 2 */
#define AFE_SCAN_K1_AREA1_ASSIST1 29
/* = AFE SCAN K2 AREA1 + 2 */
#define AFE_SCAN_K2_AREA1_ASSIST1 29
/* = AFE SCAN K1 AREA1 + 4 */
#define AFE_SCAN_K1_AREA1_ASSIST2 31
/* = AFE SCAN K2 AREA1 + 4 */
#define AFE_SCAN_K2_AREA1_ASSIST2 31
/* = AFE SCAN K1 AREA1 + 8 */
#define AFE_SCAN_K1_AREA1_ASSIST3 35
/* = AFE SCAN K2 AREA1 + 8 */
#define AFE_SCAN_K2_AREA1_ASSIST3 35
/* = AFE SCAN K1 AREA1 + 12 */
#define AFE_SCAN_K1_AREA1_ASSIST4 39
/* = AFE SCAN K2 AREA1 + 12 */
#define AFE_SCAN_K2_AREA1_ASSIST4 39
//------------------------------------------------------------------------------
/* ¶t′ÎD£Õy */
#define _SECOND_AUTO_CLB_EN 0
#define CLB_RAWDATA_MAX 18384
#define CLB_RAWDATA_MIN 14384
//------------------------------------------------------------------------------
/*
*4. TP Tuning information
*/
/*
TUNING_STEP_INITIAL 0
TUNING_STEP_TB_LINE_TOUCH_HANDLE 1
TUNING_STEP_BORDER_SHIFT_MANUAL_HANDLE 2
TUNING_STEP_BORDER_SPECIAL_HANDLE 3
TUNING_STEP_X_SHIFT_COMPENSATE 4
TUNING_STEP_LR_LINE_TOUCH_HANDLE 5
TUNING_STEP_FINISHED 6
*/
/* default = TUNING_STEP_FINISHED */
#define COORDINATE_TUNING_STEP 6
/*==============================================================================
* (1) Set COORDINATE_TUNING_STEP to "TUNING_STEP_INITIAL"
* Tuning mapping related parameters to make the center of X
*==============================================================================*/
#define X_CENTER_SHIFT 0
/*====================================================================================
* (2) Set COORDINATE_TUNING_STEP to "TUNING_STEP_TB_LINE_TOUCH_HANDLE"
* make the Y coordinate in the top and bottom area more accurate.
*
*===================================================================================*/
/*
* Enable this function will make the Y coordinate in the top and bottom area more accurate.
* Some parameters should be specified when enable this function
* 0: Disable line touch funciton
* 1: Enable line touch function for top and bottom border
*/
#define _TB_LINE_TOUCH_HANDLE_EN 0
/*
* Virtual channel panel order index in the top area(First two) and bottom area(Second two)
* These two virtual channel's line layout should be near the top/bottom area
* 0xFF means that do NOT need to be handled
* {Top1, Top2, Bottom1, Bottom2}
*/
#define TB_LINETOUCH_VIRTUAL_CH_IDX {4, (TP_CHANNEL_NUM>>1)+4, TP_CHANNEL_NUM,(TP_CHANNEL_NUM + 1)}
|