configintsmpsadcglobal.c

来自「Mplab C30编译器」· C语言 代码 · 共 37 行

C
37
字号
#if defined(__dsPIC30F__) 
#include <p30fxxxx.h>
#elif defined(__dsPIC33F__)
#include <p33Fxxxx.h>
#endif

#include "smpsadc.h"
#ifdef _ADCP0IF 


/*************************************************************************
* Function Name     : ConfigIntSmpsADCGlobal
* Description       : This function clears the Interrupt Flag bits, sets the interrupt 
*                     priorities and Enables/disables the interrupts for ADC channel                       
* Parameters        : unsigned int adc_intp, unsigned int adc_intp_priority
* Return Value      : None 
**************************************************************************/

void ConfigIntSmpsADCGlobal(unsigned int adc_intp, unsigned int adc_intp_priority)
{

    /* Clear the ADC Interrupt status Flags   */
	IFS0bits.ADIF = 0;

	/* Enable/Disable the ADC Interrupt of ADC  */
	IEC0bits.ADIE = adc_intp;

	/* Set the priority of ADC interrupt for ADC   */
	IPC2bits.ADIP = adc_intp_priority;
	
}

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

⌨️ 快捷键说明

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