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

📄 closesmpsadc.c

📁 Mplab C30编译器
💻 C
字号:
#if defined(__dsPIC30F__) 
#include <p30fxxxx.h>
#elif defined(__dsPIC33F__)
#include <p33Fxxxx.h>
#endif

#include "smpsadc.h"
#ifdef _ADCP0IF


/*************************************************************************
* Function Name     : CloseSmpsADC
* Description       : This function disables the SMPS ADC module and clears the ADC 
*                     Interrupt Flag bits. This function also clears the ADCON register.                 
* Parameters        : void
* Return Value      : None 
**************************************************************************/

void CloseSmpsADC(void)
                    
{
    
    /* Clear the all ADC Interrupt status Flags  */

	IFS2bits.ADCP0IF = 0;
	IFS2bits.ADCP1IF = 0;
	IFS2bits.ADCP2IF = 0;
    #ifdef _ADCP3IF
	IFS2bits.ADCP3IF = 0;
    #endif
    #ifdef _ADCP4IF
	IFS2bits.ADCP4IF = 0;
	IFS2bits.ADCP5IF = 0;
    #endif
	IFS0bits.ADIF    = 0;

   /* Clear the ADC Interrupt control registers */

	IEC2bits.ADCP0IE = 0;
	IEC2bits.ADCP1IE = 0;
	IEC2bits.ADCP2IE = 0;
    #ifdef _ADCP3IF
	IEC2bits.ADCP3IE = 0;
    #endif
    #ifdef _ADCP4IF
	IEC2bits.ADCP4IE = 0;
	IEC2bits.ADCP5IE = 0;
    #endif
	IEC0bits.ADIE    = 0;

    /* Clear the ADC control registers */
	ADCON   = 0;
	
            
}
#else
#warning "Does not build on this target"
#endif
 

⌨️ 快捷键说明

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