当前位置: 首页>>代码示例>>C++>>正文


C++ ADC_GetCalibrationStatus函数代码示例

本文整理汇总了C++中ADC_GetCalibrationStatus函数的典型用法代码示例。如果您正苦于以下问题:C++ ADC_GetCalibrationStatus函数的具体用法?C++ ADC_GetCalibrationStatus怎么用?C++ ADC_GetCalibrationStatus使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ADC_GetCalibrationStatus函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ADC_Configuration

void ADC_Configuration(void)
{
	
	ADC_InitTypeDef ADC_InitStructure;
	
	ADC_StructInit(&ADC_InitStructure);
	
	/* ADC1 configuration ------------------------------------------------------*/
	ADC_InitStructure.ADC_Mode = ADC_Mode_Independent;
	ADC_InitStructure.ADC_ScanConvMode = DISABLE;
	ADC_InitStructure.ADC_ContinuousConvMode = ENABLE;
	ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrigConv_None;
	ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right;
	ADC_InitStructure.ADC_NbrOfChannel = 1;

	ADC_Init(ADC1, &ADC_InitStructure);

	ADC_Init(ADC2, &ADC_InitStructure);

	/* ADC1 regular channels configuration */ 
	ADC_RegularChannelConfig(ADC1, ADC_Channel_10, 1 , ADC_SampleTime_239Cycles5);
	ADC_ITConfig(ADC1, ADC_IT_EOC, DISABLE);

	/* ADC2 regular channels configuration */
	ADC_RegularChannelConfig(ADC2, ADC_Channel_4, 1, ADC_SampleTime_239Cycles5);
	ADC_ITConfig(ADC2, ADC_IT_EOC, DISABLE);

	/* Enable ADC1 DMA */
	//ADC_DMACmd(ADC1, ENABLE);
  
	/* Enable ADC1,2 */
	ADC_Cmd(ADC1, ENABLE);
	ADC_Cmd(ADC2, ENABLE);


	/* Enable ADC1,2 reset calibaration register */
	/* Check the end of ADC1,2 reset calibration register */
	ADC_ResetCalibration(ADC1);
	while(ADC_GetResetCalibrationStatus(ADC1));


	ADC_ResetCalibration(ADC2);
	while(ADC_GetResetCalibrationStatus(ADC2));



	/* Start ADC1,2 calibaration */
	/* Check the end of ADC1,2 calibration */
	ADC_StartCalibration(ADC1);
	while(ADC_GetCalibrationStatus(ADC1));

	ADC_StartCalibration(ADC2);
	while(ADC_GetCalibrationStatus(ADC2));


	/* Start ADC2 Software Conversion */
	ADC_SoftwareStartConvCmd(ADC1, ENABLE);
	ADC_SoftwareStartConvCmd(ADC2, ENABLE);
}
开发者ID:DresnerRobotics,项目名称:CM730-Firmware,代码行数:59,代码来源:system_init.c

示例2: ADC_Configuration

static void ADC_Configuration(void)
{
	ADC_InitTypeDef ADC_InitStructure;
	
 RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADC1 | RCC_APB2Periph_ADC2 , ENABLE);
