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

📄 configintoc78_v4.c

📁 Mplab C30编译器
💻 C
字号:
#if defined(__PIC24F__)
#include <p24Fxxxx.h>
#endif
#include <outcompare.h>

#if defined (_OCMP_V4_7) && defined (_OCMP_V4_8)
/***********************************************************************************
Function Prototype : void ConfigIntOC78(unsigned int config)

Include            : outcompare.h
 
Description        : This function configures the Output Compare interrupt.
 
Arguments          : config - Output Compare interrupt priority and enable/disable
                     information as defined below
						Interrupt enable/disable						
						   OC_INT_ON						
						   OC_INT_OFF						
						Interrupt Priority						
						   OC_INT_PRIOR_0						
						   OC_INT_PRIOR_1						
						   OC_INT_PRIOR_2		
						   OC_INT_PRIOR_3						
						   OC_INT_PRIOR_4						
						   OC_INT_PRIOR_5						
						   OC_INT_PRIOR_6						
						   OC_INT_PRIOR_7
 
Return Value        : None
 
Remarks             : This function clears the Interrupt Flag bit and then sets 
                      the interrupt priority and enables/disables the interrupt.
************************************************************************************/

void ConfigIntOC78(unsigned int config)
{
	IFS2bits.OC7IF = 0; /* Clear IF bit */
    IFS2bits.OC8IF = 0;  
    
    IPC10bits.OC7IP = (config & 0x0007);                 
    IPC11bits.OC8IP = (config & 0x0007);    /* Assign Interrupt Priority */ 
    
    IEC2bits.OC7IE = (config &0x0008)>>3; /* Enable/disable Interrupt */
    IEC2bits.OC8IE = (config &0x0008)>>3;
}

#else
#warning "Does not build on this target"
#endif

⌨️ 快捷键说明

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