ADC采集(光敏电阻)
1、宏定义
#define ADC0_INSTANCE ADC0
#define ADC1_GPIO GPIOA
#define ADC1_PORT PORTA
#define ADC1_PIN0 7U //ADC引脚号
#define ADC1_CHANNEL 10U //ADC通道号,即ADC0通道10
#define ADC1_CHANNEL_GROUP 0U //通道组,最多8个(0-7)
2、ADC采集初始化
void ADC_PORT_INIT(void)//ADC端口时钟初始化与端口复用
{
CLOCK_EnableClock(kCLOCK_PortA);//使能端口时钟
PORT_SetPinMux(ADC1_PORT,ADC1_PIN0