// ADC1 configuration
  ADC_DeInit(ADC1);
  ADC_InitStructure.ADC_Mode = ADC_Mode_RegSimult;
  ADC_InitStructure.ADC_ScanConvMode = ENABLE;
  ADC_InitStructure.ADC_ContinuousConvMode = DISABLE;
  ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrigConv_T2_CC2;
  ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right;
  ADC_InitStructure.ADC_NbrOfChannel = 3;
  ADC_Init(ADC1, &ADC_InitStructure);

  // ADC1 channel sequence
  ADC_RegularChannelConfig(ADC1, ADC_Channel_0, 1, ADC_SampleTime_28Cycles5);
  ADC_RegularChannelConfig(ADC1, ADC_Channel_1, 2, ADC_SampleTime_28Cycles5);
	ADC_RegularChannelConfig(ADC1, ADC_Channel_8, 3, ADC_SampleTime_28Cycles5);
	
  // ADC2 configuration
  ADC_DeInit(ADC2);
  ADC_InitStructure.ADC_Mode = ADC_Mode_RegSimult;
  ADC_InitStructure.ADC_ScanConvMode = ENABLE;
  ADC_InitStructure.ADC_ContinuousConvMode = DISABLE;
  ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrigConv_None;
  ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right;
  ADC_InitStructure.ADC_NbrOfChannel = 3;
  ADC_Init(ADC2, &ADC_InitStructure);

  // ADC2 channel sequence
  ADC_RegularChannelConfig(ADC2, ADC_Channel_2, 1, ADC_SampleTime_28Cycles5);
  ADC_RegularChannelConfig(ADC2, ADC_Channel_3, 2, ADC_SampleTime_28Cycles5);
	ADC_RegularChannelConfig(ADC2, ADC_Channel_17, 3, ADC_SampleTime_28Cycles5);

  // Enable ADC1
  ADC_Cmd(ADC1, ENABLE);
  // Calibrate ADC1
  ADC_ResetCalibration(ADC1);
  while(ADC_GetResetCalibrationStatus(ADC1));
  ADC_StartCalibration(ADC1);
  while(ADC_GetCalibrationStatus(ADC1));

  // Enable ADC1 external trigger
  ADC_ExternalTrigConvCmd(ADC1, ENABLE);
  ADC_TempSensorVrefintCmd(ENABLE);

  // Enable ADC2
  ADC_Cmd(ADC2, ENABLE);
  // Calibrate ADC2
  ADC_ResetCalibration(ADC2);
  while(ADC_GetResetCalibrationStatus(ADC2));
  ADC_StartCalibration(ADC2);
  while(ADC_GetCalibrationStatus(ADC2));

  // Enable ADC2 external trigger
  ADC_ExternalTrigConvCmd(ADC2, ENABLE);	
	
}
开发者ID:nongxiaoming,项目名称:MiniQuadcopter,代码行数:59,代码来源:drv_adc.c

示例3: ADC_Configuration

void ADC_Configuration(void)
{
  ADC_InitTypeDef  ADC_InitStructure;
  RCC_ADCCLKConfig(RCC_PCLK2_Div6);                                    // PCLK2 is the APB2 clock, ADCCLK = PCLK2/6 = 60/6 = 10MHz
  RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADC1, ENABLE);                 // Enable ADC1 clock so that we can talk to it
  ADC_DeInit(ADC1);                                                    // Put everything back to power-on defaults

  ADC_InitStructure.ADC_Mode = ADC_Mode_Independent;                   // ADC2 not depenedent on ADC1
  ADC_InitStructure.ADC_ScanConvMode = DISABLE;                        // Disable the scan conversion so we do one at a time
  ADC_InitStructure.ADC_ContinuousConvMode = DISABLE;                  // Don't do contimuous conversions - do them on demand
  ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrigConv_None;  // Start conversin by software, not an external trigger
  ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right;               // Conversions are 12 bit - put them in the lower 12 bits of the result
  ADC_InitStructure.ADC_NbrOfChannel = 1;                              // How many channels would be used by the sequencer
  ADC_Init(ADC1, &ADC_InitStructure);
  ADC_Cmd(ADC1, ENABLE);

  ADC_ResetCalibration(ADC1);                                           // Enable ADC1 reset calibaration register
  while(ADC_GetResetCalibrationStatus(ADC1));                           // Check the end of ADC1 reset calibration register
  ADC_StartCalibration(ADC1);                                           // Start ADC1 calibaration
  while(ADC_GetCalibrationStatus(ADC1));                                // Check the end of ADC1 calibration
  ADC_TempSensorVrefintCmd(ENABLE);                                     // enable Vrefint and Temperature sensor

  GPIO_InitTypeDef  GPIO_InitStructure;
  GPIO_InitStructure.GPIO_Pin   = GPIO_Pin_0;                           // Pin #0
  GPIO_InitStructure.GPIO_Mode  = GPIO_Mode_AIN;                        // as analog input
  GPIO_Init(GPIOB, &GPIO_InitStructure);                                // for Port B

}
开发者ID:pola14225,项目名称:diy-tracker,代码行数:28,代码来源:adc.cpp

示例4: fft_ADC_Init

void fft_ADC_Init(void)
{ 	
	ADC_InitTypeDef ADC_InitStructure; 
	GPIO_InitTypeDef GPIO_InitStructure;
	RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC | RCC_APB2Periph_ADC1,ENABLE);	 
 
//	RCC_ADCCLKConfig(RCC_PCLK2_Div6);                                  
	RCC_ADCCLKConfig(RCC_PCLK2_Div8);                                   
	                       
	GPIO_InitStructure.GPIO_Pin  = GPIO_Pin_1 | GPIO_Pin_2;
	GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AIN;		               
	GPIO_Init(GPIOC, &GPIO_InitStructure);	

	ADC_DeInit(ADC1);                                                

	ADC_InitStructure.ADC_Mode = ADC_Mode_Independent;	               
	ADC_InitStructure.ADC_ScanConvMode = DISABLE;	                   
	ADC_InitStructure.ADC_ContinuousConvMode = DISABLE;	               
	ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrigConv_None;	
	ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right;	            
	ADC_InitStructure.ADC_NbrOfChannel = 1;	                          
	ADC_Init(ADC1, &ADC_InitStructure);	                              
 
	ADC_Cmd(ADC1, ENABLE);	                                           
	ADC_ResetCalibration(ADC1);	                                       
	while(ADC_GetResetCalibrationStatus(ADC1));	                        
	ADC_StartCalibration(ADC1);		                                 
	while(ADC_GetCalibrationStatus(ADC1));		                        
	ADC_SoftwareStartConvCmd(ADC1, ENABLE);		                       
}				  
开发者ID:elvislili,项目名称:rgbledcube,代码行数:30,代码来源:ADC.c

示例5: sensor_init

void sensor_init(void)
{
    // 0. Run clocks
    RCC_AHBPeriphClockCmd(SENSORS_DMA_RCC, ENABLE);
    RCC_APB2PeriphClockCmd(SENSORS_ADC_RCC, ENABLE);

    // 1. Init ADC
    ADC_Init(SENSORS_ADC, &_adc);

    // 2. Init DMA for writing measures directly to array
    DMA_Init(SENSORS_DMA, &_dma); // SENSORS_ADC is on DMA1 channel 1

    // 3. Setup SENSORS_ADC to send DMA requests
    ADC_DMACmd(SENSORS_ADC, ENABLE);

    // 4. Enable DMA
    DMA_Cmd(SENSORS_DMA, ENABLE);

    // 5. Enable ADC
    ADC_Cmd(SENSORS_ADC, ENABLE);

    // 6. Calibrate ADC
    ADC_ResetCalibration(SENSORS_ADC);
    while(ADC_GetResetCalibrationStatus(SENSORS_ADC));;;

    ADC_StartCalibration(SENSORS_ADC);
    while(ADC_GetCalibrationStatus(SENSORS_ADC));;;
}
开发者ID:webconn,项目名称:CereMotor,代码行数:28,代码来源:sensors.c

示例6: ADC1_Mode_Config

/* 函数名:ADC1_Mode_Config*/
static void ADC1_Mode_Config(void)
{
	DMA_InitTypeDef DMA_InitStructure;
	ADC_InitTypeDef ADC_InitStructure;
	
	/* DMA channel1 configuration */
	DMA_DeInit(DMA1_Channel1);
	DMA_InitStructure.DMA_PeripheralBaseAddr = ADC1_DR_Address;	 //ADC地址
	DMA_InitStructure.DMA_MemoryBaseAddr = (u32)&ADC_ConvertedValue;//内存地址
	DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralSRC;
	DMA_InitStructure.DMA_BufferSize = 4;//开辟4个储存空间
	DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;//外设地址固定
	DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;  //内存地址递增使能
	DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord;	//半字 16位
	DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord;
	DMA_InitStructure.DMA_Mode = DMA_Mode_Circular;		//循环传输
	DMA_InitStructure.DMA_Priority = DMA_Priority_High;//高优先级
	DMA_InitStructure.DMA_M2M = DMA_M2M_Disable;
	DMA_Init(DMA1_Channel1, &DMA_InitStructure);
	
	/* Enable DMA channel1 */
	DMA_Cmd(DMA1_Channel1, ENABLE);
	
	/* ADC1 configuration */
	
	ADC_InitStructure.ADC_Mode = ADC_Mode_Independent;	//独立ADC模式
	ADC_InitStructure.ADC_ScanConvMode = ENABLE ; 	 //禁止扫描模式,扫描模式用于多通道采集
	ADC_InitStructure.ADC_ContinuousConvMode = ENABLE;	//开启连续转换模式,即不停地进行ADC转换
	ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrigConv_None;	//不使用外部触发转换
	ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right; 	//采集数据右对齐
	ADC_InitStructure.ADC_NbrOfChannel = 4;	 	//要转换的通道数目1
	ADC_Init(ADC1, &ADC_InitStructure);
	
	/*配置ADC时钟,为PCLK2的8分频,即9Hz*/
	RCC_ADCCLKConfig(RCC_PCLK2_Div8); 
	/*ADCx,通道编号,扫描顺序,采样周期 */ 
	ADC_RegularChannelConfig(ADC1, ADC_Channel_1, 1, ADC_SampleTime_1Cycles5);//电池电压
	ADC_RegularChannelConfig(ADC1, ADC_Channel_4, 2, ADC_SampleTime_1Cycles5);//转把
	ADC_RegularChannelConfig(ADC1, ADC_Channel_5, 3, ADC_SampleTime_1Cycles5);//左电机电流
	ADC_RegularChannelConfig(ADC1, ADC_Channel_6, 4, ADC_SampleTime_1Cycles5);//右电机电流
	
	/* Enable ADC1 DMA */
	ADC_DMACmd(ADC1, ENABLE);
	
	/* Enable ADC1 */
	ADC_Cmd(ADC1, ENABLE);
	
	/*复位校准寄存器 */   
	ADC_ResetCalibration(ADC1);
	/*等待校准寄存器复位完成 */
	while(ADC_GetResetCalibrationStatus(ADC1));
	
	/* ADC校准 */
	ADC_StartCalibration(ADC1);
	/* 等待校准完成*/
	while(ADC_GetCalibrationStatus(ADC1));
	
	/* 由于没有采用外部触发,所以使用软件触发ADC转换 */ 
	ADC_SoftwareStartConvCmd(ADC1, ENABLE);
}
开发者ID:FrankEos,项目名称:BlanceMoto,代码行数:61,代码来源:assignment2.c

示例7: ADC_Initialize

/**
  * @brief ADC初始化
	* @param none
  * @retval none
  * @note  初始化PA.00为ADC1_CH0,单次转换,软件触发ADC转换
  */ 
void ADC_Initialize(void)
{
	ADC_InitTypeDef ADC_InitStructure;
	GPIO_InitTypeDef GPIO_InitStructure;
	
	/* 使能GPIOA,ADC1,AFIO时钟 */
	RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_ADC1, ENABLE);

	/* 设置ADCCLK分频因子 ADCCLK = PCLK2/6,即 72MHz/6 = 12MHz */
	RCC_ADCCLKConfig(RCC_PCLK2_Div6);

	/* 配置 PA.00 (ADC1_IN0) 作为模拟输入引脚 */
	GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0;
	GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AIN;
	GPIO_Init(GPIOA, &GPIO_InitStructure);

	ADC_DeInit(ADC1);  //将ADC1设为缺省值
	ADC_InitStructure.ADC_Mode = ADC_Mode_Independent;						//独立模式
	ADC_InitStructure.ADC_ScanConvMode = DISABLE;							//单通道模式
	ADC_InitStructure.ADC_ContinuousConvMode = DISABLE;						//单次转换
	ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrigConv_None;		//软件触发ADC转换
	ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right;					//ADC数据右对齐
	ADC_InitStructure.ADC_NbrOfChannel = 1;									//规则转换通道数目
	ADC_Init(ADC1, &ADC_InitStructure);										//根据ADC_InitStruct初始化ADC

	ADC_Cmd(ADC1, ENABLE);	//使能ADC1

	ADC_ResetCalibration(ADC1);	//复位ADC校准寄存器
	while(ADC_GetResetCalibrationStatus(ADC1));	//等待复位校准结束
	ADC_StartCalibration(ADC1);	 //开启AD校准
	while(ADC_GetCalibrationStatus(ADC1));	 //等待校准结束 
}
开发者ID:gongyuzicong,项目名称:2.4g_controler,代码行数:38,代码来源:adc.c

示例8: adc_init

