closesmpsadc.c

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

C
60
字号
#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 + =
减小字号Ctrl + -
显示快捷键?