📄 tmt.asm
字号:
;/* */
;/* FUNCTION */
;/* */
;/* TMT_Retrieve_Clock */
;/* */
;/* DESCRIPTION */
;/* */
;/* This function returns the current value of the system clock. */
;/* */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Accelerated Technology, Inc. */
;/* */
;/* CALLED BY */
;/* */
;/* Application */
;/* */
;/* CALLS */
;/* */
;/* None */
;/* */
;/* INPUTS */
;/* */
;/* None */
;/* */
;/* OUTPUTS */
;/* */
;/* TMD_System_Clock Value of system clock */
;/* */
;/* HISTORY */
;/* */
;/* NAME DATE REMARKS */
;/* */
;/* D. Foxall 02-07-1996 TMS320C30 version 1.0 */
;/* J. Trippi 03-11-1997 Modified for large memory model */
;/* */
;/*************************************************************************/
.global _TMT_Retrieve_Clock
_TMT_Retrieve_Clock:
;UNSIGNED TMT_Retrieve_Clock(void)
;{
; /* Return the current value of the system clock. */
; return(TMD_System_Clock);
;
.if NU_BIG
LDP @_TMD_System_Clock ; Load Data Page Pointer
.endif
LDI @_TMD_System_Clock,R0 ; Pickup the system clock
RETS ; Return to caller
;}
;
;
;/*************************************************************************/
;/* */
;/* FUNCTION */
;/* */
;/* TMT_Read_Timer */
;/* */
;/* DESCRIPTION */
;/* */
;/* This function returns the current value of the count-down timer. */
;/* */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Accelerated Technology, Inc. */
;/* */
;/* CALLED BY */
;/* */
;/* TMC_Start_Timer Start timer function */
;/* */
;/* CALLS */
;/* */
;/* None */
;/* */
;/* INPUTS */
;/* */
;/* None */
;/* */
;/* OUTPUTS */
;/* */
;/* TMD_Timer Value of count-down timer */
;/* */
;/* HISTORY */
;/* */
;/* NAME DATE REMARKS */
;/* */
;/* D. Foxall 02-07-1996 TMS320C30 version 1.0 */
;/* J. Trippi 03-11-1997 Modified for large memory model */
;/* */
;/*************************************************************************/
.global _TMT_Read_Timer
_TMT_Read_Timer:
;UNSIGNED TMT_Read_Timer(void)
;{
; /* Return the current value of the count-down timer. */
; return(TMD_Timer);
;
.if NU_BIG
LDP @_TMD_Timer ; Load Data Page Pointer
.endif
LDI @_TMD_Timer,R0 ; Pickup the current timer value
RETS ; Return to caller
;}
;
;
;/*************************************************************************/
;/* */
;/* FUNCTION */
;/* */
;/* TMT_Enable_Timer */
;/* */
;/* DESCRIPTION */
;/* */
;/* This function enables the count-down timer with the specified */
;/* value. */
;/* */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Accelerated Technology, Inc. */
;/* */
;/* CALLED BY */
;/* */
;/* TMC_Start_Timer Start timer function */
;/* TMC_Timer_Task Timer expiration task */
;/* */
;/* CALLS */
;/* */
;/* None */
;/* */
;/* INPUTS */
;/* */
;/* time New count-down time */
;/* */
;/* OUTPUTS */
;/* */
;/* None */
;/* */
;/* HISTORY */
;/* */
;/* NAME DATE REMARKS */
;/* */
;/* D. Foxall 02-07-1996 TMS320C30 version 1.0 */
;/* J. Trippi 03-11-1997 Modified for large memory model */
;/* */
;/*************************************************************************/
.global _TMT_Enable_Timer
_TMT_Enable_Timer:
;VOID TMT_Enable_Timer(UNSIGNED time)
;{
; /* Place the new time value into the count-down timer. */
; TMD_Timer = time;
;
.if NU_BIG
LDP @_TMD_Timer ; Load Data Page Pointer
.endif
.if NU_STACK
LDI SP,AR0
LDI *-AR0(1),R0 ; Pickup the timer request value
.else
LDI AR2,R0
.endif
STI R0,@_TMD_Timer ; Set the count-down timer
;
; /* Indicate that the timer is active. */
; TMD_Timer_State = TM_ACTIVE;
;
.if NU_BIG
LDP @_TMD_Timer_State ; Load Data Page Pointer
.endif
LDI TM_ACTIVE,R0 ; Activate the timer
STI R0,@_TMD_Timer_State ; Activate the timer
RETS ; Return to caller
;}
;
;
;/*************************************************************************/
;/* */
;/* FUNCTION */
;/* */
;/* TMT_Adjust_Timer */
;/* */
;/* DESCRIPTION */
;/* */
;/* This function adjusts the count-down timer with the specified */
;/* value- if the new value is less that the current. */
;/* */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Accelerated Technology, Inc. */
;/* */
;/* CALLED BY */
;/* */
;/* TMC_Start_Timer Start timer function */
;/* */
;/* CALLS */
;/* */
;/* None */
;/* */
;/* INPUTS */
;/* */
;/* time New count-down time */
;/* */
;/* OUTPUTS */
;/* */
;/* None */
;/* */
;/* HISTORY */
;/* */
;/* NAME DATE REMARKS */
;/* */
;/* D. Foxall 02-07-1996 TMS320C30 version 1.0 */
;/* J. Trippi 03-11-1997 Modified for large memory model */
;/* M. Trippi 10-07-1997 Restored the IE register from */
;/* TCD_Interrupt_Level to be */
;/* consistent with the rest of */
;/* the port. */
;/* */
;/*************************************************************************/
.global _TMT_Adjust_Timer
_TMT_Adjust_Timer:
;VOID TMT_Adjust_Timer(UNSIGNED time)
;{
; /* Lockout interrupts. */
RPTS 0
AND GIENOT,ST ; XIONGZHANGXUE
; LDI 0,IE ; Lockout interrupts
; NOP ; Interrupt lockout might not occur
; NOP ; for a few instructions
;
; /* Determine if the new time is less than current time value. */
; if (time < TMD_Timer)
;
.if NU_BIG
LDP @_TMD_Timer ; Load Data Page Pointer
.endif
.if NU_STACK
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -