📄 configintspi2.c
字号:
#if defined(__PIC24F__)
#include <p24Fxxxx.h>
#endif
#include "spi.h"
/**************************************************************************
Function Prototype : void ConfigIntSPI2(unsigned int config)
Include : spi.h
Description : This function configures the SPI Interrupt
Arguments : config - SPI interrupt priority and enable/disable
information as defined below
Interrupt enable/disable
SPI_INT_EN
SPI_INT_DIS
Interrupt Priority
SPI_INT_PRI_0
SPI_INT_PRI_1
SPI_INT_PRI_2
SPI_INT_PRI_3
SPI_INT_PRI_4
SPI_INT_PRI_5
SPI_INT_PRI_6
SPI_INT_PRI_7
Return Value : None
Remarks : This function clears the Interrupt Flag bit, sets the
interrupt priority and enables/disables the interrupt
****************************************************************************/
#ifdef _SPI_V2_2
void ConfigIntSPI2( unsigned int config)
{
IFS2bits.SPI2IF = 0; /* Clear IF bit */
IPC8bits.SPI2IP=(config &0x0007); /* Assign interrupt priority */
IEC2bits.SPI2IE=(config &0x0008)>>3; /* Interrupt Enable/Disable bit */
}
#else
#warning "Does not build on this target"
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -