pwm16_2.h

来自「Application Note Abstract This Applicat」· C头文件 代码 · 共 70 行

H
70
字号
/******************************************************************************
*  FILENAME:      PWM16_2.h
*   VERSION:      Rev B, 2002 Mar 30
*******************************************************************************
*  DESCRIPTION:
*     PWM16_2 PWM16 User Module header file.
*******************************************************************************
*	Copyright (c) Cypress MicroSystems 2000-2002. All Rights Reserved.
******************************************************************************/

/* include the global header file */
#include <m8c.h>

/* Create pragmas to support proper argument and return value passing */
#pragma fastcall  PWM16_2_EnableInt
#pragma fastcall  PWM16_2_DisableInt
#pragma fastcall  PWM16_2_Start
#pragma fastcall  PWM16_2_Stop
#pragma fastcall  PWM16_2_WritePeriod
#pragma fastcall  PWM16_2_WritePulseWidth
#pragma fastcall wPWM16_2_ReadPulseWidth
#pragma fastcall wPWM16_2_ReadCounter

/**************************************************
* Prototypes of PWM API. For a definition of
* functions see PWM16_2.inc. 
**************************************************/
extern void  PWM16_2_EnableInt(void);
extern void  PWM16_2_DisableInt(void);
extern void  PWM16_2_Start(void);
extern void  PWM16_2_Stop(void);
extern void  PWM16_2_WritePeriod(WORD wPeriod);
extern void  PWM16_2_WritePulseWidth(WORD wPulseWidth);
extern WORD wPWM16_2_ReadPulseWidth(void);	
extern WORD wPWM16_2_ReadCounter(void);	 

/************************************************
*  Hardware Register Definitions
*************************************************/
#pragma ioport  PWM16_2_CONTROL_LSB_REG:    0x02b          //Control register LSB
BYTE            PWM16_2_CONTROL_LSB_REG;
#pragma ioport  PWM16_2_CONTROL_MSB_REG:    0x02f          //Control register MSB
BYTE            PWM16_2_CONTROL_MSB_REG;
#pragma ioport  PWM16_2_COUNTER_LSB_REG:    0x028          //Counter register LSB
BYTE            PWM16_2_COUNTER_LSB_REG;
#pragma ioport  PWM16_2_COUNTER_MSB_REG:    0x02c          //Counter register MSB
BYTE            PWM16_2_COUNTER_MSB_REG;
#pragma ioport  PWM16_2_PERIOD_LSB_REG: 0x029              //Period register LSB
BYTE            PWM16_2_PERIOD_LSB_REG;
#pragma ioport  PWM16_2_PERIOD_MSB_REG: 0x02d              //Period register MSB
BYTE            PWM16_2_PERIOD_MSB_REG;
#pragma ioport  PWM16_2_PWDITH_LSB_REG: 0x02a              //PulseWidth register LSB
BYTE            PWM16_2_PWDITH_LSB_REG;
#pragma ioport  PWM16_2_PWDITH_MSG_REG: 0x02e              //PulseWidth register MSB
BYTE            PWM16_2_PWDITH_MSG_REG;
#pragma ioport  PWM16_2_FUNC_LSB_REG:   0x128              //Function register LSB
BYTE            PWM16_2_FUNC_LSB_REG;
#pragma ioport  PWM16_2_FUNC_MSB_REG:   0x12c              //Function register MSB
BYTE            PWM16_2_FUNC_MSB_REG;
#pragma ioport  PWM16_2_INPUT_LSB_REG:  0x129              //Input register LSB
BYTE            PWM16_2_INPUT_LSB_REG;
#pragma ioport  PWM16_2_INPUT_MSB_REG:  0x12d              //Input register MSB
BYTE            PWM16_2_INPUT_MSB_REG;
#pragma ioport  PWM16_2_OUTPUT_LSB_REG: 0x12a              //Output register LSB
BYTE            PWM16_2_OUTPUT_LSB_REG;
#pragma ioport  PWM16_2_OUTPUT_MSB_REG: 0x12e              //Output register MSB
BYTE            PWM16_2_OUTPUT_MSB_REG;

// end of file

⌨️ 快捷键说明

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