void adc_init() {
	ADC_InitTypeDef ADC_InitStructure;

	RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADC1 , ENABLE);

	ADC_InitStructure.ADC_Mode = ADC_Mode_Independent;
	ADC_InitStructure.ADC_ScanConvMode = DISABLE;
	ADC_InitStructure.ADC_ContinuousConvMode = ENABLE;
	ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrigConv_None;
	ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right;
	ADC_InitStructure.ADC_NbrOfChannel = 1;
	ADC_Init(ADC1, &ADC_InitStructure);

	ADC_RegularChannelConfig(ADC1, ADC_Channel_16, 1, ADC_SampleTime_239Cycles5);

	ADC_TempSensorVrefintCmd(ENABLE);

	ADC_Cmd(ADC1, ENABLE);

	ADC_ResetCalibration(ADC1);
	while(ADC_GetResetCalibrationStatus(ADC1));

	ADC_StartCalibration(ADC1);
	while(ADC_GetCalibrationStatus(ADC1));

	ADC_SoftwareStartConvCmd(ADC1, ENABLE);
}
开发者ID:spacerace,项目名称:HY-MiniSTM32V,代码行数:27,代码来源:main.c

示例9: adcInit

// --------------------------------------------------------------------------
void adcInit(const UINT8 ui8_reference, const UINT8 ui8_prescaler)
{
	ADC_InitTypeDef adc;

	// suppress compiler complaints
	(void)ui8_reference;

	// configure ADC clock (must not exceed 14MHz)
	RCC_ADCCLKConfig(prescaler_reg[ui8_prescaler]);
	RCC_APB2PeriphClockCmd(ADC_RCC, ENABLE);

	// reset current settings
	ADC_DeInit(ADC_PERIPH);
	
	ADC_StructInit(&adc);
	adc.ADC_Mode = ADC_Mode_Independent;
	adc.ADC_ScanConvMode = DISABLE;
	adc.ADC_ContinuousConvMode = DISABLE;
	adc.ADC_ExternalTrigConv = ADC_ExternalTrigConv_None;
	adc.ADC_DataAlign = ADC_DataAlign_Right;
	adc.ADC_NbrOfChannel = 1;
	ADC_Init(ADC_PERIPH, &adc);
	ADC_Cmd(ADC_PERIPH, ENABLE);

	// perform calibration, not needed but it don't hurt
	ADC_ResetCalibration(ADC_PERIPH);
  	WAIT_FOR(ADC_GetResetCalibrationStatus(ADC_PERIPH));
	ADC_StartCalibration(ADC_PERIPH);
	WAIT_FOR(ADC_GetCalibrationStatus(ADC_PERIPH));
}
开发者ID:obeny,项目名称:ehal-stm32,代码行数:31,代码来源:adc_march.c

示例10: __ADC_Init

static void __ADC_Init(void)
{
	ADC_InitTypeDef ADC_InitStructure;
	
	RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADC1, ENABLE);
	ADC_InitStructure.ADC_Mode = ADC_Mode_Independent;
  ADC_InitStructure.ADC_ScanConvMode = ENABLE;
  ADC_InitStructure.ADC_ContinuousConvMode = ENABLE;
  ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrigConv_None;
  ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right;	
  ADC_InitStructure.ADC_NbrOfChannel = (USE_ADC_PB0 + USE_ADC_PB1 + USE_ADC_PA4 + USE_ADC_PC0); //Change
	ADC_Init(ADC1, &ADC_InitStructure);
	#if (USE_ADC_PB0 == 1)
	ADC_RegularChannelConfig(ADC1, ADC_Channel_8, 1, ADC_SampleTime_55Cycles5);
	#endif
	#if (USE_ADC_PB1 == 1)
	ADC_RegularChannelConfig(ADC1, ADC_Channel_9, 2, ADC_SampleTime_55Cycles5);
	#endif
	#if (USE_ADC_PA4 == 1)
	ADC_RegularChannelConfig(ADC1, ADC_Channel_4, 3, ADC_SampleTime_55Cycles5);
	#endif
	#if (USE_ADC_PC0 == 1)
	ADC_RegularChannelConfig(ADC1, ADC_Channel_10, 4, ADC_SampleTime_55Cycles5);
	#endif
	ADC_DMACmd(ADC1, ENABLE);
	ADC_Cmd(ADC1, ENABLE);
	ADC_ResetCalibration(ADC1);
	while(ADC_GetResetCalibrationStatus(ADC1));
	ADC_StartCalibration(ADC1);
	while(ADC_GetCalibrationStatus(ADC1));
	ADC_SoftwareStartConvCmd(ADC1, ENABLE);
}
开发者ID:NguyenTrongThinh,项目名称:HapticDevice,代码行数:32,代码来源:AMES_ACS712.c

示例11: Accel_ADC_Configuration

