configintsmpsadcpair0.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     : ConfigIntSmpsADCPair0
* Description       : This function clears the Interrupt Flag bits, sets the interrupt 
*                     priorities and Enables/disables the interrupts for ADC channels AN1 and AN0                        
* Parameters        : unsigned int adc_intp, unsigned int adc_intp_priority
* Return Value      : None 
**************************************************************************/

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

    /* Clear the ADC Interrupt status Flags of ADC channels AN1 and AN0 */
	IFS2bits.ADCP0IF = 0;

	/* Enable/Disable the ADC Interrupt of ADC channels AN1 and AN0 */
	IEC2bits.ADCP0IE = adc_intp;

	/* Set the priority of ADC interrupt for ADC channels AN1 and AN0 */
	IPC9bits.ADCP0IP = adc_intp_priority;
	
}

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

⌨️ 快捷键说明

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