📄 sacmv32.lst
字号:
.PUBLIC _SP_GetResource
.PUBLIC F_RampUpDAC1
.PUBLIC F_RampDnDAC1
.PUBLIC F_RampUpDAC2
.PUBLIC F_RampDnDAC2
.PUBLIC _STD_RampUpDAC1
.PUBLIC _STD_RampDnDAC1
.PUBLIC _STD_RampUpDAC2
.PUBLIC _STD_RampDnDAC2
/////////////////////////////////////////////////////////////////
// Note: This register map to the P_INT_Ctrl(0x7010)
// User's interrupt setting have to combine with this register
// while co-work with SACM library.
//
// See. following function for example:
// F_SP_SACM_A2000_Init_:
// F_SP_SACM_S480_Init_:
// F_SP_SACM_S240_Init_:
// F_SP_SACM_MS01_Init_:
// F_SP_SACM_DVR_Init_:
//////////////////////////////////////////////////
.external R_InterruptStatus // declared in spce.asm
//////////////////////////////////////////////////
.define C_QueueSize 50
0000007E .RAM
0000007E 00 00 .VAR R_Queue
0000007F 00 00 00 00 .DW C_QueueSize-1 DUP(0)
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00
000000B0 00 00 .VAR R_ReadIndex
000000B1 00 00 .VAR R_WriteIndex
00009095 .CODE
//////////////////////////////////////////////////////
// Ramp Functions
//////////////////////////////////////////////////////
////////////////////////////////////////////////////////
// Function: _SP_RampUpDAC1
// Description: Ramp Up before using DAC to avoid "bow" sound
// from speaker
// Syntax : SP_RampUpDAC1()
// Destory: R1,R2
////////////////////////////////////////////////////////
_SP_RampUpDAC1: .PROC
F_SP_RampUpDAC1:
00009095 90 D4 push r1,r2 to [sp]
00009096 11 93 17 70 r1=[P_DAC1]
00009098 09 B3 C0 FF r1 &= ~0x003f
0000909A 09 43 00 80 cmp r1,0x8000
0000909C 0E 0E jb L_RU_NormalUp
0000909D 19 5E je L_RU_End
L_RU_DownLoop:
0000909E 40 F0 01 91 call F_Delay
000090A0 41 94 r2 = 0x0001
000090A1 1A D5 12 70 [P_Watchdog_Clear] = r2
000090A3 09 23 40 00 r1 -= 0x40
000090A5 19 D3 17 70 [P_DAC1] = r1
000090A7 09 43 00 80 cmp r1,0x8000
000090A9 4C 4E jne L_RU_DownLoop
L_RD_DownEnd:
000090AA 0C EE jmp L_RU_End
L_RU_NormalUp:
L_RU_Loop:
000090AB 40 F0 01 91 call F_Delay
000090AD 41 94 r2 = 0x0001
000090AE 1A D5 12 70 [P_Watchdog_Clear] = r2
000090B0 09 03 40 00 r1 += 0x40
000090B2 19 D3 17 70 [P_DAC1] = r1
000090B4 09 43 00 80 cmp r1, 0x8000
000090B6 4C 4E jne L_RU_Loop
L_RU_End:
000090B7 90 90 pop r1,r2 from [sp]
000090B8 90 9A retf
.ENDP
////////////////////////////////////////////////////////
// Function: _SP_RampDnDAC1
// Description: Ramp down after using DAC to avoid "bow" sound
// from speaker
// Syntax : SP_RampDnDAC1()
// Destory: R1,R2
////////////////////////////////////////////////////////
_SP_RampDnDAC1: .PROC
F_SP_RampDnDAC1:
000090B9 90 D4 push r1,r2 to [sp]
//int off
000090BA 11 93 17 70 r1 = [P_DAC1]
000090BC 09 B3 C0 FF r1 &= ~0x003F
000090BE 0A 5E jz L_RD_End
L_RD_Loop:
000090BF 40 F0 01 91 call F_Delay
000090C1 41 94 r2 = 0x0001
000090C2 1A D5 12 70 [P_Watchdog_Clear] = r2
000090C4 09 23 40 00 r1 -= 0x40
000090C6 19 D3 17 70 [P_DAC1] = r1
000090C8 4A 4E jnz L_RD_Loop
L_RD_End:
000090C9 90 90 pop r1,r2 from [sp]
000090CA 90 9A retf
.ENDP
////////////////////////////////////////////////////////
// Function: _SP_RampUpDAC2
// Description: Ramp Up before using DAC to avoid "bow" sound
// from speaker
// Syntax : SP_RampUpDAC2()
// Destory: R1,R2
////////////////////////////////////////////////////////
_SP_RampUpDAC2: .PROC
F_SP_RampUpDAC2:
000090CB 90 D4 push r1,r2 to [sp]
000090CC 11 93 16 70 r1=[P_DAC2]
000090CE 09 B3 C0 FF r1 &= ~0x003f
000090D0 09 43 00 80 cmp r1,0x8000
000090D2 0E 0E jb L_RU_NormalUp_
000090D3 5D 5E je L_RU_End
L_RU_DownLoop_:
000090D4 40 F0 01 91 call F_Delay
000090D6 41 94 r2 = 0x0001
000090D7 1A D5 12 70 [P_Watchdog_Clear] = r2
000090D9 09 23 40 00 r1 -= 0x40
000090DB 19 D3 16 70 [P_DAC2] = r1
000090DD 09 43 00 80 cmp r1,0x8000
000090DF 4C 4E jne L_RU_DownLoop_
L_RD_DownEnd_:
000090E0 0C EE jmp L_RU_End_
L_RU_NormalUp_:
L_RU_Loop_:
000090E1 40 F0 01 91 call F_Delay
000090E3 41 94 r2 = 0x0001
000090E4 1A D5 12 70 [P_Watchdog_Clear] = r2
000090E6 09 03 40 00 r1 += 0x40
000090E8 19 D3 16 70 [P_DAC2] = r1
000090EA 09 43 00 80 cmp r1, 0x8000
000090EC 4C 4E jne L_RU_Loop_
L_RU_End_:
000090ED 90 90 pop r1,r2 from [sp]
000090EE 90 9A retf
.ENDP
////////////////////////////////////////////////////////
// Function: _SP_RampDnDAC2
// Description: Ramp down after using DAC to avoid "bow" sound
// from speaker
// Syntax : SP_RampDnDAC2()
// Destory: R1,R2
////////////////////////////////////////////////////////
_SP_RampDnDAC2: .PROC
F_SP_RampDnDAC2:
//int off
000090EF 90 D4 push r1,r2 to [sp]
000090F0 11 93 16 70 r1 = [P_DAC2]
000090F2 09 B3 C0 FF r1 &= ~0x003F
000090F4 0A 5E jz L_RD_End_
L_RD_Loop_:
000090F5 40 F0 01 91 call F_Delay
000090F7 41 94 r2 = 0x0001
000090F8 1A D5 12 70 [P_Watchdog_Clear] = r2
000090FA 09 23 40 00 r1 -= 0x40
000090FC 19 D3 16 70 [P_DAC2] = r1
000090FE 4A 4E jnz L_RD_Loop_
L_RD_End_:
000090FF 90 90 pop r1,r2 from [sp]
00009100 90 9A retf
.ENDP
//-------------------------------------------------------
// Function: F_Delay
// Description: Provide delay for Ramp up/down
// The delay time is adjustable by adjusting C_RampDelay
// Destory: R1
//-------------------------------------------------------
F_Delay:
00009101 88 D2 push r1 to [sp]
00009102 09 93 50 00 r1 = C_RampDelay; // Ramp Up/Dn delay per step
L_D_Loop:
00009104 41 22 r1 -= 1
00009105 42 4E jnz L_D_Loop
00009106 88 90 pop r1 from [sp]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -