📄 carrier_timer.h
字号:
//*****************************************************************************
//*****************************************************************************
// FILENAME: Carrier_Timer.h
// Version: 2.2, Updated on 2003/11/10 at 16:40:54
// Generated by PSoC Designer ver 4.1 BETA b923 : 11 December, 2003
//
// DESCRIPTION: Timer8 User Module C Language interface file
// for the 22/24/27/28xxx PSoC family of devices
//-----------------------------------------------------------------------------
// Copyright (c) Cypress MicroSystems 2000-2003. All Rights Reserved.
//*****************************************************************************
//*****************************************************************************
#include <m8c.h>
#pragma fastcall Carrier_Timer_EnableInt
#pragma fastcall Carrier_Timer_DisableInt
#pragma fastcall Carrier_Timer_Start
#pragma fastcall Carrier_Timer_Stop
#pragma fastcall Carrier_Timer_bReadTimer // Read DR0
#pragma fastcall Carrier_Timer_bReadTimerSaveCV // Read DR0
#pragma fastcall Carrier_Timer_WritePeriod // Write DR1
#pragma fastcall Carrier_Timer_bReadCompareValue // Read DR2
#pragma fastcall Carrier_Timer_WriteCompareValue // Write DR2
// The following symbols are deprecated.
// They may be omitted in future releases
//
#pragma fastcall bCarrier_Timer_ReadCounter // Read DR0 "Obsolete"
#pragma fastcall bCarrier_Timer_CaptureCounter // Read DR0 "Obsolete"
#pragma fastcall bCarrier_Timer_ReadTimer // Read DR0 (Deprecated)
#pragma fastcall bCarrier_Timer_ReadTimerSaveCV // Read DR0 (Deprecated)
#pragma fastcall bCarrier_Timer_ReadCompareValue // Read DR2 (Deprecated)
//-------------------------------------------------
// Prototypes of the Carrier_Timer API.
//-------------------------------------------------
extern void Carrier_Timer_EnableInt(void);
extern void Carrier_Timer_DisableInt(void);
extern void Carrier_Timer_Start(void);
extern void Carrier_Timer_Stop(void);
extern BYTE Carrier_Timer_bReadTimer(void);
extern BYTE Carrier_Timer_bReadTimerSaveCV(void);
extern void Carrier_Timer_WritePeriod(BYTE bPeriod);
extern BYTE Carrier_Timer_bReadCompareValue(void);
extern void Carrier_Timer_WriteCompareValue(BYTE bCompareValue);
// The following functions are deprecated.
// They may be omitted in future releases
//
extern BYTE bCarrier_Timer_ReadCompareValue(void); // Deprecated
extern BYTE bCarrier_Timer_ReadTimerSaveCV(void); // Deprecated
extern BYTE bCarrier_Timer_ReadCounter(void); // Obsolete
extern BYTE bCarrier_Timer_ReadTimer(void); // Deprecated
extern BYTE bCarrier_Timer_CaptureCounter(void); // Obsolete
//--------------------------------------------------
// Constants for Carrier_Timer API's.
//--------------------------------------------------
#define Carrier_Timer_CONTROL_REG_START_BIT ( 0x01 )
#define Carrier_Timer_INT_REG_ADDR ( 0x0e1 )
#define Carrier_Timer_INT_MASK ( 0x01 )
//--------------------------------------------------
// Constants for Carrier_Timer user defined values
//--------------------------------------------------
#define Carrier_Timer_PERIOD ( 0x4f )
#define Carrier_Timer_COMPARE_VALUE ( 0x28 )
//-------------------------------------------------
// Register Addresses for Carrier_Timer
//-------------------------------------------------
#pragma ioport Carrier_Timer_COUNTER_REG: 0x020 //DR0 Count register
BYTE Carrier_Timer_COUNTER_REG;
#pragma ioport Carrier_Timer_PERIOD_REG: 0x021 //DR1 Period register
BYTE Carrier_Timer_PERIOD_REG;
#pragma ioport Carrier_Timer_COMPARE_REG: 0x022 //DR2 Compare register
BYTE Carrier_Timer_COMPARE_REG;
#pragma ioport Carrier_Timer_CONTROL_REG: 0x023 //Control register
BYTE Carrier_Timer_CONTROL_REG;
#pragma ioport Carrier_Timer_FUNC_REG: 0x120 //Function register
BYTE Carrier_Timer_FUNC_REG;
#pragma ioport Carrier_Timer_INPUT_REG: 0x121 //Input register
BYTE Carrier_Timer_INPUT_REG;
#pragma ioport Carrier_Timer_OUTPUT_REG: 0x122 //Output register
BYTE Carrier_Timer_OUTPUT_REG;
#pragma ioport Carrier_Timer_INT_REG: 0x0e1 //Interrupt Mask Register
BYTE Carrier_Timer_INT_REG;
//-------------------------------------------------
// Carrier_Timer Macro 'Functions'
//-------------------------------------------------
#define Carrier_Timer_Start_M \
( Carrier_Timer_CONTROL_REG |= Carrier_Timer_CONTROL_REG_START_BIT )
#define Carrier_Timer_Stop_M \
( Carrier_Timer_CONTROL_REG &= ~Carrier_Timer_CONTROL_REG_START_BIT )
#define Carrier_Timer_EnableInt_M \
M8C_EnableIntMask( Carrier_Timer_INT_REG, Carrier_Timer_INT_MASK )
#define Carrier_Timer_DisableInt_M \
M8C_DisableIntMask( Carrier_Timer_INT_REG, Carrier_Timer_INT_MASK )
// end of file Carrier_Timer.h
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -