📄 hardware.lst
字号:
//... Define for P_LVD_Ctrl ...................
.DEFINE C_LVD24V 0x0000 // LVD = 2.4V
.DEFINE C_LVD28V 0x0001 // LVD = 2.8V
.DEFINE C_LVD32V 0x0002 // LVD = 3.2V
.DEFINE C_LVD36V 0x0003 // LVD = 3.6V
/////////////////////////////////////////////////////////////////
// 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_:
//////////////////////////////////////////////////
00000001 .IRAM
00000001 00 00 .VAR R_InterruptStatus = 0 //
//////////////////////////////////////////////////
.define C_RampDelayTime 16
.define C_QueueSize 100
00000002 00 00 .VAR R_Queue
00000003 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 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
00 00 00 00
00 00
00000066 00 00 .VAR R_ReadIndex
00000067 00 00 .VAR R_WriteIndex
000082AB .CODE
///////////////////////////////////////////
// Function: Initial Queue
// Destory: R1,R2
///////////////////////////////////////////
_SP_InitQueue: .PROC
_SP_InitQueue_A2000:
_SP_InitQueue_S480:
_SP_InitQueue_S240:
_SP_InitQueue_MS01:
_SP_InitQueue_DVR:
F_SP_InitQueue_A2000:
F_SP_InitQueue_S480:
F_SP_InitQueue_S240:
F_SP_InitQueue_MS01:
F_SP_InitQueue_DVR:
F_SP_InitQueue:
000082AB 09 93 02 00 R1 = R_Queue
000082AD 40 94 R2 = 0
L_ClearQueueLoop?:
000082AE D1 D4 [R1++] = R2
000082AF 09 43 66 00 cmp R1, R_Queue+C_QueueSize
000082B1 44 4E jne L_ClearQueueLoop?
000082B2 40 92 R1 = 0
000082B3 19 D3 66 00 [R_ReadIndex] = R1
000082B5 19 D3 67 00 [R_WriteIndex] = R1
000082B7 90 9A RETF
.ENDP
///////////////////////////////////////////
// Function: Get a data form Queue
// Output: R1: Data
// R2: return value
// Destory: R1,R2
///////////////////////////////////////////
F_SP_ReadQueue_A2000:
F_SP_ReadQueue_S480:
F_SP_ReadQueue_S240:
F_SP_ReadQueue_MS01:
F_SP_ReadQueue_DVR:
F_SP_ReadQueue:
000082B8 12 95 66 00 R2 = [R_ReadIndex]
000082BA 12 45 67 00 cmp R2,[R_WriteIndex]
000082BC 0D 5E je L_RQ_QueueEmpty
000082BD 0A 05 02 00 R2 += R_Queue // get queue data address
000082BF C2 92 R1 = [R2]
000082C0 12 95 66 00 R2 = [R_ReadIndex]
000082C2 41 04 R2 += 1
000082C3 0A 45 64 00 cmp R2, C_QueueSize
000082C5 01 4E jne L_RQ_NotQueueBottom
000082C6 40 94 R2 = 0
L_RQ_NotQueueBottom:
000082C7 1A D5 66 00 [R_ReadIndex] = R2
//r2 = 0x0000 // get queue data
000082C9 90 9A retf
L_RQ_QueueEmpty:
//r2 = 0x8000 // queue empty
000082CA 90 9A retf
///////////////////////////////////////////
// Function: Get a data from Queue but do
// not change queue index
// R1: output
// Destory: R1,R2
///////////////////////////////////////////
F_SP_ReadQueue_NIC:
F_SP_ReadQueue_NIC_A2000:
F_SP_ReadQueue_NIC_S480:
F_SP_ReadQueue_NIC_S240:
F_SP_ReadQueue_NIC_MS01:
F_SP_ReadQueue_NIC_DVR:
000082CB 12 95 66 00 R2 = [R_ReadIndex]
000082CD 12 45 67 00 cmp R2,[R_WriteIndex]
000082CF 03 5E je L_RQ_QueueEmpty?
000082D0 0A 05 02 00 R2 += R_Queue // get queue data index
000082D2 C2 92 R1 = [R2]
L_RQ_QueueEmpty?:
000082D3 90 9A RETF
///////////////////////////////////////////
// Function: Put a data to Queue
// R1: Input
// Destory: R1,R2
///////////////////////////////////////////
F_SP_WriteQueue_A2000:
F_SP_WriteQueue_S480:
F_SP_WriteQueue_S240:
F_SP_WriteQueue_MS01:
F_SP_WriteQueue_DVR:
F_SP_WriteQueue:
000082D4 12 95 67 00 R2 = [R_WriteIndex] // put data to queue
000082D6 0A 05 02 00 R2 += R_Queue
000082D8 C2 D2 [R2] = R1
000082D9 12 95 67 00 R2 = [R_WriteIndex]
000082DB 41 04 R2 += 1
000082DC 0A 45 64 00 cmp R2, C_QueueSize
000082DE 01 4E jne L_WQ_NotQueueBottom
000082DF 40 94 R2 = 0
L_WQ_NotQueueBottom:
000082E0 1A D5 67 00 [R_WriteIndex] = R2
000082E2 90 9A RETF
///////////////////////////////////////////
// Function: Test Queue Status
// o/p: R1
// Destory: R1
///////////////////////////////////////////
F_SP_TestQueue_A2000:
F_SP_TestQueue_S480:
F_SP_TestQueue_S240:
F_SP_TestQueue_MS01:
F_SP_TestQueue_DVR:
F_SP_TestQueue:
//... Test Queue Empty ...
000082E3 11 93 66 00 R1 = [R_ReadIndex]
000082E5 11 43 67 00 cmp R1,[R_WriteIndex]
000082E7 12 5E je L_TQ_QueueEmpty
//... Test Queue Full ...
000082E8 11 93 66 00 R1 = [R_ReadIndex] // For N Queue Full: 1.R=0 and W=N-1 2. R<>0 and W=R-1
000082EA 05 4E jnz L_TQ_JudgeCond2
000082EB 11 93 67 00 R1 = [R_WriteIndex]
000082ED 09 43 63 00 cmp R1, C_QueueSize-1 // Cond1
000082EF 08 5E je L_TQ_QueueFull
L_TQ_JudgeCond2:
000082F0 11 93 66 00 R1 = [R_ReadIndex]
000082F2 41 22 R1 -=1
000082F3 11 43 67 00 cmp R1,[R_WriteIndex]
000082F5 02 5E je L_TQ_QueueFull
000082F6 40 92 r1 = 0 // not Full, not empty
000082F7 90 9A retf
L_TQ_QueueFull:
000082F8 41 92 r1 = 1 // full
000082F9 90 9A retf
L_TQ_QueueEmpty:
000082FA 42 92 r1 = 2 // empty
000082FB 90 9A retf
///////////////////////////////////////////////////////////////////////////////
// Function: The partial code of hardware setting of SACM_A2000_Initial()
// or F_SACM_A2000_Initial:
// Note: The following functions are the partial code of original
// initial subroutine. (H/W setting part)
//
// Ex: F_SACM_A2000_Initial:
// ...
// call F_SP_SACM_A2000_Init_ : S480/S240/MS01 is same
// ...
// retf
////////////////////////////////////////////////////////////////////////////////
F_SP_SACM_A2000_Init_:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -