acid-drop

- Hacking the planet from a LilyGo T-Deck using custom firmware
git clone git://git.acid.vegas/acid-drop.git
Log | Files | Refs | Archive | README | LICENSE

BT532Constants.h (23489B)

      1 #pragma once
      2 
      3 
      4 
      5 /* COMMAND LIST (READ BYTE:0)*/
      6 // Software Reset
      7 #define SOFT_RESET_CMD_REG                   ((uint16_t)0x0000)
      8 // Wake Up
      9 #define WAKE_UP_CMD_REG                      ((uint16_t)0x0001)
     10 // Clearing the pended interrupt
     11 #define CLEAR_INT_CMD_REG                    ((uint16_t)0x0003)
     12 // Fall into the IDLE state : slow polling
     13 #define GO_IDLE_CMD_REG                      ((uint16_t)0x0004)
     14 // Fall into the SLEEP state : power saving
     15 #define GO_SLEEP_CMD_REG                     ((uint16_t)0x0005)
     16 #define CALIBRATE_CMD_REG                    ((uint16_t)0x0006)
     17 // Save the current status to the flash
     18 #define SAVE_STATUS_CMD_REG                  ((uint16_t)0x0007)
     19 #define SAVE_CAL_DATA_CMD_REG                ((uint16_t)0x0008)
     20 // Recall factory default status from flash
     21 #define FACTORY_DEFAULT_CMD_REG              ((uint16_t)0x000F)
     22 
     23 /* NORMAL CONFIGURE (READ BYTE:2)*/
     24 
     25 // Set/Load the current touch mode
     26 #define TOUCH_MODE_REG                       ((uint16_t)0x0010)
     27 // Chip Revision
     28 #define CHIP_REVISION_REG                    ((uint16_t)0x0011)
     29 // Firmware Version
     30 #define FIRMWARE_VERSION_REG                 ((uint16_t)0x0012)
     31 // Register Data Version. (for driver)
     32 #define REGISTER_DATA_VERSION_REG            ((uint16_t)0x0013)
     33 // HW ID
     34 #define HW_ID_REG                            ((uint16_t)0x0014)
     35 // Supported Max Finger Num is 10.
     36 #define SUPPORTED_FINGER_NUM_REG             ((uint16_t)0x0015)
     37 // Max Y Line Number
     38 #define MAX_Y_NUM_REG                        ((uint16_t)0x0016)
     39 /*
     40 Bit 0 : NOT USE 1ST BASELINE
     41 Bit 1 : NOT USE 2ND BASELINE
     42 Bit 2 : USE MINUS MAX FILTER
     43 Bit 3 : USE ONLY SINGLE COORD
     44 Bit 4 : USE SMALL PLAM CHECK
     45 Bit 5 : USE LARGE PALM CHECK
     46 Bit 6 : USE SINGLE COORD IN MULTI
     47 Bit 7 : USE SMALL NOISE DENSITY CHECK
     48 Bit 8 : USE BSR MP RATIO
     49 Bit 9 : NOT USE MULTI AREA COORD
     50 Bit 10 : USE MULTI AVERAGE COORD
     51 Bit 11 : RESERVED
     52 Bit 12 : USE ADPATIVE POINT FILTER
     53 Bit 13 : USE LOW PALM CHECK
     54 Bit 14 : NOT USE CUTOFF SENSITIVITY
     55 Bit 15 : USE BSR REF BASELINE
     56  */
     57 #define INTERNAL_FLAG_REG                    ((uint16_t)0x0017)
     58 
     59 /*
     60 EEPROM Info
     61 Bit 0 : CALIBRATION BIT
     62 Bit 1 : CONFIG INFO BIT (CHECK SUM)
     63 Bit 2 : UPGRADE INFO BIT
     64  */
     65 #define EEPROM_INFO_REG                      ((uint16_t)0x0018)
     66 
     67 // Set/Load the inital touch mode
     68 #define INITIAL_TOUCH_MODE_REG               ((uint16_t)0x0019)
     69 
     70 // Chip H/W Revision
     71 #define CHIP_HW_REVISION_REG                 ((uint16_t)0x001A)
     72 
     73 // Calibration N Data total number
     74 #define CAL_N_DATA_TOTAL_NUM_REG             ((uint16_t)0x001B)
     75 
     76 // IC VENDOR ID : “ZI” (ASCII Code: 0x5A49)
     77 #define IC_VENDOR_ID_REG                     ((uint16_t)0x001C)
     78 // TSM Module ID
     79 #define TSM_MODULE_ID_REG                    ((uint16_t)0x001E)
     80 #define CURRENT_RAW_VARIATION_REG            ((uint16_t)0x001F)
     81 #define DELAY_FOR_HOST_REG                   ((uint16_t)0x007C)
     82 #define SCAN_COUNT_FOR_HOST_REG              ((uint16_t)0x007D)
     83 #define DALAY_RAW_DATA_FOR_HOST_REG          ((uint16_t)0x007F)
     84 /*
     85 Bit 0 : USE DELY FOR HOST
     86 Bit 1 : USE AUTO DELAY FOR HOST
     87 Bit 2 : NOT USE CUTOFF WIDTH
     88 Bit 3 : RESERVED
     89 Bit 4 : NOT USE EDGE SCALING
     90 Bit 5 : USE AUTO DETECT NOISE
     91 Bit 6 : REVERSE ANGLE DIRECTION
     92 Bit 7 : USE EDGE ACTIVE UP
     93 Bit 8 : USE INIT VARIATION CHECK
     94 Bit 9 : USE REJECT SENSITIVITY
     95 Bit 10 : USE SCAN NOISE DATA
     96 Bit 11 : COMPENSATION SPREAD DATA
     97 Bit 12 : USE BSR TSP FLATENESS CHECK
     98 Bit 13 : USE ESD CHECK
     99 Bit 14 : DEF AUTO CPU OSC(ZFT)
    100 Bit 15 : FREE SPACE RECOVERY
    101  */
    102 #define INTERNAL_FLAG_01_REG                 ((uint16_t)0x011D)
    103 #define INTERNAL_FLAG_02_REG                 ((uint16_t)0x011E)
    104 #define INTERNAL_FLAG_03_REG                 ((uint16_t)0x011F)
    105 #define CHIP_CODE_REG                        ((uint16_t)0x0120)
    106 
    107 // Minor firmware version
    108 #define MINOR_FIRMWARE_VERSION_REG           ((uint16_t)0x0121)
    109 
    110 // 0x55AA
    111 #define CHECKSUM_RESULT_REG                  ((uint16_t)0x012C)
    112 
    113 // Check sum
    114 #define SYSTEM_CHECKSUM_REG                  ((uint16_t)0x012E)
    115 
    116 /* SENSITIVITY CONFIGURE (READ BYTE:2)*/
    117 #define CURRENT_SENSITIVITY_TH_REG           ((uint16_t)0x001D)
    118 /*
    119 Sensitivity Threshold : 0 ~ 65535
    120 ‘0’ is least sensitive Threshold
    121 ‘65535’ is most insensitive Threshold
    122  */
    123 #define SENSITIVITY_TH_REG                   ((uint16_t)0x0020)
    124 // Side (Left/Right/Top/Bottom) Sensitivity Th
    125 #define FIRST_Y0_SENSITIVITY_TH_REG          ((uint16_t)0x0021)
    126 // Side (Left/Right/Top/Bottom) Sensitivity Th
    127 #define LAST_Y_SENSITIVITY_TH_REG            ((uint16_t)0x0022)
    128 // Side (Left/Right/Top/Bottom) Sensitivity Th
    129 #define FIRST_X0_SENSITIVITY_TH_REG          ((uint16_t)0x0023)
    130 // Side (Left/Right/Top/Bottom) Sensitivity Th
    131 #define LAST_X_SENSITIVITY_TH_REG            ((uint16_t)0x0024)
    132 // Sensitivity Coef.
    133 #define ACTIVE_UP_SENSITIVITY_RATIO_REG      ((uint16_t)0x0025)
    134 // Sensitivity Coef.
    135 #define EDGE_ACTIVE_UP_ST_RATIO_REG          ((uint16_t)0x0027)
    136 // Sensitivity Coef.
    137 #define HYSTERISYS_ST_RATIO_REG              ((uint16_t)0x003D)
    138 
    139 /* FILTER CONFIGURE (READ BYTE:2)*/
    140 // Raw Data Filter Depth
    141 #define FIR_COEFFICIENT_REG                  ((uint16_t)0x0030)
    142 /*
    143 Point Filter (Moving Average Filter) Depth
    144 LSB : 1~32, MSB : 1~32
    145  */
    146 #define POINT_FIR_COEFFICIENT_REG            ((uint16_t)0x0033)
    147 // Width Filter (Moving Filter) Depth : 1~16
    148 #define POINT_WIDTH_FIR_REG                  ((uint16_t)0x0034)
    149 // Width Coef.
    150 #define WIDTH_AREA_COEF_REG                  ((uint16_t)0x0035).
    151 // Point Filter Coef
    152 #define POINT_FIR_DISTANCE_REG               ((uint16_t)0x0037)
    153 // Angle Filter Depth : 1~16
    154 #define POINT_ANGLE_FIR_REG                  ((uint16_t)0x0038)
    155 #define SW_ADAPTIVE_LIMIT_LENGTH_REG         ((uint16_t)0x00CE)
    156 #define SW_ADAPTIVE_TIMEOUT_REG              ((uint16_t)0x00CF)
    157 
    158 /* NORMAL NOISE (READ BYTE:2)*/
    159 /*
    160 Ignoring the initial point data : 1 ~ 16
    161 1 : ignoring several initial point data
    162 4 : ignoring many initial point data
    163  */
    164 #define REACTION_COUNT_REG                   ((uint16_t)0x003B)
    165 // Small finger reference value
    166 #define SMALL_FINGER_REF_VAL_REG             ((uint16_t)0x0042)
    167 // Noise reject Coef
    168 #define CUTOFF_NOISE_IDATA_RATIO_REG         ((uint16_t)0x0043)
    169 // Noise reject Coef
    170 #define CUTOFF_NOISE_WIDTH_RATIO_REG         ((uint16_t)0x0044)
    171 #define MINUSF_M_COMPS_RATIO_REG             ((uint16_t)0x0051)
    172 // Max Node Length for Small Finger
    173 #define SMALL_FINGER_MAX_NODE_LEN_REG        ((uint16_t)0x005A)
    174 // Min Node Length for Large Finger
    175 #define LARGE_FINGER_MIN_NODE_LEN_REG        ((uint16_t)0x005B)
    176 // Max Node Length for Large Finger
    177 #define LARGE_FINGER_MAX_NODE_LEN_REG        ((uint16_t)0x0075)
    178 #define SPREAD_COMP_RATIO_REG                ((uint16_t)0x00F2)
    179 
    180 /* BSR NOISE (READ BYTE:2)*/
    181 // Duration for BSR Filter
    182 #define BSR_DURATION_REG                     ((uint16_t)0x00D8)
    183 // Variation Threshold for BSR Filter
    184 #define BSR_VARIATION_TH_REG                 ((uint16_t)0x00D9)
    185 // MP Reject Reference Value
    186 #define MP_RATIO_REF_VAL_REG                 ((uint16_t)0x00E2)
    187 // MP Reject Coef
    188 #define MP_RATIO_SMALL_REG                   ((uint16_t)0x00E3)
    189 // MP Reject Coef
    190 #define MP_RATIO_LARGE_REG                   ((uint16_t)0x010A)
    191 // Variation Threshold for Flatness
    192 #define FLATNESS_VARIATION_TH_REG            ((uint16_t)0x00DD)
    193 #define FLATNESS_LIMIT_THRESHOLD_REG         ((uint16_t)0x00DE)
    194 // Reference Value for Flatness
    195 #define FLATNESS_REF_VAL_REG                 ((uint16_t)0x00DF)
    196 #define FLATNESS_CURRENT_VALUE_REG           ((uint16_t)0x00E0)
    197 // Reference value for baseline update
    198 #define REF_BASELINE_LIMIT_TH_REG            ((uint16_t)0x00E1)
    199 
    200 /* SMALL NOISE (READ BYTE:2)*/
    201 // Duration for Small Reject Baseline Update
    202 #define SMALL_REJECT_BASELINE_PERIOD_REG     ((uint16_t)0x0049)
    203 // Small noise density Coef
    204 #define NOISE_REJECT_DENSITY_RATIO_REG       ((uint16_t)0x004A)
    205 // Small noise Coef
    206 #define NOISE_REJECT_SMALL_NOISE_REF_VAL_REG ((uint16_t)0x004B)
    207 // Small noise density Coef
    208 #define NOISE_REJECT_DENSITY_LIMIT_REG       ((uint16_t)0x004C)
    209 // Small noise density Coef
    210 #define NOISE_REJECT_DENSITY_MIN_LEN_REG     ((uint16_t)0x004D)
    211 
    212 /* LOW PALM (READ BYTE:2)*/
    213 // Low Palm sensitivity Th
    214 #define LOW_PALM_SENSITIVITY_TH_REG          ((uint16_t)0x0026)
    215 // Max X Line for Low Palm
    216 #define LOW_PALM_MAX_X_REG                   ((uint16_t)0x0031)
    217 // Max Y Line for Low Palm
    218 #define LOW_PALM_MAX_Y_REG                   ((uint16_t)0x0032)
    219 // Max Area size for Low Palm
    220 #define LOW_PALM_MAX_AREA_REG                ((uint16_t)0x0036)
    221 // Sensitivity Coef
    222 #define LOW_PALM_ST_MAGNIFICATION_REG        ((uint16_t)0x0047)
    223 
    224 /* SMALL PALM (READ BYTE:2)*/
    225 // Area size for Small Palm
    226 #define SMALL_PALM_AREA_THRESHOLD_REG        ((uint16_t)0x003C)
    227 // Sensitivity Coef
    228 #define SMALL_PALM_ST_MAGNIFICATION_REG      ((uint16_t)0x0045)
    229 // Duration for Small Palm Baseline Update
    230 #define SMALL_PALM_BS_UPDATE_PERIOD_REG      ((uint16_t)0x004F)
    231 
    232 /* LARGE PALM (READ BYTE:2)*/
    233 #define LARGE_PALM_REJECT_N_COUNT_REG        ((uint16_t)0x003E)
    234 #define LARGE_PALM_REJECT_AREA_TH_REG        ((uint16_t)0x003F)
    235 #define LARGE_PALM_REPORT_AREA_TH_REG        ((uint16_t)0x0040)
    236 #define LARGE_PALM_UP_SKIP_CNT_REG           ((uint16_t)0x0041)
    237 #define LARGE_PALM_ST_MAGNIFICATION_REG      ((uint16_t)0x0046)
    238 #define LARGE_PALM_TIME_REG                  ((uint16_t)0x0048)
    239 #define LARGE_PALM_BS_UPDATE_PERIOD_REG      ((uint16_t)0x004E)
    240 
    241 /* AUTO NOISE LEVEL (READ BYTE:2)*/
    242 // Raw Data variation
    243 #define REAL_RAW_VARIATION_REG               ((uint16_t)0x001F)
    244 // Raw Data Max
    245 #define REAL_RAW_MAX_REG                     ((uint16_t)0x0073)
    246 // Raw Data Min
    247 #define REAL_RAW_MIN_REG                     ((uint16_t)0x0074)
    248 // Current Level Depth
    249 #define CUR_LEVEL_DEPTH_REG                  ((uint16_t)0x0101)
    250 // Current Level Down Count
    251 #define CUR_LEVEL_DOWN_CNT_REG               ((uint16_t)0x0102)
    252 // Current ADC Variation
    253 #define CUR_ADC_VARIATION_REG                ((uint16_t)0x0103)
    254 // Current PP Noise Variation
    255 #define CUR_PP_NOISE_VARIATION_REG           ((uint16_t)0x0104)
    256 // Current PP Noise Max
    257 #define CUR_PP_NOISE_MAX_REG                 ((uint16_t)0x0105)
    258 // Current PP Noise Min
    259 #define CUR_PP_NOISE_MIN_REG                 ((uint16_t)0x0106)
    260 // Current Skip Step
    261 #define CUR_SKIP_STEP_REG                    ((uint16_t)0x0107)
    262 // Count for Level Down
    263 #define DETECT_LEVEL_DOWN_CNT_REG            ((uint16_t)0x0108)
    264 #define ADC_VARIATION_TIMEOUT_REG            ((uint16_t)0x0109)
    265 // ADC variation threshold for LEVEL 0
    266 #define LEVEL_0_ADC_VARIATION_TH_REG         ((uint16_t)0x010A)
    267 // PP variation threshold for LEVEL 1
    268 #define LEVEL_1_PP_VARIATION_TH_REG          ((uint16_t)0x010B)
    269 // PP max threshold for LEVEL 1
    270 #define LEVEL_1_PP_MAX_TH_REG                ((uint16_t)0x010C)
    271 // PP min threshold for LEVEL 1
    272 #define LEVEL_1_PP_MIN_TH_REG                ((uint16_t)0x010D)
    273 // ADC variation threshold for LEVEL 1
    274 #define LEVEL_1_ADC_VARIATION_TH_REG         ((uint16_t)0x010E)
    275 #define LEVEL_1_SENSITIVITY_INC_REG          ((uint16_t)0x010F)
    276 #define LEVEL_1_REACTION_CNT_INC_REG         ((uint16_t)0x0110)
    277 // Raw data filter for LEVEL 1
    278 #define LEVEL_1_FIR_REG                      ((uint16_t)0x0111)
    279 // Point Filter Coef for LEVEL 1
    280 #define LEVEL_1_SW_FIR_REG                   ((uint16_t)0x0112)
    281 // Point Filter Coef for LEVEL 1
    282 #define LEVEL_1_SW_FIR_DIST_REG              ((uint16_t)0x0113)
    283 // Noise Reject Coef for LEVEL 1
    284 #define LEVEL_1_CUTOFF_IDATA_REG             ((uint16_t)0x0115)
    285 
    286 /* ESD NOISE (READ BYTE:2)*/
    287 // ESD Noise Variation Threshold
    288 #define ESD_NOISE_VARIATION_TH_REG           ((uint16_t)0x00E3)
    289 // ESD Noise Count
    290 #define ESD_NOISE_VARIATION_CNT_TH_REG       ((uint16_t)0x00E4)
    291 #define ESD_NOISE_MP_RATIO_REG               ((uint16_t)0x00E5)
    292 // ESD Noise Threshold
    293 #define ESD_NOISE_THRESHOLD_REG              ((uint16_t)0x00E6)
    294 // ESD Noise Min
    295 #define ESD_NOISE_MIN_CRT_REG                ((uint16_t)0x00E7)
    296 // ESD Noise Max
    297 #define ESD_NOISE_MAX_CRT_REG                ((uint16_t)0x00E8)
    298 // ESD Noise Variation Count
    299 #define ESD_NOISE_CUR_VARITON_CNT_REG        ((uint16_t)0x00E9)
    300 
    301 /* SCAN AREA CONFIGURE (READ BYTE:2)*/
    302 #define CHECK_AREA_REF_VAL_RATIO_REG         ((uint16_t)0x0050)
    303 // X Size for Multi Check
    304 #define SKIP_MULTI_CHK_MAX_X_REG             ((uint16_t)0x0052)
    305 // Y Size for Multi Check
    306 #define SKIP_MULTI_CHK_MAX_Y_REG             ((uint16_t)0x0053)
    307 // Max Area Count for Multi check
    308 #define SKIP_MULTI_CHK_MAX_AREA_REG          ((uint16_t)0x0054)
    309 // Min value for Multi Check
    310 #define SKIP_MULTI_CHK_MIN_VAL_REG           ((uint16_t)0x0055)
    311 // Adhesion Coef
    312 #define ADHESION_RATIO_REG                   ((uint16_t)0x0056)
    313 // Min Area Count for Multi Check
    314 #define SKIP_MULTI_CHK_MIN_AREA_REG          ((uint16_t)0x0057)
    315 // Noise reject Coef for Multi Check
    316 #define MULTI_CUTOFF_RATIO_REG               ((uint16_t)0x0058)
    317 // Adhesion Reference value Coef for Multi Check
    318 #define ADHESION_REF_VAL_RATIO_REG           ((uint16_t)0x0059)
    319 #define CAL_G_COORD_X_LEN_REG                ((uint16_t)0x005C)
    320 #define CAL_G_COORD_Y_LEN_REG                ((uint16_t)0x005D)
    321 #define ONE_RECT_COEF_REG                    ((uint16_t)0x005E)
    322 // Area Count Reference Value Coef
    323 #define AREA_COUNT_REF_VAL_RATIO_REG         ((uint16_t)0x005F)
    324 // Adhesion Coef for Multi Check
    325 #define MULTI_ADHESION_RATIO_REG             ((uint16_t)0x00C5)
    326 // Free Space Coef for Multi Check
    327 #define FREE_SPACE_RECOVERY_RATIO_REG        ((uint16_t)0x00D2)
    328 
    329 /* BASELINE CONFIGURE (READ BYTE:2)*/
    330 // Variation for 1st Baseline Update
    331 #define _1ST_BASELINE_VARIATION_REG          ((uint16_t)0x0028)
    332 // Variation for 2nd Baseline Update
    333 #define _2ND_BASELINE_VARIATION_REG          ((uint16_t)0x0029)
    334 // Duration for 1st Baseline Update
    335 #define _1ST_BASELINE_PERIOD_REG             ((uint16_t)0x002A)
    336 // Duration for 2nd Baseline Update
    337 #define _2ND_BASELINE_PERIOD_REG             ((uint16_t)0x002B)
    338 // Duration for Baseline Update in detecting finger.
    339 #define BASELINE_FORCE_PERIOD_REG            ((uint16_t)0x002C)
    340 // Step For 2nd Baseline Update
    341 #define _2ND_BASELINE_STEP_REG               ((uint16_t)0x002D)
    342 // Initial Count for Soft calibration
    343 #define SOFT_CALIBRATION_INIT_COUNT_REG      ((uint16_t)0x0078)
    344 
    345 /* CALIBRATION CONFIGURE (READ BYTE:2)*/
    346 // Reference Value for H/W Calibration
    347 #define CALIBRATION_REFERENCE_REG            ((uint16_t)0x0076)
    348 // Scan Count for H/W Calibration
    349 #define CALIBRATION_SCAN_COUNT_REG           ((uint16_t)0x0077)
    350 // Afe N Count for H/W Calibration
    351 #define CALIBRATION_DEFAULT_N_COUNT_REG      ((uint16_t)0x0078)
    352 // Default Cap Value for H/W Calibration
    353 #define CALIBRATION_DEFAULT_C_REG            ((uint16_t)0x0079)
    354 // Calibration Mode
    355 #define CALIBRATION_MODE_REG                 ((uint16_t)0x007A)
    356 
    357 /* BUTTON CONFIGURE (READ BYTE:2)*/
    358 // Supported Button Number
    359 #define SUPPORTED_BUTTON_NUM_REG             ((uint16_t)0x00B0)
    360 // Ignoring the initial button data : 1 ~ 16
    361 #define BUTTON_REACTION_CNT_REG              ((uint16_t)0x00B1)
    362 // Button Sensitivity Threshold
    363 #define BUTTON_SENSITIVITY_TH_REG            ((uint16_t)0x00B2)
    364 // 0 = X LINE, 1 = Y LINE
    365 #define BUTTON_LINE_TYPE_REG                 ((uint16_t)0x00B3)
    366 // First or last X or Y Line Num (ex) 0 or 15
    367 #define BUTTON_LINE_NUM_REG                  ((uint16_t)0x00B4)
    368 /*
    369 Button Node Count
    370 ex) If BUTTON LINE TYPE = 0, BUTTON LINE NUM =
    371 15, BUTTON_0 START NODE = 3 and this reg’s
    372 value 3, BUTTON 0 AREA is X = 15, Y= 3~5.
    373  */
    374 #define BUTTON_RANGE_REG                     ((uint16_t)0x00B5)
    375 // BUTTON_0 Start Node Num
    376 #define BUTTON_0_START_NODE_REG              ((uint16_t)0x00B6)
    377 #define BUTTON_1_START_NODE_REG              ((uint16_t)0x00B7)
    378 #define BUTTON_2_START_NODE_REG              ((uint16_t)0x00B8)
    379 #define BUTTON_3_START_NODE_REG              ((uint16_t)0x00B9)
    380 #define BUTTON_4_START_NODE_REG              ((uint16_t)0x00BA)
    381 #define BUTTON_5_START_NODE_REG              ((uint16_t)0x00BB)
    382 #define BUTTON_6_START_NODE_REG              ((uint16_t)0x00BC)
    383 #define BUTTON_7_START_NODE_REG              ((uint16_t)0x00BD)
    384 #define BUTTON_WIDTH_MUL_RATIO_REG           ((uint16_t)0x00BE)
    385 #define BUTTON_PRIORITY_RATIO_REG            ((uint16_t)0x00BF)
    386 
    387 /* X/Y CHANNEL CONFIGURE (READ BYTE:2)*/
    388 // X Channel number
    389 #define TOTAL_NUM_OF_X_REG                   ((uint16_t)0x0060)
    390 // Y Channel number
    391 #define TOTAL_NUM_OF_Y_REG                   ((uint16_t)0x0061)
    392 // X Pin mapping num with ITO
    393 #define X00_01_DRIVE_NUM_REG                 ((uint16_t)0x0062)
    394 #define X02_03_DRIVE_NUM_REG                 ((uint16_t)0x0063)
    395 #define X04_05_DRIVE_NUM_REG                 ((uint16_t)0x0064)
    396 #define X06_07_DRIVE_NUM_REG                 ((uint16_t)0x0065)
    397 #define X08_09_DRIVE_NUM_REG                 ((uint16_t)0x0066)
    398 #define X10_11_DRIVE_NUM_REG                 ((uint16_t)0x0067)
    399 #define X12_13_DRIVE_NUM_REG                 ((uint16_t)0x0068)
    400 #define X14_15_DRIVE_NUM_REG                 ((uint16_t)0x0069)
    401 #define X16_17_DRIVE_NUM_REG                 ((uint16_t)0x006A)
    402 #define X18_19_DRIVE_NUM_REG                 ((uint16_t)0x006B)
    403 #define X20_21_DRIVE_NUM_REG                 ((uint16_t)0x006C)
    404 #define X22_23_DRIVE_NUM_REG                 ((uint16_t)0x006D)
    405 #define X24_25_DRIVE_NUM_REG                 ((uint16_t)0x006E)
    406 #define X26_27_DRIVE_NUM_REG                 ((uint16_t)0x006F)
    407 #define X28_29_DRIVE_NUM_REG                 ((uint16_t)0x0070)
    408 #define X30_31_DRIVE_NUM_REG                 ((uint16_t)0x0071)
    409 #define Y00_01_INPUT_NUM_REG                 ((uint16_t)0x00F3)
    410 #define Y02_03_INPUT_NUM_REG                 ((uint16_t)0x00F4)
    411 #define Y04_05_INPUT_NUM_REG                 ((uint16_t)0x00F5)
    412 #define Y06_07_INPUT_NUM_REG                 ((uint16_t)0x00F6)
    413 #define Y08_09_INPUT_NUM_REG                 ((uint16_t)0x00F7)
    414 #define Y10_11_INPUT_NUM_REG                 ((uint16_t)0x00F8)
    415 #define Y12_13_INPUT_NUM_REG                 ((uint16_t)0x00F9)
    416 #define Y14_15_INPUT_NUM_REG                 ((uint16_t)0x00FA)
    417 #define Y16_17_INPUT_NUM_REG                 ((uint16_t)0x00FB)
    418 
    419 /* AFE FREQ CONFIGURE (READ BYTE:2)*/
    420 // AFE Frequency
    421 #define AFE_FREQUENCY_REG                    ((uint16_t)0x0100)
    422 
    423 /* AFE OPERATION COEF (READ BYTE:2)*/
    424 // Default N Count
    425 #define AFE_DEFAULT_N_COUNT_REG              ((uint16_t)0x0122)
    426 #define AFE_DEFAULT_C_REG                    ((uint16_t)0x0123)
    427 /*
    428 OSC Frequency
    429 [ZMT200]
    430  0(default) : 14MHz
    431  1 : 18MHz
    432 [ZFT400]
    433  0(default) : 16.6MHz
    434  21 : 33.3MHz
    435  11 : 40MHz
    436  */
    437 #define CPU_OSD_FREQUENCY_REG                ((uint16_t)0x0125)
    438 #define AFE_R_SHIFT_VALUE_REG                ((uint16_t)0x012B)
    439 
    440 /* COORD. CONFIGURE (READ BYTE:2)*/
    441 // X Resolution
    442 #define RESOLUTION_OF_X_REG                  ((uint16_t)0x00C0)
    443 // Y Resolution
    444 #define RESOLUTION_OF_Y_REG                  ((uint16_t)0x00C1)
    445 /*
    446 BIT 0 : X FLIP (1)
    447 BIT 1 : Y FLIP (1)
    448 BIT 2 : XY SWAP (1)
    449  */
    450 #define COORD_ORIENTATION_REG                ((uint16_t)0x00C2)
    451 /*
    452 Holding the point movement : 1 ~ 256
    453 001 : point movement recognition is fast
    454 128 : point movement recognition is slow
    455  */
    456 #define HOLD_POINT_TRESHHOLD_REG             ((uint16_t)0x00C3)
    457 // Holding the width change : 1 ~ 256
    458 #define HOLD_WIDTH_TRESHHOLD_REG             ((uint16_t)0x00C4)
    459 #define ASSUME_UP_THRESHHOLD_REG             ((uint16_t)0x00C6)
    460 #define ASSUME_UP_SKIP_THRESHHOLD_REG        ((uint16_t)0x00C7)
    461 // Shift X Coord for Accuracy Coef.
    462 #define X_POINT_SHIFT_REG                    ((uint16_t)0x00C8)
    463 // Shift Y Coord for Accuracy Coef.
    464 #define Y_POINT_SHIFT_REG                    ((uint16_t)0x00C9)
    465 // View Area First X Line Offset
    466 #define VIEW_AREA_XF_OFFSET_REG              ((uint16_t)0x00CA)
    467 // View Area Last X Line Offset
    468 #define VIEW_AREA_XL_OFFSET_REG              ((uint16_t)0x00CB)
    469 // View Area First Y Line Offset
    470 #define VIEW_AREA_YF_OFFSET_REG              ((uint16_t)0x00CC)
    471 // View Area Last Y Line Offset
    472 #define VIEW_AREA_YL_OFFSET_REG              ((uint16_t)0x00CD)
    473 // Coef. for calculation coord
    474 #define COEF_X_GAIN_REG                      ((uint16_t)0x00D0)
    475 // Coef. for calculation coord
    476 #define COEF_Y_GAIN_REG                      ((uint16_t)0x00D1)
    477 #define ACTIVE_UP_THRESHHOLD_REG             ((uint16_t)0x00D3)
    478 // Process Data Coef.
    479 #define PDATA_COEF1_REG                      ((uint16_t)0x00D5)
    480 // Process Data Coef.
    481 #define PDATA_COEF2_REG                      ((uint16_t)0x00D6)
    482 // Process Data Coef.
    483 #define PDATA_COEF3_REG                      ((uint16_t)0x00D7)
    484 // Edge Area Scale
    485 #define VIEW_EDGE_SCALE_VAL_REG              ((uint16_t)0x00EB)
    486 // Edge Area First X Line Offset
    487 #define VIEW_EDGE_XF_OFFSET_REG              ((uint16_t)0x00EC)
    488 // Edge Area Last X Line Offset
    489 #define VIEW_EDGE_XL_OFFSET_REG              ((uint16_t)0x00ED)
    490 // Edge Area First Y Line Offset
    491 #define VIEW_EDGE_YF_OFFSET_REG              ((uint16_t)0x00EE)
    492 // Edge Area Last Y Line Offset
    493 #define VIEW_EDGE_YL_OFFSET_REG              ((uint16_t)0x00EF)
    494 
    495 /* INTERRUPT CONFIGURE (READ BYTE:2)*/
    496 /*
    497 BIT 00 : POINT COUNT CHANGE EVENT
    498 BIT 01 : DOWN EVENT
    499 BIT 02 : MOVE EVENT
    500 BIT 03 : UP EVENT
    501 BIT 04 : LARGE PALM REPORT
    502 BIT 05 : LARGE PALM REJECT
    503 BIT 06 : RESERVED
    504 BIT 07 : RESERVED
    505 BIT 08 : WIDTH CHANGED EVENT
    506 BIT 09 : REJECT EVENT
    507 BIT 10 : RESERVED
    508 BIT 11 : POINT DETECTED EVENT
    509 BIT 12 : RESERVED
    510 BIT 13 : RESERVED
    511 BIT 14 : DEBUG EVENT
    512 BIT 15 : BUTTON EVENT
    513  */
    514 #define INT_ENABLE_FLAG_REG                  ((uint16_t)0x00F0)
    515 /*
    516 0 : No Use
    517 1~30000 : Occurred invalid Interrupt periodically
    518 per setting Afe Cycle.
    519 Invalid interrupt :
    520 Status register = 0x00
    521 Point Count = 100;
    522  */
    523 #define ESD_INTERRUPT_INTERVAL_REG           ((uint16_t)0x00F1)
    524 
    525 /* POINT INFO (READ BYTE:2)*/
    526 /*
    527 BIT 00 : POINT COUNT CHANGE EVENT
    528 BIT 01 : DOWN EVENT
    529 BIT 02 : MOVE EVENT
    530 BIT 03 : UP EVENT
    531 BIT 04 : LARGE PALM REPORT
    532 BIT 05 : LARGE PALM REJECT
    533 BIT 06 : RESERVED
    534 BIT 07 : RESERVED
    535 BIT 08 : WIDTH CHANGED EVENT
    536 BIT 09 : REJECT EVENT
    537 BIT 10 : RESERVED
    538 BIT 11 : POINT DETECTED EVENT
    539 BIT 12 : RESERVED
    540 BIT 13 : RESERVED
    541 BIT 14 : DEBUG EVENT
    542 BIT 15 : BUTTON EVENT
    543  */
    544 #define STATUS_REGISTER_REG                  ((uint16_t)0x0080)
    545 /*
    546 LSB : Point Count, MSB : Time Stamp
    547 if TOUCH MODE = 1, using event flag.
    548  BIT 00 : Finger Idx00 Event
    549  BIT 01 : Finger Idx01 Event
    550  BIT 02 : Finger Idx01 Event
    551    552  */
    553 #define POINT_COUNT_TIMESTAMP_REG            ((uint16_t)0x0081)
    554 /*
    555 [TOUCH MODE 0] – Report All Point’s Info.
    556  1st Point X position(2BYTE) + 1st Point Y position(2BYTE) + 1st Major Width(1Byte) + 1st Sub Status(1Byte)
    557  2nd Point X position(2BYTE) + 2nd Point Y position(2BYTE) + 2nd Major Width(1Byte) + 2nd Sub Status(1Bytes) ...
    558 < SUB STATUS INFO>
    559 BIT 00 : Point Exist (0 : no, 1 : yes)
    560 BIT 01 : Down
    561 BIT 02 : Move
    562 BIT 03 : Up
    563 BIT 04 : Update
    564 BIT 05 : Wait
    565 BIT 06 : Reaction CNT Full
    566 BIT 07 : Width change
    567 [TOUCH MODE 2] – Report All Point’s Info.
    568  1st Point X position(2BYTE) + 1st Point Y position(2BYTE) + 1st Major Width(1Byte) + 1st Sub Status(1Byte)
    569 + 1st Minor Width(1Byte) + 1st Angle(1Byte) + 2nd Point X position(2BYTE) + 2nd Point Y position(2BYTE)
    570 + 2nd Major Width(1Byte) + 2nd Sub Status(1Bytes) + 2nd Minor Width(1Byte) + 2nd Angle(1Byte)….
    571  */
    572 #define REPORT_ALL_POINTS_INFO_REG           ((uint16_t)0x0082)
    573 
    574 /* BUTTON EVENT & OTHER EVENT INFO (READ BYTE:2)*/
    575 /*
    576 BIT 00 : BUTTON 0 DOWN
    577 BIT 01 : BUTTON 1 DOWN
    578 BIT 02 : BUTTON 2 DOWN
    579 BIT 03 : BUTTON 3 DOWN
    580 BIT 04 : BUTTON 4 DOWN
    581 BIT 05 : BUTTON 5 DOWN
    582 BIT 06 : BUTTON 6 DOWN
    583 BIT 07 : BUTTON 7 DOWN
    584 BIT 08 : BUTTON 0 UP
    585 BIT 09 : BUTTON 1 UP
    586 BIT 10 : BUTTON 2 UP
    587 BIT 11 : BUTTON 3 UP
    588 BIT 12 : BUTTON 4 UP
    589 BIT 13 : BUTTON 5 UP
    590 BIT 14 : BUTTON 6 UP
    591 BIT 15 : BUTTON 7 UP
    592  */
    593 #define BUTTON_EVENT_REG                     ((uint16_t)0x00AA)