⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 csdtable.lis

📁 cpress器件实现触摸按键程序.开发环境PsOC Designer
💻 LIS
📖 第 1 页 / 共 4 页
字号:
 0000           
 0001           CSD_AUTORESET:                         equ 1
 0000           
 0000           ;--------------------------------------------------
 0000           ; Constants for Scan Speed values
 0000           ;--------------------------------------------------
 0000           CSD_ULTRA_FAST_SPEED:                  equ 0x00
 0001           CSD_FAST_SPEED:                        equ 0x01
 0002           CSD_NORMAL_SPEED:                      equ 0x02
 0003           CSD_SLOW_SPEED:                        equ 0x03
 0000           
 0000           ;--------------------------------------------------
 0000           ; Constants for Resolution values
 0000           ;--------------------------------------------------
 0009           CSD_MIN_RESOLUTION:                    equ 9
 0010           CSD_MAX_RESOLUTION:                    equ 16
 0000           
 0000           ;--------------------------------------------------
 0000           ; Constants for CSD API's
 0000           ;--------------------------------------------------
 0000           
 0010           CSD_ButtonCount:                       equ 10h
 0000           CSD_SliderCount:                       equ 0h
 0010           CSD_TotalSensorCount:                  equ 10h
 0000           
 0010           CSD_BUTTONS_EXIST:                     equ 10h
 0000           CSD_SLIDERS_EXIST:                     equ 0h
 0000           
 000F           CSD_HYSTERESIS:                                  equ fh
 0001           CSD_Debounce:                                    equ 1h
 0014           CSD_LowBaselineReset:                            equ 14h
 0000           
 004B           CSD_FINGER_THRESHOLD:                            equ 4bh
 0028           CSD_NOISE_THRESHOLD:                             equ 28h
 0028           CSD_NEGATIVE_NOISE_THRESHOLD:                    equ 28h
 0064           CSD_BASELINE_UPDATE_THRESHOLD:                   equ 64h
 0000           
 0000           ;--------------------------------------------------
 0000           ; Registers Address Constants for CSD
 0000           ;--------------------------------------------------
 0000           
 0020           CSD_CNT_FUNC_REG:                      equ 20h              ; CNT Function Reg
 0021           CSD_CNT_IN_REG:                        equ 21h              ; CNT Input Reg
 0022           CSD_CNT_OUT_REG:                       equ 22h              ; CNT Output Reg
 0020           CSD_CNT_COUNTER_REG:                   equ 20h              ; CNT Counter Reg
 0021           CSD_CNT_PERIOD_REG:                    equ 21h              ; CNT Period Reg
 0022           CSD_CNT_COMPARE_REG:                   equ 22h              ; CNT Compare Reg
 0023           CSD_CNT_CONTROL_REG:                   equ 23h              ; CNT Control Reg
 0000           
 0024           CSD_PRS_FUNC_LSB_REG:                  equ 24h              ; PRS LSB Function Reg
 0025           CSD_PRS_IN_LSB_REG:                    equ 25h              ; PRS LSB Input Reg
 0026           CSD_PRS_OUT_LSB_REG:                   equ 26h              ; PRS LSB Output Reg
 0027           CSD_PRS_CONTROL_LSB_REG:               equ 27h              ; PRS LSB Control Reg
 0024           CSD_PRS_SHIFT_LSB_REG:                 equ 24h              ; PRS LSB Shift Reg
 0025           CSD_PRS_POLY_LSB_REG:                  equ 25h              ; PRS LSB Polynomial Reg
 0026           CSD_PRS_SEED_LSB_REG:                  equ 26h              ; PRS LSB Seed Reg
 0000           
 0028           CSD_PRS_FUNC_MSB_REG:                  equ 28h              ; PRS MSB Function Reg
 0029           CSD_PRS_IN_MSB_REG:                    equ 29h              ; PRS MSB Input Reg
 002A           CSD_PRS_OUT_MSB_REG:                   equ 2ah              ; PRS MSB Output Reg
 002B           CSD_PRS_CONTROL_MSB_REG:               equ 2bh              ; PRS MSB Control Reg
 0028           CSD_PRS_SHIFT_MSB_REG:                 equ 28h              ; PRS MSB Shift Reg
 0029           CSD_PRS_POLY_MSB_REG:                  equ 29h              ; PRS MSB Polynimial Reg
 002A           CSD_PRS_SEED_MSB_REG:                  equ 2ah              ; PRS MSB Seed Reg
 0000           
 0076           CSD_ACE_CONTROL1_REG:                  equ 76h              ; CMP Control Reg
 0077           CSD_ACE_CONTROL2_REG:                  equ 77h              ; CMP Control Reg
 0000           
 0084           CSD_ASE_CONTROL_REG:                   equ 84h              ; CMP_REF Conrol Reg
 00E6           CSD_ADC_TRIM_REG:                      equ e6h              ; ADC Trim Register
 0069           CSD_ADC_CONTROL_REG:                   equ 69h              ; ADC Control Reg
 0000           
 0000           
 0000           DR_OFFSET:                             equ 00h
 0000           DM0_OFFSET:                            equ 00h              ; Bank 1
 0001           DM1_OFFSET:                            equ 01h              ; Bank 1
 0003           DM2_OFFSET:                            equ 03h              ; Bank 0
 00D8           MUX_OFFSET:                            equ MUX_CR0          ; Bank 1
 0000           
 0000           ;--------------------------------------------------
 0000           ; CSD Macro 'Functions'
 0000           ;--------------------------------------------------
 0000           
 0000           macro CSD_Counter_Start_M
 0000              or    reg[CSD_CNT_CONTROL_REG],  CSD_CNT_CONTROL_REG_START_BIT
 0000           macro CSD_Counter_Stop_M
 0000              and   reg[CSD_CNT_CONTROL_REG], ~CSD_CNT_CONTROL_REG_START_BIT
 0000           macro CSD_Counter_EnableInt_M
 0000              M8C_EnableIntMask CSD_CNT_INT_REG, CSD_CNT_INT_MASK
 0000           macro CSD_Counter_DisableInt_M
 0000              M8C_DisableIntMask CSD_CNT_INT_REG, CSD_CNT_INT_MASK
 00E0           CSD_CMP_CMPIntReg:                     equ  0e0h
 0004           CSD_CMP_CMPIntMask:                    equ  04h
 0000           
 0000           CSD_CMP_OFF:                           equ  0
 0001           CSD_CMP_ON:                            equ  1
 0000           
 0000           ;--------------------------------------------------
 0000           ; Constants for CSD_Counter API's.
 0000           ;--------------------------------------------------
 0000           
 0001           CSD_CNT_CONTROL_REG_START_BIT:         equ 0x01             ; Control register start bit
 00E1           CSD_CNT_INT_REG:                       equ 0x0e1
 0001           CSD_CNT_INT_MASK:                      equ 0x01
 0000           
 0000           ;--------------------------------------------------
 0000           ; Constants for CSD_Counter user defined values
 0000           ;--------------------------------------------------
 0000           
 00FF           CSD_CNT_PERIOD:                        equ 0xff
 0000           CSD_CNT_COMPARE_VALUE:                 equ 0x00
 0000           
 0000           ; end of file CSD.inc
 0000           
 0000           ;-----------------------------------------------
 0000           ;  Global Labels
 0000           ;-----------------------------------------------
 0000           
 0000           ; Exported table
                export  CSD_Sensor_Table
                export _CSD_Sensor_Table
                export  CSD_Group_Table
                export _CSD_Group_Table
                export  CSD_Diplex_Table
                export _CSD_Diplex_Table
                
                AREA UserModules (ROM, REL, CON)
                
 0000           .LITERAL
 0000           ;---------------------------------
 0000           ; Tables below generated by Wizard
 0000           ;---------------------------------
 0000           ; The Sensor Table consists of two bytes for each sensor.  The first byte is the
 0000           ; port number and the second is the bit mask for the bit not to be confused with
 0000           ; the bit number.  For example an entry for port 2 bit 3 (P2[3])  would be
 0000           ; "dw 0x0208".  This table consist of 0x10 sensors.
 0000            CSD_Sensor_Table:
 0000           _CSD_Sensor_Table:
 0000 0040              dw      0x0040  // Port 0 Bit 6
 0002 0010              dw      0x0010  // Port 0 Bit 4
 0004 0004              dw      0x0004  // Port 0 Bit 2
 0006 0280              dw      0x0280  // Port 2 Bit 7
 0008 0220              dw      0x0220  // Port 2 Bit 5
 000A 0208              dw      0x0208  // Port 2 Bit 3
 000C 0202              dw      0x0202  // Port 2 Bit 1
 000E 0308              dw      0x0308  // Port 3 Bit 3
 0010 0180              dw      0x0180  // Port 1 Bit 7
 0012 0001              dw      0x0001  // Port 0 Bit 0
 0014 0240              dw      0x0240  // Port 2 Bit 6
 0016 0210              dw      0x0210  // Port 2 Bit 4
 0018 0204              dw      0x0204  // Port 2 Bit 2
 001A 0201              dw      0x0201  // Port 2 Bit 0
 001C 0304              dw      0x0304  // Port 3 Bit 2
 001E 0301              dw      0x0301  // Port 3 Bit 0
 0020           
 0020           
 0020           ;-----------------------------------------------------------------------------
 0020           ; The Group Table defines each of the groups of button sensors or sliders.
 0020           ; There is one entry for each slider plus one for the free button sensors.
 0020           ; The first entry is always the free sensors.  Each entry is four bytes.
 0020           ;
 0020           ; The first byte is the index in the Sensor Table where the group starts.
 0020           ;
 0020           ; The second byte is how many sensors are in that group.  For example, in a
 0020           ; system where there are 6 free sensors and two sliders, the first with 8
 0020           ; sensors and the second with 4, the table would look like the following.
 0020           ;  db 0, 8
 0020           ;  db 8, 8
 0020           ;  db 16, 4
 0020           ;
 0020           ; The third byte signifies whether the slider is diplexed or not (4 is
 0020           ; diplexed, 0 is not diplexed).
 0020           ;
 0020           ; The fourth, fifth, and sixth bytes are the fixed point multiplier that the
 0020           ; slider's calculated centroid will be multiplied by to achieve the resolution
 0020           ; desired in the CSD wizard.  The multiplier is three bytes containing the
 0020           ; following bit definitions:
 0020           ;  MSB:
 0020           ;    bit 7   bit 6   bit 5   bit 4   bit 3   bit 2   bit 1   bit 0
 0020           ;     x2^15       x2^14   x2^13   x2^12   x2^11   x2^10   x2^9    x2^8
 0020           ;  ISB:
 0020           ;    bit 7   bit 6   bit 5   bit 4   bit 3   bit 2   bit 1   bit 0
 0020           ;     x128        x64     x32     x16     x8      x4      x2      x1
 0020           ;  LSB:
 0020           ;    bit 7   bit 6   bit 5   bit 4   bit 3   bit 2   bit 1   bit 0
 0020           ;     x1/2        x1/4    x1/8    x1/16   x1/32   x1/64   x1/128  x1/256
 0020           ;
 0020           ; The formula for the resolution is:
 0020           ;    Resolution = (SensorsInSlider - 1) * Multiplier
 0020           ;
 0020           ; For example, if you had a 10 sensor slider and you wanted a resolution of
 0020           ; 100, the multiplier would need to be 11.109375 to get the closest
 0020           ; approximation (using 256ths).  Therefore the fixed point value would be:
 0020           ;    MSB 00h
 0020           ;    ISB 0bh
 0020           ;    LSB 1ch
 0020           ; as 8+2+1+1/16+1/32+1/64).  The GUI automatically calculates these values
 0020           ; based on the resolution needed.
 0020           ;
 0020           ; There are 0x0 groups counting the free sensors.
 0020           ;-----------------------------------------------------------------------------
 0020            CSD_Group_Table:
 0020           _CSD_Group_Table:
 0020           ; Group Table:
 0020           ;    Origin    Count    Diplex?    DivBtwSw(wholeMSB, wholeLSB, fractByte)
 0020 001000000000  db   0x0,      0x10,         0x00,   0x00,   0x00,   0x00 ; Buttons
 0026           
 0026           
 0026           ;-----------------------------------------------------------------------------
 0026           ; Diplex table scan order data is produced for a group when it is a slider and
 0026           ; is also diplexed.  Otherwise a label is created but no data is placed.  The
 0026           ; data represents the physical representation of the sensors in their location
 0026           ; on the PCB.  A label containing the pointer to the corresponding table is
 0026           ; also produced for referencing in the high-level centroid calculation
 0026           ; function.
 0026           ;-----------------------------------------------------------------------------
 0026           DiplexTable_0:
 0026           ; This group is not a diplexed slider
 0026           
 0026           
 0026            CSD_Diplex_Table:
 0026           _CSD_Diplex_Table:
 0026 2626              db >DiplexTable_0, <DiplexTable_0
 0028           
 0028           .ENDLITERAL

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -