📄 timer.inc
字号:
;;*****************************************************************************
;;*****************************************************************************
;; FILENAME: Timer.inc
;; Version: 2.4, Updated on 2005/01/10 at 15:23:00
;; Generated by PSoC Designer ver 4.2 b1013 : 02 September, 2004
;;
;; DESCRIPTION: Assembler declarations for the Timer8 user module interface
;; for the 22/24/27/29xxx PSoC family of devices
;;-----------------------------------------------------------------------------
;; Copyright (c) Cypress MicroSystems 2000-2004. All Rights Reserved.
;;*****************************************************************************
;;*****************************************************************************
include "m8c.inc"
;--------------------------------------------------
; Constants for Timer API's.
;--------------------------------------------------
Timer_CONTROL_REG_START_BIT: equ 0x01 ; Control register start bit
Timer_INT_REG: equ 0x0e1
Timer_INT_MASK: equ 0x02
;--------------------------------------------------
; Constants for Timer user defined values
;--------------------------------------------------
Timer_PERIOD: equ 0x40
Timer_COMPARE_VALUE: equ 0x20
;--------------------------------------------------
; Register Address Constants for Timer
;--------------------------------------------------
Timer_COUNTER_REG: equ 0x24 ; DR0 Counter register
Timer_PERIOD_REG: equ 0x25 ; DR1 Period register
Timer_COMPARE_REG: equ 0x26 ; DR2 CompareValue register
Timer_CONTROL_REG: equ 0x27 ; Control register
Timer_FUNC_REG: equ 0x24 ; Function register
Timer_INPUT_REG: equ 0x25 ; Input register
Timer_OUTPUT_REG: equ 0x26 ; Output register
;--------------------------------------------------
; Timer Macro 'Functions'
;--------------------------------------------------
macro Timer_Start_M
or reg[Timer_CONTROL_REG], Timer_CONTROL_REG_START_BIT
endm
macro Timer_Stop_M
and reg[Timer_CONTROL_REG], ~Timer_CONTROL_REG_START_BIT
endm
macro Timer_EnableInt_M
M8C_EnableIntMask Timer_INT_REG, Timer_INT_MASK
endm
macro Timer_DisableInt_M
M8C_DisableIntMask Timer_INT_REG, Timer_INT_MASK
endm
; end of file Timer.inc
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -