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

📄 configinti2c1.c

📁 PIC driver for ILI9325 display
💻 C
字号:
#if defined(__PIC24F__)
#include <p24Fxxxx.h>
#endif
#include <i2c.h>

/*********************************************************************
*    Function Name:  ConfigIntI2C1                                      
*    Description:    This routine enables/disables the SI2C & MI2C  
*                    interrupts and sets their priorities
*    Parameters:     unsigned int : config  
*    Return Value:   void
*********************************************************************/

#ifdef _I2C_V2_1

void ConfigIntI2C1(unsigned int config)
{
     IFS1bits.SI2C1IF = 0;                       /* clear the MI2C & SI2C Interrupts */
     IFS1bits.MI2C1IF = 0;

     IPC4bits.SI2C1P = (config & 0x0007);        /* set the SI2C priority */
     IPC4bits.MI2C1P = (config & 0x0070) >> 4;    /* set the MI2C priority */

     IEC1bits.SI2C1IE = (config & 0x0008)>> 3;   /* enable/disable the SI2C Interrupt */
     IEC1bits.MI2C1IE = (config & 0x0080) >> 7;    /* enable/disable the MI2C Interrupt */
}


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

⌨️ 快捷键说明

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