?? adc.c
字號(hào):
/**
* @file adc.c
*
* Copyright (c) 2004 Atmel.
*
* @brief Ce fichier permet de
*
* This file is included by all source files in order to access to system wide
* configuration.
* @version 1.0 (CVS revision : $Revision: 1.1.1.1 $)
* @date $Date: 2005/09/21 15:08:53 $ (created on 06/04/2004)
* @author $Author: jberthy $ (created by Emmanuel David)
*****************************************************************************/
#include "config.h"
#include "inavr.h"
#include "lib_mcu/adc/adc_drv.h"
/*****************************************************************************/
/* ADC Initialization */
/*****************************************************************************/
/*!
* This function initializes the ADC :
* - enable and run the ADC,
* - the end of conversion generates an interruption
* - 10 bit resolution
*/
void ADC_Init(void) {
Enable_adc();
//Left_adjust_adc_result(); // use 8 bits resolution
Right_adjust_adc_result() ; // use 10 bits resolution
Enable_vcc_vref();
Enable_adc_it();
Select_adc_channel(0<<MUX3 | 1<<MUX2 | 0<<MUX1 | 1<<MUX0);
Set_prescaler( 0<<ADPS2 | 0<<ADPS1 | 0<<ADPS0);
//Clear_adc_mux();
//ADMUX |= 0x00;
ADCSRB = 0x00; // free running mode
}
void ADC_start_conv(void) {
Start_conv();
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -