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

CSTMutualConstants.h (5698B)

      1 #pragma once
      2 
      3 #define CTS328_SLAVE_ADDRESS (0x1A)
      4 #define L58_SLAVE_ADDRESS    (0X5A)
      5 
      6 /* Version Information Register */
      7 /* MODE_DEBUG_INFO  */
      8 
      9 /*
     10  BYTE 3:KEY_NUM
     11  BYTE 2:TP_NRX
     12  BYTE 1:NC
     13  BYTE 0:TP_NTX
     14 */
     15 #define CST328_INFO_1_REG    (uint16_t((0XD1F4))
     16 
     17 /*
     18  BYTE 3 ~ BYTE 2:TP_RESY
     19  BYTE 1 ~ BYTE 0:TP_RESX
     20  */
     21 #define CST328_INFO_2_REG    (uint16_t((0XD1F8))
     22 
     23 /*
     24  BYTE 3 ~ BYTE 2:0XCACA
     25  BYTE 1 ~ BYTE 0:BOOT_TIMER
     26  */
     27 #define CST328_INFO_3_REG    (uint16_t((0XD1FC))
     28 
     29 /*
     30  BYTE 3 ~ BYTE 2:IC_TYPE
     31  BYTE 1 ~ BYTE 0:PROJECT_ID
     32  */
     33 #define CST328_INFO_4_REG    (uint16_t((0XD204))
     34 
     35 /*
     36  BYTE 3:FW_MAJOR
     37  BYTE 2:FW_MINOR
     38  BYTE 1 ~ BYTE 0:FW_BUILD
     39 */
     40 #define CST328_INFO_5_REG    (uint16_t((0XD208))
     41 
     42 /*
     43  BYTE 3:CHECKSNM_H
     44  BYTE 2:CHECKSNM_H
     45  BYTE 1:CHECKSNM_L
     46  BYTE 0:CHECKSNM_L
     47 */
     48 #define CST328_INFO_6_REG    (uint16_t((0XD20C))
     49 
     50 #define MODE_DEBUG_INFO_REG        (uint16_t(0xD101))
     51 #define CHIP_SYSTEM_RESET_REG      (uint16_t(0xD102))
     52 #define REDO_CALIBRATION_REG       (uint16_t(0xD104))
     53 #define CHIP_DEEP_SLEEP_REG        (uint16_t(0xD105))
     54 #define MODE_DEBUG_POINT_REG       (uint16_t(0xD108))
     55 #define MODE_NORMAL_REG            (uint16_t(0xD109))
     56 #define MODE_DEBUG_RAWDATA_REG     (uint16_t(0xD10A))
     57 #define MODE_DEBUG_WRITE_REG       (uint16_t(0xD10B))
     58 #define MODE_DEBUG_CALIBRATION_REG (uint16_t(0xD10C))
     59 #define MODE_DEBUG_DIFF_REG        (uint16_t(0xD10D))
     60 #define MODE_FACTORY_REG           (uint16_t(0xD119))
     61 
     62 /* touch information register */
     63 /*  MODE_NORMAL  */
     64 
     65 /*
     66     BIT 7 ~ BIT 4: 1st finger ID
     67     BIT 3 ~ BIT 0: 1st finger state: pressed (0x06) or lifted
     68  */
     69 #define MODE_NORMAL_0_REG          (uint16_t(0xD000))
     70 
     71 /*
     72     BIT 7 ~ BIT 0: The X coordinate value of the 1st finger is eight high digits: X_Position>>4
     73  */
     74 #define MODE_NORMAL_1_REG          (uint16_t(0xD001))
     75 
     76 /*
     77     BIT 7 ~ BIT 0: The Y coordinate value of the 1st finger is eight high digits: Y_Position>>4
     78  */
     79 #define MODE_NORMAL_2_REG          (uint16_t(0xD002))
     80 
     81 /*
     82     BIT 7 ~ BIT 4: The X coordinate value of the 1st finger X_Position&0x0F
     83     BIT 3 ~ BIT 0: The Y coordinate value of the 1st finger Y_Position&0x0F
     84  */
     85 #define MODE_NORMAL_3_REG          (uint16_t(0xD003))
     86 
     87 /*
     88     BIT 7 ~ BIT 0: 1st finger pressure value
     89  */
     90 #define MODE_NORMAL_4_REG          (uint16_t(0xD004))
     91 
     92 /*
     93     BIT 7 ~ BIT 4: Report button flag (0x80)
     94     BIT 3 ~ BIT 0: Report the number of fingers
     95  */
     96 #define MODE_NORMAL_5_REG          (uint16_t(0xD005))
     97 
     98 /*
     99     BIT 7 ~ BIT 0: Fixed 0xAB
    100  */
    101 #define MODE_NORMAL_6_REG          (uint16_t(0xD006))
    102 
    103 /*
    104     BIT 7 ~ BIT 4: 2nd finger ID
    105     BIT 3 ~ BIT 0: 2nd finger state: pressed (0x06) or lifted
    106  */
    107 #define MODE_NORMAL_7_REG          (uint16_t(0xD007))
    108 
    109 /*
    110     BIT 7 ~ BIT 0: The X coordinate value of the 2nd finger is eight high digits: X_Position>>4
    111  */
    112 #define MODE_NORMAL_8_REG          (uint16_t(0xD008))
    113 
    114 /*
    115     BIT 7 ~ BIT 0: The Y coordinate value of the 2nd finger is eight high digits: Y_Position>>4
    116  */
    117 #define MODE_NORMAL_9_REG          (uint16_t(0xD009))
    118 
    119 /*
    120     BIT 7 ~ BIT 4: The X coordinate value of the 2nd finger X_Position&0x0F
    121     BIT 3 ~ BIT 0: The Y coordinate value of the 2nd finger Y_Position&0x0F
    122  */
    123 #define MODE_NORMAL_10_REG         (uint16_t(0xD00A))
    124 
    125 /*
    126     BIT 7 ~ BIT 0: 2nd finger pressure value
    127  */
    128 #define MODE_NORMAL_11_REG         (uint16_t(0xD00B))
    129 
    130 /*
    131     BIT 7 ~ BIT 4: 3rd finger ID
    132     BIT 3 ~ BIT 0: 3rd finger state: pressed (0x06) or lifted
    133  */
    134 #define MODE_NORMAL_12_REG         (uint16_t(0xD00C))
    135 
    136 /*
    137     BIT 7 ~ BIT 0: The X coordinate value of the 3rd finger is eight high digits: X_Position>>4
    138  */
    139 #define MODE_NORMAL_13_REG         (uint16_t(0xD00D))
    140 
    141 /*
    142     BIT 7 ~ BIT 0: The Y coordinate value of the 3rd finger is eight high digits: Y_Position>>4
    143  */
    144 #define MODE_NORMAL_14_REG         (uint16_t(0xD00E))
    145 
    146 /*
    147     BIT 7 ~ BIT 4: The X coordinate value of the 3rd finger X_Position&0x0F
    148     BIT 3 ~ BIT 0: The Y coordinate value of the 3rd finger Y_Position&0x0F
    149  */
    150 #define MODE_NORMAL_15_REG         (uint16_t(0xD00F))
    151 
    152 /*
    153     BIT 7 ~ BIT 0: 3rd finger pressure value
    154  */
    155 #define MODE_NORMAL_16_REG         (uint16_t(0xD010))
    156 
    157 /*
    158     BIT 7 ~ BIT 4: 4th finger ID
    159     BIT 3 ~ BIT 0: 4th finger state: pressed (0x06) or lifted
    160  */
    161 #define MODE_NORMAL_17_REG         (uint16_t(0xD011))
    162 
    163 /*
    164     BIT 7 ~ BIT 0: The X coordinate value of the 4th finger is eight high digits: X_Position>>4
    165  */
    166 #define MODE_NORMAL_18_REG         (uint16_t(0xD012))
    167 
    168 /*
    169     BIT 7 ~ BIT 0: The Y coordinate value of the 4th finger is eight high digits: Y_Position>>4
    170  */
    171 #define MODE_NORMAL_19_REG         (uint16_t(0xD013))
    172 
    173 /*
    174     BIT 7 ~ BIT 4: The X coordinate value of the 4th finger X_Position&0x0F
    175     BIT 3 ~ BIT 0: The Y coordinate value of the 4th finger Y_Position&0x0F
    176  */
    177 #define MODE_NORMAL_20_REG         (uint16_t(0xD014))
    178 
    179 /*
    180     BIT 7 ~ BIT 0: 4th finger pressure value
    181  */
    182 #define MODE_NORMAL_21_REG         (uint16_t(0xD015))
    183 
    184 /*
    185     BIT 7 ~ BIT 4: 5th finger ID
    186     BIT 3 ~ BIT 0: 5th finger state: pressed (0x06) or lifted
    187  */
    188 #define MODE_NORMAL_22_REG         (uint16_t(0xD016))
    189 
    190 /*
    191     BIT 7 ~ BIT 0: The X coordinate value of the 5th finger is eight high digits: X_Position>>4
    192  */
    193 #define MODE_NORMAL_23_REG         (uint16_t(0xD017))
    194 
    195 /*
    196     BIT 7 ~ BIT 0: The Y coordinate value of the 5th finger is eight high digits: Y_Position>>4
    197  */
    198 #define MODE_NORMAL_24_REG         (uint16_t(0xD018))
    199 
    200 /*
    201     BIT 7 ~ BIT 4: The X coordinate value of the 5th finger X_Position&0x0F
    202     BIT 3 ~ BIT 0: The Y coordinate value of the 5th finger Y_Position&0x0F
    203  */
    204 #define MODE_NORMAL_25_REG         (uint16_t(0xD019))
    205 
    206 /*
    207     BIT 7 ~ BIT 0: 5th finger pressure value
    208  */
    209 #define MODE_NORMAL_26_REG         (uint16_t(0xD01A))