📄 pwm.inc
字号:
;;*****************************************************************************
;;*****************************************************************************
;; FILENAME: PWM.inc
;; Version: 2.5, Updated on 2006/05/15 at 15:09:31
;; Generated by PSoC Designer ver 4.4 b1884 : 14 Jan, 2007
;;
;; DESCRIPTION: Assembler declarations for the PWM8 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 PWM API's.
;--------------------------------------------------
PWM_CONTROL_REG_START_BIT: equ 0x01 ; Control register start bit
PWM_INT_REG: equ 0x0e1
PWM_INT_MASK: equ 0x08
;--------------------------------------------------
; Constants for PWM user defined values
;--------------------------------------------------
PWM_PERIOD: equ 0xfe
PWM_PULSE_WIDTH: equ 0x14
;--------------------------------------------------
; Register Address Constants for PWM
;--------------------------------------------------
PWM_COUNTER_REG: equ 0x2c ; DR0 Count register
PWM_PERIOD_REG: equ 0x2d ; DR1 Period register
PWM_COMPARE_REG: equ 0x2e ; DR2 Compare register
PWM_CONTROL_REG: equ 0x2f ; Control register
PWM_FUNC_REG: equ 0x2c ; Function register
PWM_INPUT_REG: equ 0x2d ; Input register
PWM_OUTPUT_REG: equ 0x2e ; Output register
;--------------------------------------------------
; PWM Macro 'Functions'
;--------------------------------------------------
macro PWM_Start_M
or reg[PWM_CONTROL_REG], PWM_CONTROL_REG_START_BIT
endm
macro PWM_Stop_M
and reg[PWM_CONTROL_REG], ~PWM_CONTROL_REG_START_BIT
endm
macro PWM_EnableInt_M
M8C_EnableIntMask PWM_INT_REG, PWM_INT_MASK
endm
macro PWM_DisableInt_M
M8C_DisableIntMask PWM_INT_REG, PWM_INT_MASK
endm
; end of file PWM.inc
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -