📄 configinttimer5.c
字号:
#if defined(__PIC24F__)
#include <p24Fxxxx.h>
#endif
#include <timer.h>
/* These devices support Timer 5 */
#ifdef _TIMER5
/****************************************************************************
Function Prototype : void ConfigIntTimer5(unsigned int config)
Include : timer.h
Description : This function configures the 16-bit timer interrupt.
Arguments : config - Timer interrupt priority and enable/disable
information as defined below
Timer Interrupt Priority
T5_INT_PRIOR_7
T5_INT_PRIOR_6
T5_INT_PRIOR_5
T5_INT_PRIOR_4
T5_INT_PRIOR_3
T5_INT_PRIOR_2
T5_INT_PRIOR_1
T5_INT_PRIOR_0
Timer Interrupt Enable\Disable
T5_INT_ON
T5_INT_OFF
Return Value : None
Remarks : This function clears the 16-bit Interrupt Flag (TxIF) bit
and then sets the interrupt priority and enables/disables
the interrupt.
******************************************************************************/
void ConfigIntTimer5(unsigned int config)
{
IEC1bits.T5IE = 0; /* clear IF bit */
IPC7bits.T5IP = (config &0x0007); /* assigning Interrupt Priority */
IEC1bits.T5IE = (config &0x0008)>>3; /* Interrupt Enable /Disable */
}
#else
#warning "Does not build on this target"
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -