📄 csdtable.lis
字号:
0001 CSD_FEEDBACK_P3_1: equ 1
0002 CSD_FEEDBACK_P1_5: equ 2
0000
0002 CSD_CAPACITOR_PIN: equ 2
0001 CSD_CAPACITOR_P0_1: equ 1
0002 CSD_CAPACITOR_P0_3: equ 2
0000
0000 CSD_AUTORESET: equ 0
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
0001 CSD_ButtonCount: equ 1h
0001 CSD_SliderCount: equ 1h
0009 CSD_TotalSensorCount: equ 9h
0000
0001 CSD_BUTTONS_EXIST: equ 1h
0001 CSD_SLIDERS_EXIST: equ 1h
0000
000A CSD_HYSTERESIS: equ ah
0003 CSD_Debounce: equ 3h
0032 CSD_LowBaselineReset: equ 32h
0000
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 0x9 sensors.
0000 CSD_Sensor_Table:
0000 _CSD_Sensor_Table:
0000 0104 dw 0x0104 // Port 1 Bit 2
0002 0001 dw 0x0001 // Port 0 Bit 0
0004 0002 dw 0x0002 // Port 0 Bit 1
0006 0004 dw 0x0004 // Port 0 Bit 2
0008 0280 dw 0x0280 // Port 2 Bit 7
000A 0010 dw 0x0010 // Port 0 Bit 4
000C 0020 dw 0x0020 // Port 0 Bit 5
000E 0040 dw 0x0040 // Port 0 Bit 6
0010 0080 dw 0x0080 // Port 0 Bit 7
0012
0012
0012 ;-----------------------------------------------------------------------------
0012 ; The Group Table defines each of the groups of button sensors or sliders.
0012 ; There is one entry for each slider plus one for the free button sensors.
0012 ; The first entry is always the free sensors. Each entry is four bytes.
0012 ;
0012 ; The first byte is the index in the Sensor Table where the group starts.
0012 ;
0012 ; The second byte is how many sensors are in that group. For example, in a
0012 ; system where there are 6 free sensors and two sliders, the first with 8
0012 ; sensors and the second with 4, the table would look like the following.
0012 ; db 0, 8
0012 ; db 8, 8
0012 ; db 16, 4
0012 ;
0012 ; The third byte signifies whether the slider is diplexed or not (4 is
0012 ; diplexed, 0 is not diplexed).
0012 ;
0012 ; The fourth, fifth, and sixth bytes are the fixed point multiplier that the
0012 ; slider's calculated centroid will be multiplied by to achieve the resolution
0012 ; desired in the CSD wizard. The multiplier is three bytes containing the
0012 ; following bit definitions:
0012 ; MSB:
0012 ; bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
0012 ; x2^15 x2^14 x2^13 x2^12 x2^11 x2^10 x2^9 x2^8
0012 ; ISB:
0012 ; bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
0012 ; x128 x64 x32 x16 x8 x4 x2 x1
0012 ; LSB:
0012 ; bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
0012 ; x1/2 x1/4 x1/8 x1/16 x1/32 x1/64 x1/128 x1/256
0012 ;
0012 ; The formula for the resolution is:
0012 ; Resolution = (SensorsInSlider - 1) * Multiplier
0012 ;
0012 ; For example, if you had a 10 sensor slider and you wanted a resolution of
0012 ; 100, the multiplier would need to be 11.109375 to get the closest
0012 ; approximation (using 256ths). Therefore the fixed point value would be:
0012 ; MSB 00h
0012 ; ISB 0bh
0012 ; LSB 1ch
0012 ; as 8+2+1+1/16+1/32+1/64). The GUI automatically calculates these values
0012 ; based on the resolution needed.
0012 ;
0012 ; There are 0x1 groups counting the free sensors.
0012 ;-----------------------------------------------------------------------------
0012 CSD_Group_Table:
0012 _CSD_Group_Table:
0012 ; Group Table:
0012 ; Origin Count Diplex? DivBtwSw(wholeMSB, wholeLSB, fractByte)
0012 000100000000 db 0x0, 0x1, 0x00, 0x00, 0x00, 0x00 ; Buttons
0018 010804000699 db 0x1, 0x8, 0x4, 0x0, 0x6, 0x99 ; Slider 1
001E
001E
001E ;-----------------------------------------------------------------------------
001E ; Diplex table scan order data is produced for a group when it is a slider and
001E ; is also diplexed. Otherwise a label is created but no data is placed. The
001E ; data represents the physical representation of the sensors in their location
001E ; on the PCB. A label containing the pointer to the corresponding table is
001E ; also produced for referencing in the high-level centroid calculation
001E ; function.
001E ;-----------------------------------------------------------------------------
001E DiplexTable_0:
001E ; This group is not a diplexed slider
001E DiplexTable_1:
001E 00010203040506070003060104070205 db 0,1,2,3,4,5,6,7,0,3,6,1,4,7,2,5 // 8 switch slider
002E
002E
002E CSD_Diplex_Table:
002E _CSD_Diplex_Table:
002E 1E1E db >DiplexTable_0, <DiplexTable_0
0030 1E1E db >DiplexTable_1, <DiplexTable_1
0032
0032 .ENDLITERAL
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -