📄 system.lst
字号:
< .DEFINE C_AD_Vref_VDD 0x0080; //b7=1: Vref is VDD
< .DEFINE C_AD_Vref_VRTPAD 0x0000; //b7=0: Vref is from pin "VRTPAD"
< .DEFINE C_AD_COMP 0x4000; //b14=1: output voltage of DAC0<Analog input signal
< //b14=0: output voltage of DAC0>Analog input signal
< .DEFINE C_AD_RDY 0x8000; //b15=1: A/D digital data ready; 0: not ready
< .endif
<
< .if BODY_TYPE == SPCE500A
< .DEFINE C_AD 0x0001 //
< .DEFINE C_DA 0x0000 //
< .DEFINE C_MIC 0x0000 //
< .DEFINE C_LINE 0x0002 //
< .endif
< //----------------------------------------------
<
<
< // Define for P_DAC_Ctrl
< //----------------------------------------------
< .if BODY_TYPE == SPCE061A
< .DEFINE C_DAC1_Direct 0x0000; // b8 b7: DAC1 latch
< .DEFINE C_DAC1_LatchA 0x0080; // Latch data to DAC1 by TimerA
< .DEFINE C_DAC1_LatchB 0x0100; // Latch data to DAC1 by TimerB
< .DEFINE C_DAC1_LatchAB 0x0180; // Latch data to DAC1 by TimerA or TimerB
<
< .DEFINE C_DAC2_Direct 0x0000; // b6 b5: DAC2 latch
< .DEFINE C_DAC2_LatchA 0x0020; // Latch data to DAC2 by TimerA
< .DEFINE C_DAC2_LatchB 0x0040; // Latch data to DAC2 by TimerB
< .DEFINE C_DAC2_LatchAB 0x0060; // Latch data to DAC2 by TimerA or TimerB
<
< .DEFINE C_ADC_Direct 0x0000; // b4 b3: ADC latch
< .DEFINE C_ADC_LatchA 0x0008; // Latch data to ADC by TimerA
< .DEFINE C_ADC_LatchB 0x0010; // Latch data to ADC by TimerB
< .DEFINE C_ADC_LatchAB 0x0018; // Latch data to ADC by TimerA or TimerB
< .endif
<
< .if BODY_TYPE == SPCE500A
< .DEFINE C_PushPull 0x0000 // b0, (default)
< .DEFINE C_DoubleEnd 0x0001 // b0
< .DEFINE C_DAC_Mode 0x0000 // b1, (default)
< .DEFINE C_PWM_Mode 0x0002 // b1
<
< .DEFINE C_D1_Direct 0x0000 // DAC1 latch
< .DEFINE C_D1_LatchA 0x0008 //
< .DEFINE C_D1_LatchB 0x0010 //
< .DEFINE C_D1_LatchAB 0x0018 //
<
< .DEFINE C_D2_Direct 0x0000 // DAC2 latch
< .DEFINE C_D2_LatchA 0x0020 //
< .DEFINE C_D2_LatchB 0x0040 //
< .DEFINE C_D2_LatchAB 0x00C0 //
< .endif
< //----------------------------------------------
<
< // Define for P_LVD_Ctrl
< //----------------------------------------------
< .if BODY_TYPE == SPCE061A
< .DEFINE C_LVD24V 0x0000; // LVD = 2.4V; b1b0
< .DEFINE C_LVD28V 0x0001; // LVD = 2.8V
< .DEFINE C_LVD32V 0x0002; // LVD = 3.2V
< .endif
<
< .if BODY_TYPE == SPCE500A
< .DEFINE C_LVD26V 0x0000 // LVD = 2.6V
< .DEFINE C_LVD30V 0x0001 // LVD = 3.0V
< .DEFINE C_LVD36V 0x0002 // LVD = 3.6V
< .DEFINE C_LVD40V 0x0003 // LVD = 4.0V
< .endif
<
< .DEFINE C_LVD_Result 0x8000; // b15 = 1: below the selected LVD level
< //----------------------------------------------
<
<
< // SPCE061 flash operation instruction definition
< //----------------------------------------------
< .if BODY_TYPE == SPCE061A
< .DEFINE C_EnableFlashAccess 0xAAAA;
< .DEFINE C_EraseFlashPage 0x5511;
< .DEFINE C_ProgramFlash 0x5533;
< .endif
< //----------------------------------------------
<
<
<
< //===============================================================
< // Sunplus APIs for SPCE 061A
< //===============================================================
< //////////////////////////////////////////////////
< // Note: This register will map to the P_INT_Ctrl
< // (0x7010), The SACMvxx.lib use this register to
< // combine with user's interrupt setting.
< // In SPCE061, it is not necessary since the
< // P_INT_Mask(0x702D) already does this. It is for
< // compatibility to keep it here.
< //////////////////////////////////////////////////
< //.EXTERNAL R_InterruptStatus
<
< //========================================================================================
< // End of SPCE061A.inc
< //========================================================================================
<
<
<
.include key.inc;
< //========================================================================================
< // Progarm: The head file for pcplay.asm
< // Wrote by: Andy Hsu
< // Last modified date:
< // 2000/06/23: first version
< // 2000/07/20: modified
< //========================================================================================
<
< .EXTERNAL F_Key_Scan_Initial;
< .EXTERNAL F_Key_Scan_ServiceLoop; // 1 scan line +Vcc
< .EXTERNAL F_Key_Scan_ServiceLoop_2; // 2 scan line +Vcc / IOA
< .EXTERNAL F_Key_DebounceCnt_Down;
< .EXTERNAL F_SP_GetCh;
.EXTERNAL R_InterruptStatus
.public R_SpeechType;
0000064E .RAM
0000064E 00 00 .VAR R_SpeechType;
0000A4C8 .CODE
.public _System_Initial;
.public F_System_Initial;
_System_Initial: .PROC
F_System_Initial:
0000A4C8 40 F0 D9 A4 call F_User_Init_IO; //
// R1 = 0 // The interrupt is controlled by user
0000A4CA 09 93 00 20 R1=C_FIQ_TMA
0000A4CC 19 D3 4F 06 [R_InterruptStatus] = R1 //
0000A4CE 19 D3 10 70 [P_INT_Ctrl] = R1 //
0000A4D0 90 9A retf;
.ENDP;
//****************************************************************
// Function: Main Loop of system
// Input: None
// Output: None
// Using:
// call F_System_ServiceLoop; (in assembly domain)
// System_ServiceLoop(); (in C domain)
//****************************************************************
.public _System_ServiceLoop;
.public F_System_ServiceLoop;
_System_ServiceLoop: .PROC
F_System_ServiceLoop:
0000A4D1 40 F0 33 A6 call F_Key_DebounceCnt_Down; // calling debounce subroutine for key scan subroutine
0000A4D3 40 F0 0D A6 call F_Key_Scan_ServiceLoop; // calling key scan subroutine
// Add other general service functions here
0000A4D5 41 92 R1=0x0001; // Clear watch dog
0000A4D6 19 D3 12 70 [P_Watchdog_Clear]=R1; //
0000A4D8 90 9A retf;
.ENDP;
F_User_Init_IO:
0000A4D9 09 93 F0 FF r1 = 0xfff0; //hi Led, low key
0000A4DB 19 D3 03 70 [P_IOA_Attrib] = r1;
0000A4DD 19 D3 02 70 [P_IOA_Dir] = r1;
0000A4DF 19 D3 00 70 [P_IOA_Data] = r1;
//Set IOB7 as Input Floating, IOB10 as Output Buffer Low
0000A4E1 09 93 7F FF R1 = 0xFF7F;
0000A4E3 19 D3 07 70 [P_IOB_Dir] = R1;
0000A4E5 09 93 FF FF R1 = 0xFFFF;
0000A4E7 19 D3 08 70 [P_IOB_Attrib] = R1;
0000A4E9 43 92 R1 = 0x0003;
0000A4EA 19 D3 05 70 [P_IOB_Data] = R1;
// Add by sls
0000A4EC 09 93 C3 00 R1 = 0x00C3;
0000A4EE 19 D3 1E 70 [P_SIO_Ctrl] = R1;
// R1 = 0x0060; //
// [P_IOA_Buffer] = R1; // b7 reserved, *CS=1, *OE=1, *WE=0
0000A4F0 90 9A retf;
/////////////////////////////////////////////////////
//**************************************//
//128Hz时基信号中断的初始化函数
//函数名称: SP_INT_128Hz()
//*************************************//
.public _SP_INT_128Hz;
_SP_INT_128Hz:
0000A4F1 40 92 R1 = 0x0000;
0000A4F2 19 D3 0E 70 [P_TimeBase_Setup]=r1 //TMB2选择128HZ
0000A4F4 41 92 r1 = 0x0001 //开中断IRQ6_TMB2
0000A4F5 19 D3 10 70 [P_INT_Ctrl]= r1
0000A4F7 41 F1 int IRQ
0000A4F8 90 9A retf;
//**************************************//
//开中断函数
//函数名称 Open_Interrupt()
//**************************************//
.public _Open_Interrupt
_Open_Interrupt:
0000A4F9 43 F1 int irq,fiq
0000A4FA 90 9A retf
//***************************************//
//关中断函数
//函数名称 Close_Interrupt
//***************************************//
.public _Close_Interrupt
_Close_Interrupt:
0000A4FB 40 F1 int off ;
0000A4FC 90 9A retf
0 error(s), 0 warning(s).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -