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

📄 configintadc10.c

📁 Mplab C30编译器
💻 C
字号:
#if defined(__PIC24F__)
#include <p24Fxxxx.h>
#endif
#include "adc.h"

#if defined (_ADC_1012_V1) || defined (_ADC_1012_V2_GB)

/***************************************************************************************
Function Prototype : void ConfigIntADC10(unsigned int config)

Include            : adc.h

Description        : This function configures the ADC interrupt.

Arguments          : config - ADC interrupt priority and enable/disable information 
                     as defined below
                     ADC Interrupt enable/disable
					   ADC_INT_ENABLE
					   ADC_INT_DISABLE
					 ADC Interrupt priority
                       ADC_INT_PRI_0
                       ADC_INT_PRI_1
                       .....
                       ADC_INT_PRI_6
                       ADC_INT_PRI_7
                                            
Return Value       : None 

Remarks            : This function clears the Interrupt Flag (ADIF) bit and then 
                     sets the interrupt priority and enables/disables the interrupt. 
****************************************************************************************/

void ConfigIntADC10(unsigned int config)
{
    /* Clearing the Interrupt Flag bit */
    IFS0bits.AD1IF = 0;

    /* Setting Priority */
    IPC3bits.AD1IP = config & 0x07;

    /* Setting the Interrupt enable bit */
    IEC0bits.AD1IE = (config & 0x08)>>3;
}

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

⌨️ 快捷键说明

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