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

📄 pwm_01.h

📁 cypress cy3721做的外部无线结点。感知温度后将温度值反给中心结点。
💻 H
字号:
//*****************************************************************************
//*****************************************************************************
//  FILENAME: PWM_01.h
//   Version: 2.5, Updated on 2008/10/2 at 14:39:40
//  Generated by PSoC Designer ???
//
//  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 PWM_01_EnableInt
#pragma fastcall16 PWM_01_DisableInt
#pragma fastcall16 PWM_01_Start
#pragma fastcall16 PWM_01_Stop
#pragma fastcall16 PWM_01_bReadCounter              // Read  DR0
#pragma fastcall16 PWM_01_WritePeriod               // Write DR1
#pragma fastcall16 PWM_01_bReadPulseWidth           // Read  DR2
#pragma fastcall16 PWM_01_WritePulseWidth           // Write DR2

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


//-------------------------------------------------
// Prototypes of the PWM_01 API.
//-------------------------------------------------

extern void PWM_01_EnableInt(void);                        // Proxy Class 1
extern void PWM_01_DisableInt(void);                       // Proxy Class 1
extern void PWM_01_Start(void);                            // Proxy Class 1
extern void PWM_01_Stop(void);                             // Proxy Class 1
extern BYTE PWM_01_bReadCounter(void);                     // Proxy Class 2
extern void PWM_01_WritePeriod(BYTE bPeriod);              // Proxy Class 1
extern BYTE PWM_01_bReadPulseWidth(void);                  // Proxy Class 1
extern void PWM_01_WritePulseWidth(BYTE bPulseWidth);      // Proxy Class 1

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


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

#define PWM_01_CONTROL_REG_START_BIT           ( 0x01 )
#define PWM_01_INT_REG_ADDR                    ( 0x0e1 )
#define PWM_01_INT_MASK                        ( 0x02 )


//--------------------------------------------------
// Constants for PWM_01 user defined values
//--------------------------------------------------

#define PWM_01_PERIOD                          ( 0xf9 )
#define PWM_01_PULSE_WIDTH                     ( 0x64 )


//-------------------------------------------------
// Register Addresses for PWM_01
//-------------------------------------------------

#pragma ioport  PWM_01_COUNTER_REG: 0x024                  //DR0 Count register
BYTE            PWM_01_COUNTER_REG;
#pragma ioport  PWM_01_PERIOD_REG:  0x025                  //DR1 Period register
BYTE            PWM_01_PERIOD_REG;
#pragma ioport  PWM_01_COMPARE_REG: 0x026                  //DR2 Compare register
BYTE            PWM_01_COMPARE_REG;
#pragma ioport  PWM_01_CONTROL_REG: 0x027                  //Control register
BYTE            PWM_01_CONTROL_REG;
#pragma ioport  PWM_01_FUNC_REG:    0x124                  //Function register
BYTE            PWM_01_FUNC_REG;
#pragma ioport  PWM_01_INPUT_REG:   0x125                  //Input register
BYTE            PWM_01_INPUT_REG;
#pragma ioport  PWM_01_OUTPUT_REG:  0x126                  //Output register
BYTE            PWM_01_OUTPUT_REG;
#pragma ioport  PWM_01_INT_REG:       0x0e1                //Interrupt Mask Register
BYTE            PWM_01_INT_REG;


//-------------------------------------------------
// PWM_01 Macro 'Functions'
//-------------------------------------------------

#define PWM_01_Start_M \
   PWM_01_CONTROL_REG |=  PWM_01_CONTROL_REG_START_BIT

#define PWM_01_Stop_M  \
   PWM_01_CONTROL_REG &= ~PWM_01_CONTROL_REG_START_BIT

#define PWM_01_EnableInt_M   \
   M8C_EnableIntMask(PWM_01_INT_REG, PWM_01_INT_MASK)

#define PWM_01_DisableInt_M  \
   M8C_DisableIntMask(PWM_01_INT_REG, PWM_01_INT_MASK)


// end of file PWM_01.h

⌨️ 快捷键说明

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