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

📄 configinti2c.c

📁 Mplab C30编译器
💻 C
字号:
/*********************************************************************
*    Function Name:  ConfigIntI2C
*    Description:    This routine enables/disables the SI2C & MI2C  
*                    interrupts and sets their priorities
*    Parameters:     unsigned int : config	
*    Return Value:   void
*********************************************************************/

#include "i2c.h"

#ifdef _MI2CIF

void ConfigIntI2C(unsigned int config)
{                
     /* clear the MI2C & SI2C Interrupts */
     _SI2CIF = 0;
     _MI2CIF = 0;

     _SI2CIP = (config & 0x0007);       /* set the SI2C priority */
     _MI2CIP = (config & 0x0070) >> 4;  /* set the MI2C priority */

     _SI2CIE = (config & 0x0008)>> 3;   /* enable/disable SI2C Int */
     _MI2CIE = (config & 0x0080) >> 7;  /* enable/disable MI2C Int */
}

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

⌨️ 快捷键说明

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