|
![](static/image/common/ico_lz.png)
楼主 |
发表于 2010-4-6 18:02:36
|
显示全部楼层
void ini_dac_proc( void )
{
gpio_enable_module(ADC_GPIO_MAP, sizeof(ADC_GPIO_MAP) / sizeof(ADC_GPIO_MAP[0])); // Assign and enable GPIO pins to the ADC function.
AVR32_ADC.mr |= 0x09 << AVR32_ADC_MR_PRESCAL_OFFSET;
adc_configure(adc);// configure ADC
adc_enable(adc,tmp_ch1);
adc_enable(adc,vin_ch1);
adc_enable(adc,vout_ch1);
adc_enable(adc,ain_ch1);
adc_enable(adc,aout_ch1);
adc_enable(adc,aleak_ch1);
gpio_disable_pin_pull_up(AVR32_ADC_AD_0_PIN);
gpio_disable_pin_pull_up(AVR32_ADC_AD_1_PIN);
gpio_disable_pin_pull_up(AVR32_ADC_AD_4_PIN);
gpio_disable_pin_pull_up(AVR32_ADC_AD_5_PIN);
gpio_disable_pin_pull_up(AVR32_ADC_AD_6_PIN);
gpio_disable_pin_pull_up(AVR32_ADC_AD_7_PIN);
} |
|