⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pwm16.inc

📁 此程序是用CYPRESS单片机编写
💻 INC
字号:
;;*****************************************************************************
;;*****************************************************************************
;;  FILENAME: PWM16.inc
;;   Version: 2.4, Updated on 2005/09/30 at 11:09:49
;;  Generated by PSoC Designer ver 4.2  b1013 : 02 September, 2004
;;
;;  DESCRIPTION: Assembler declarations for the PWM16 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 PWM16 API's.
;--------------------------------------------------

PWM16_CONTROL_REG_START_BIT:               equ 0x01    ; Control register start bit
PWM16_INT_REG:                             equ 0x0e1
PWM16_INT_MASK:                            equ 0x04


;--------------------------------------------------
; Constants for PWM16 user defined values
;--------------------------------------------------

PWM16_PERIOD:                              equ 0xffff
PWM16_PULSE_WIDTH:                         equ 0x8000


;--------------------------------------------------
; Register Address Constants for PWM16
;--------------------------------------------------

PWM16_COUNTER_LSB_REG:                 equ 0x24   ; DR0 Count register
PWM16_COUNTER_MSB_REG:                 equ 0x28
PWM16_PERIOD_LSB_REG:                  equ 0x25   ; DR1 Period register
PWM16_PERIOD_MSB_REG:                  equ 0x29
PWM16_COMPARE_LSB_REG:                 equ 0x26   ; DR2 Compare register
PWM16_COMPARE_MSB_REG:                 equ 0x2a
PWM16_CONTROL_LSB_REG:                 equ 0x27   ; Control register
PWM16_CONTROL_MSB_REG:                 equ 0x2b
PWM16_FUNC_LSB_REG:                    equ 0x24   ; Function register
PWM16_FUNC_MSB_REG:                    equ 0x28
PWM16_INPUT_LSB_REG:                   equ 0x25   ; Input register
PWM16_INPUT_MSB_REG:                   equ 0x29
PWM16_OUTPUT_LSB_REG:                  equ 0x26   ; Output register
PWM16_OUTPUT_MSB_REG:                  equ 0x2a


;--------------------------------------------------
; PWM16 Macro 'Functions'
;--------------------------------------------------

   macro PWM16_Start_M
   or    reg[PWM16_CONTROL_LSB_REG],  PWM16_CONTROL_REG_START_BIT
   endm

   macro PWM16_Stop_M
   and   reg[PWM16_CONTROL_LSB_REG], ~PWM16_CONTROL_REG_START_BIT
   endm

   macro PWM16_EnableInt_M
   M8C_EnableIntMask PWM16_INT_REG, PWM16_INT_MASK
   endm

   macro PWM16_DisableInt_M
   M8C_DisableIntMask PWM16_INT_REG, PWM16_INT_MASK
   endm


; end of file PWM16.inc

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -