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

📄 pwm8.h

📁 塞扑拉思 psoc spi模块 作为master 的应用程序.
💻 H
字号:
//*****************************************************************************
//*****************************************************************************
//  FILENAME: PWM8.h
//   Version: 2.5, Updated on 2006/05/15 at 15:09:31
//  Generated by PSoC Designer ver 4.3  b1884 : 23 June, 2006
//
//  DESCRIPTION: PWM8 User Module C Language interface file
//               for the 22/24/27/29xxx PSoC family of devices
//-----------------------------------------------------------------------------
//  Copyright (c) Cypress MicroSystems 2000-2004. All Rights Reserved.
//*****************************************************************************
//*****************************************************************************

#include <m8c.h>

#pragma fastcall16 PWM8_EnableInt
#pragma fastcall16 PWM8_DisableInt
#pragma fastcall16 PWM8_Start
#pragma fastcall16 PWM8_Stop
#pragma fastcall16 PWM8_bReadCounter              // Read  DR0
#pragma fastcall16 PWM8_WritePeriod               // Write DR1
#pragma fastcall16 PWM8_bReadPulseWidth           // Read  DR2
#pragma fastcall16 PWM8_WritePulseWidth           // Write DR2

// The following symbols are deprecated.
// They may be omitted in future releases
//
#pragma fastcall16 bPWM8_ReadCounter              // Read  DR0 (Deprecated)
#pragma fastcall16 bPWM8_ReadPulseWidth           // Read  DR2 (Deprecated)


//-------------------------------------------------
// Prototypes of the PWM8 API.
//-------------------------------------------------

extern void PWM8_EnableInt(void);                        // Proxy Class 1
extern void PWM8_DisableInt(void);                       // Proxy Class 1
extern void PWM8_Start(void);                            // Proxy Class 1
extern void PWM8_Stop(void);                             // Proxy Class 1
extern BYTE PWM8_bReadCounter(void);                     // Proxy Class 2
extern void PWM8_WritePeriod(BYTE bPeriod);              // Proxy Class 1
extern BYTE PWM8_bReadPulseWidth(void);                  // Proxy Class 1
extern void PWM8_WritePulseWidth(BYTE bPulseWidth);      // Proxy Class 1

// The following functions are deprecated.
// They may be omitted in future releases
//
extern BYTE bPWM8_ReadCounter(void);            // Deprecated
extern BYTE bPWM8_ReadPulseWidth(void);         // Deprecated


//--------------------------------------------------
// Constants for PWM8 API's.
//--------------------------------------------------

#define PWM8_CONTROL_REG_START_BIT             ( 0x01 )
#define PWM8_INT_REG_ADDR                      ( 0x0e1 )
#define PWM8_INT_MASK                          ( 0x01 )


//--------------------------------------------------
// Constants for PWM8 user defined values
//--------------------------------------------------

#define PWM8_PERIOD                            ( 0x14 )
#define PWM8_PULSE_WIDTH                       ( 0x0a )


//-------------------------------------------------
// Register Addresses for PWM8
//-------------------------------------------------

#pragma ioport  PWM8_COUNTER_REG:   0x020                  //DR0 Count register
BYTE            PWM8_COUNTER_REG;
#pragma ioport  PWM8_PERIOD_REG:    0x021                  //DR1 Period register
BYTE            PWM8_PERIOD_REG;
#pragma ioport  PWM8_COMPARE_REG:   0x022                  //DR2 Compare register
BYTE            PWM8_COMPARE_REG;
#pragma ioport  PWM8_CONTROL_REG:   0x023                  //Control register
BYTE            PWM8_CONTROL_REG;
#pragma ioport  PWM8_FUNC_REG:  0x120                      //Function register
BYTE            PWM8_FUNC_REG;
#pragma ioport  PWM8_INPUT_REG: 0x121                      //Input register
BYTE            PWM8_INPUT_REG;
#pragma ioport  PWM8_OUTPUT_REG:    0x122                  //Output register
BYTE            PWM8_OUTPUT_REG;
#pragma ioport  PWM8_INT_REG:       0x0e1                  //Interrupt Mask Register
BYTE            PWM8_INT_REG;


//-------------------------------------------------
// PWM8 Macro 'Functions'
//-------------------------------------------------

#define PWM8_Start_M \
   PWM8_CONTROL_REG |=  PWM8_CONTROL_REG_START_BIT

#define PWM8_Stop_M  \
   PWM8_CONTROL_REG &= ~PWM8_CONTROL_REG_START_BIT

#define PWM8_EnableInt_M   \
   M8C_EnableIntMask(PWM8_INT_REG, PWM8_INT_MASK)

#define PWM8_DisableInt_M  \
   M8C_DisableIntMask(PWM8_INT_REG, PWM8_INT_MASK)


// end of file PWM8.h

⌨️ 快捷键说明

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