/**
 * @brief Initializes the ADC used by the Accelerometer.
 * @retval None
 */
void Accel_ADC_Configuration() {
  ADC_InitTypeDef ADC_InitStructure;

  ADC_InitStructure.ADC_Mode = ADC_Mode_Independent;
  ADC_InitStructure.ADC_ScanConvMode = ENABLE;
  ADC_InitStructure.ADC_ContinuousConvMode = ENABLE;
  ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrigConv_None;
  ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right;
  ADC_InitStructure.ADC_NbrOfChannel = 3;
  ADC_Init(ADC1, &ADC_InitStructure);

  /* ADC1 regular channel 10, 11, 12 configuration */ 
  ADC_RegularChannelConfig(ADC1, ADC_Channel_10, 1, ADC_SampleTime_55Cycles5);
  ADC_RegularChannelConfig(ADC1, ADC_Channel_11, 2, ADC_SampleTime_55Cycles5);
  ADC_RegularChannelConfig(ADC1, ADC_Channel_12, 3, ADC_SampleTime_55Cycles5);

  /* Enable ADC1 DMA */
  ADC_DMACmd(ADC1, ENABLE);
  
  /* Enable ADC1 */
  ADC_Cmd(ADC1, ENABLE);

  /* Enable ADC1 reset calibaration register */   
  ADC_ResetCalibration(ADC1);
  /* Check the end of ADC1 reset calibration register */
  while(ADC_GetResetCalibrationStatus(ADC1));

  /* Start ADC1 calibaration */
  ADC_StartCalibration(ADC1);
  /* Check the end of ADC1 calibration */
  while(ADC_GetCalibrationStatus(ADC1));
     
  /* Start ADC1 Software Conversion */ 
  ADC_SoftwareStartConvCmd(ADC1, ENABLE);
}
开发者ID:zwasson,项目名称:project-blox,代码行数:39,代码来源:blox_accel.c

示例12: InitADC

void InitADC(void) {
	ADC_InitTypeDef adc;

	RCC_ADCCLKConfig(RCC_PCLK2_Div6);

	adc.ADC_Mode = ADC_Mode_Independent;
	adc.ADC_NbrOfChannel = 1;
	adc.ADC_ScanConvMode = DISABLE;
	adc.ADC_DataAlign = ADC_DataAlign_Right;
	adc.ADC_ContinuousConvMode = ENABLE;
	adc.ADC_ExternalTrigConv = ADC_ExternalTrigConv_None;
	ADC_Init(AN_ADCx, &adc);

	ADC_RegularChannelConfig(AN_ADCx, AN_CHx, 1, ADC_SampleTime_7Cycles5);
	ADC_Cmd(AN_ADCx, ENABLE);

	ADC_ResetCalibration(AN_ADCx);

	while (ADC_GetResetCalibrationStatus(AN_ADCx)) {};
	ADC_StartCalibration(AN_ADCx);

	while (ADC_GetCalibrationStatus(AN_ADCx));
	ADC_SoftwareStartConvCmd(AN_ADCx,ENABLE);


}
开发者ID:mkdxdx,项目名称:stm32f100_mgdet,代码行数:26,代码来源:main.c

示例13: TEMP_Init

void TEMP_Init()			//单次,单通道
{
	ADC_InitTypeDef ADC_InitStructure;
	
	RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA|RCC_APB2Periph_ADC1,ENABLE);
	RCC_ADCCLKConfig(RCC_PCLK2_Div6);			//ADC时钟 = 72M/6 = 12M;
	
	
	//ADC_初始化
	ADC_DeInit(ADC1);
	ADC_InitStructure.ADC_Mode = ADC_Mode_Independent;
	ADC_InitStructure.ADC_ScanConvMode = DISABLE;
	ADC_InitStructure.ADC_ContinuousConvMode = DISABLE;
	ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrigConv_None;
	ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right;
	ADC_InitStructure.ADC_NbrOfChannel = 1;
	ADC_Init(ADC1,&ADC_InitStructure);

	ADC_TempSensorVrefintCmd(ENABLE);	//使能内部温度传感器(或参考电压)//======
	ADC_Cmd(ADC1,ENABLE);

	//校准
	ADC_ResetCalibration(ADC1);
	while(ADC_GetResetCalibrationStatus(ADC1));
	ADC_StartCalibration(ADC1);
	while(ADC_GetCalibrationStatus(ADC1));
}
开发者ID:chenghongyao,项目名称:gitprogram,代码行数:27,代码来源:temp.c

