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

📄 csdhl.lis

📁 cypress CapSense_CSD 的应用例程.
💻 LIS
📖 第 1 页 / 共 5 页
字号:
 0018            CSD_bBiggestCtrdStartPos:              BLK  1
 0019           _CSD_bBiggestCtrdSize:                          ; Temp biggest centroid size
 0019            CSD_bBiggestCtrdSize:                  BLK  1
 001A           _CSD_wCurPkValue:                               ; Temp current peak
 001A            CSD_wCurPkValue:                       BLK  2
 001C           _CSD_bCurPkPos:                                 ; Temp current slider pointer
 001C            CSD_bCurPkPos:                         BLK  1
 001D           _CSD_bDiplexInfo:                               ; Temp flag for diplex of current group
 001D            CSD_bDiplexInfo:                                                BLK  1
 001E           _CSD_bDiplexMSB:                                ; Temp that contains the address of the rom diplex table
 001E            CSD_bDiplexMSB:                        BLK  1
 001F           _CSD_bDiplexLSB:
 001F            CSD_bDiplexLSB:                        BLK  1
 0020           _CSD_wDivBtwSns:                                ; Temp divisions between sensors
 0020            CSD_wDivBtwSns:                        BLK  2
                ENDIF
                
                AREA bss
                ; Global variables
 0000           _CSD_waSnsBaseline:                             ; Baseline, one entry for each sensor
 0000            CSD_waSnsBaseline:                     BLK  (2*CSD_TotalSensorCount)
 0012           _CSD_waSnsDiff:                                 ; ABS Diff of raw and and baseline, one entry for each sensor
 0012            CSD_waSnsDiff:                         BLK  (2*CSD_TotalSensorCount)
 0024           _CSD_baSnsBucket:                                 ; Baseline difference accumulator, one entry for each sensor
 0024            CSD_baSnsBucket:                       BLK  CSD_TotalSensorCount
 002D           _CSD_baBtnFThreshold:                           ; Containing variable finger threshold for each button
 002D            CSD_baBtnFThreshold:                   BLK  CSD_TotalSensorCount
 0036           _CSD_baSnsOnMask:                               ; Sensor mask array containing on/off state of sensors
 0036            CSD_baSnsOnMask:                       BLK  ((CSD_TotalSensorCount-1)/8)+1
 0038           _CSD_baSnsDebounce:
 0038            CSD_baSnsDebounce:                     BLK  CSD_TotalSensorCount
 0041           _CSD_baLowBaselineReset:
 0041            CSD_baLowBaselineReset:                BLK  CSD_TotalSensorCount
 004A           
                IF CSD_SLIDERS_EXIST
 004A           _CSD_waCtrdPkValue:                             ; Array containing peak value of centroid
 004A            CSD_waCtrdPkValue:                     BLK  (2*CSD_SliderCount)
                ENDIF
                         
                ; Global variables
                export _CSD_waSnsBaseline
                export  CSD_waSnsBaseline
                export _CSD_waSnsDiff
                export  CSD_waSnsDiff
                export _CSD_baBtnFThreshold
                export  CSD_baBtnFThreshold
                export _CSD_baSnsOnMask
                export  CSD_baSnsOnMask
                
                ; Local variables
                export _CSD_fIsPressed
                export  CSD_fIsPressed
                export _CSD_bEndOfArray
                export  CSD_bEndOfArray
                export _CSD_bCurPos
                export  CSD_bCurPos
                export _CSD_bSnsMaskPtr
                export  CSD_bSnsMaskPtr
                
                IF CSD_SLIDERS_EXIST
                ; Local slider variables
                export _CSD_wDenom
                export  CSD_wDenom
                export _CSD_wCtrdPos
                export  CSD_wCtrdPos
                export _CSD_dNumer
                export  CSD_dNumer
                export _CSD_dMultTempX
                export  CSD_dMultTempX
                export _CSD_dMultTempY
                export  CSD_dMultTempY
                export _CSD_bCurCtrdStartPos
                export  CSD_bCurCtrdStartPos
                export _CSD_bCurCtrdSize
                export  CSD_bCurCtrdSize
                export _CSD_bBiggestCtrdStartPos
                export  CSD_bBiggestCtrdStartPos
                export _CSD_bBiggestCtrdSize
                export  CSD_bBiggestCtrdSize
                export _CSD_wCurPkValue
                export  CSD_wCurPkValue
                export _CSD_bCurPkPos
                export  CSD_bCurPkPos
                export _CSD_bDiplexMSB
                export  CSD_bDiplexMSB
                export _CSD_bDiplexLSB
                export  CSD_bDiplexLSB
                export _CSD_wDivBtwSns
                export  CSD_wDivBtwSns
                ENDIF
                
                ;@PSoC_UserCode_INIT@ (Do not change this line.)
                ;---------------------------------------------------
                ; Insert your custom declarations below this banner
                ;---------------------------------------------------
                
                ;------------------------
                ; User Includes
                ;------------------------
                
                
                ;------------------------
                ; User Constant Definitions
                ;------------------------
                
                
                ;------------------------
                ; User Variable Allocation
                ;------------------------
                
                
                ;---------------------------------------------------
                ; Insert your custom declarations above this banner
                ;---------------------------------------------------
                ;@PSoC_UserCode_END@ (Do not change this line.)
                
                ;------------------------
                ;  Constant Definitions
                ;------------------------
                AREA UserModules (ROM, REL, CON)
                
                ; For using two byte variables
 0001           LSB:  equ  1
 0000           MSB:  equ  0
 0000           
 0000           ; For using four byte variables
 0000           MMSB: equ 0
 0001           MLSB: equ 1
 0002           LMSB: equ 2
 0003           LLSB: equ 3
 0000           
 0028           FINGER_THRESHOLD:            equ   28h
 0014           NOISE_THRESHOLD:             equ   14h
 0014           NEGATIVE_NOISE_THRESHOLD:    equ   14h
 00C8           BASELINE_UPDATE_THRESHOLD:   equ   c8h
 0000           
 0000           
 0000           .SECTION
 0000           ;-----------------------------------------------------------------------------
 0000           ;  FUNCTION NAME: CSD_UpdateSensorBaseline(BYTE bSensorNum)
 0000           ;
 0000           ;  DESCRIPTION:
 0000           ;      Update baseline for one sensor. The algorithm is as follows:
 0000           ;        If difference count is negative baseline become raw count
 0000           ;        If difference count is above noise threshold do not update
 0000           ;        Else difference count is positive and within noise threshold so
 0000           ;        difference is halved and added to the bucket. When the bucket
 0000           ;        reaches the threshold the baseline increments and the bucket resets
 0000           ;-----------------------------------------------------------------------------
 0000           ;  STACK USAGE: 0 BYTES
 0000           ;
 0000           ;  ARGUMENTS: 
 0000           ;      A => Sensor Number
 0000           ;    
 0000           ;  RETURNS:    
 0000           ;      Nothing
 0000           ;
 0000           ;  SIDE EFFECTS: 
 0000           ;    The A and X registers may be modified by this or future implementations
 0000           ;    of this function.  The same is true for all RAM page pointer registers in
 0000           ;    the Large Memory Model.  When necessary, it is the calling function's
 0000           ;    responsibility to perserve their values across calls to fastcall16 
 0000           ;    functions.
 0000           ;
 0000            CSD_UpdateSensorBaseline:
 0000           _CSD_UpdateSensorBaseline:
                   IF ( RAM_USE_CLASS_3 & RAM_USE_CLASS_1 )
                   ; Nothing to do
                   ENDIF ; RAM_USE_CLASS_1
                
                   IF ( RAM_USE_CLASS_3 & RAM_USE_CLASS_2 )
                      IF ( SYSTEM_IDXPG_TRACKS_IDX_PP )
                   IF ( SYSTEM_LARGE_MEMORY_MODEL )
                      or   F, FLAG_PGMODE_01b
                   ENDIF ;  SYSTEM_LARGE_MEMORY_MODEL
                      ENDIF
                   ENDIF ; RAM_USE_CLASS_2
                
                   IF ( RAM_USE_CLASS_3 & RAM_USE_CLASS_3 )
                      IF ( SYSTEM_IDXPG_TRACKS_STK_PP )
                   IF ( SYSTEM_LARGE_MEMORY_MODEL )
 0000 70BF            and  F, ~FLAG_PGMODE_01b
                   ENDIF ;  SYSTEM_LARGE_MEMORY_MODEL
                      ENDIF
                   ENDIF ; RAM_USE_CLASS_3
                
                   IF ( RAM_USE_CLASS_3 & RAM_USE_CLASS_4 )
                   ; Nothing to do
                   ENDIF ; RAM_USE_CLASS_4
                
                   IF ( SYSTEM_LARGE_MEMORY_MODEL )
 0002 62D000          mov reg[CUR_PP], 0
                   ENDIF
                   IF ( SYSTEM_LARGE_MEMORY_MODEL )
 0005 70BF            and  F, ~FLAG_PGMODE_01b
                   ENDIF ;  SYSTEM_LARGE_MEMORY_MODEL
                   
 0007 5300         mov [CSD_bSensorNum], A                                                     ; Save sensor index
 0009 64           asl A
 000A 5C           mov X,A
 000B              
 000B              ; Get the difference counts
                   IF ( SYSTEM_LARGE_MEMORY_MODEL )
 000B 62D300          mov reg[IDX_PP], >CSD_waSnsResult
                   ENDIF
 000E 5201         mov A, [X+CSD_waSnsResult+LSB]
                   IF ( SYSTEM_LARGE_MEMORY_MODEL )
 0010 62D300          mov reg[IDX_PP], >CSD_waSnsBaseline
                   ENDIF
 0013 1301         sub A, [X+CSD_waSnsBaseline+LSB]
                   IF ( SYSTEM_LARGE_MEMORY_MODEL )
 0015 62D312   

⌨️ 快捷键说明

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