configintsmpsadcpair1.c

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

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

#include "smpsadc.h"
#ifdef _ADCP1IF 


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

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

    /* Clear the ADC Interrupt status Flags of ADC channels AN3 and AN2 */
	IFS2bits.ADCP1IF = 0;

	/* Enable/Disable the ADC Interrupt of ADC channels AN3 and AN2 */
	IEC2bits.ADCP1IE = adc_intp;

	/* Set the priority of ADC interrupt for ADC channels AN3 and AN2 */
	IPC9bits.ADCP1IP = adc_intp_priority;
	
}

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

⌨️ 快捷键说明

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