示例14: my_random_ADC_Init

/*
      Function £º
			  Initialize ADC function 
	    Parameters£º

	    Return values£º

*/
static my_random_ADC_Init(void)
{
 	ADC_InitTypeDef ADC_InitStructure;
 
    //The following are ADC1's registers settings 
  	ADC_InitStructure.ADC_Mode = ADC_Mode_Independent;//AD module will select as independent mode 
  	ADC_InitStructure.ADC_ScanConvMode = ENABLE;//auto scan mode has been enable 
  	ADC_InitStructure.ADC_ContinuousConvMode = ENABLE;//Continuous convertion mode is enable 
  	ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrigConv_None;//Not external trigger interrupt function  
  	ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right;//data align to right 
  	ADC_InitStructure.ADC_NbrOfChannel = 1;//initialize ADC channel into 1 
  	ADC_Init(ADC1, &ADC_InitStructure);//Build ADC1 settings 
  	//PA0 & ADC1 related channel is 0
  	ADC_RegularChannelConfig(ADC1, ADC_Channel_0, 1, ADC_SampleTime_55Cycles5);
	  //USE ADC1
  	ADC_Cmd(ADC1, ENABLE);
  	//Reset ADC1's regiters  
  	ADC_ResetCalibration(ADC1);
    //Wait until the reset has been done  	
  	while(ADC_GetResetCalibrationStatus(ADC1));
  	//Start the calibration for ADC1 
  	ADC_StartCalibration(ADC1);
  	//Wait until ADC1 calibration has been done  	
  	while(ADC_GetCalibrationStatus(ADC1));
    //Convert to use ADC1 
  	ADC_SoftwareStartConvCmd(ADC1, ENABLE);
}
开发者ID:bangbh81,项目名称:MbedTLS-Test,代码行数:35,代码来源:Random.c

示例15: ADC_Configuration

void ADC_Configuration(void)
{
	ADC_InitTypeDef ADC_InitStructure;
	GPIO_InitTypeDef GPIO_InitStructure;
	
	RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC,ENABLE);
	RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADC1,ENABLE);
	RCC_ADCCLKConfig(RCC_PCLK2_Div6);//12M ADC时钟 在72M的主频下
	
	GPIO_InitStructure.GPIO_Pin=GPIO_Pin_1;//ADC1 端口初始化
	GPIO_InitStructure.GPIO_Mode=GPIO_Mode_AIN;
	GPIO_Init(GPIOC,&GPIO_InitStructure);
	
	ADC_InitStructure.ADC_Mode=ADC_Mode_Independent;//ADC初始化
	ADC_InitStructure.ADC_ScanConvMode= ENABLE;//多通道模式
	ADC_InitStructure.ADC_ContinuousConvMode=DISABLE;//单次模式                                                                                                  ;
	ADC_InitStructure.ADC_ExternalTrigConv=ADC_ExternalTrigConv_None;//软件触发模式
	ADC_InitStructure.ADC_DataAlign=ADC_DataAlign_Right;//数据右对齐
	ADC_InitStructure.ADC_NbrOfChannel=1;//通道数目
	ADC_Init(ADC1,&ADC_InitStructure);
	
	ADC_RegularChannelConfig(ADC1,ADC_Channel_11,1,ADC_SampleTime_239Cycles5);
	//ADC_RegularChannelConfig(ADC1,ADC_Channel_12,2,ADC_SampleTime_1Cycles5);
	//ADC_RegularChannelConfig(ADC1,ADC_Channel_13,3,ADC_SampleTime_1Cycles5);
	ADC_DMACmd(ADC1, ENABLE);//dma开启
	ADC_Cmd(ADC1,ENABLE);//adc使能
	
	ADC_ResetCalibration(ADC1);//复位 校准
	while(ADC_GetResetCalibrationStatus(ADC1));
	ADC_StartCalibration(ADC1);
	while(ADC_GetCalibrationStatus(ADC1));
	
	ADC_SoftwareStartConvCmd(ADC1,ENABLE);//ADC 软件启动
    
}
开发者ID:catoffly,项目名称:TI_KONG,代码行数:35,代码来源:adc.c


注:本文中的ADC_GetCalibrationStatus函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。