adc.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef __ADC_H
  2. #define __ADC_H
  3. #include "stm32f4xx.h"
  4. #define ADC_CHANNEL 2
  5. extern u16 uAD_Buff_A[ADC_CHANNEL]; //ADC采集缓存A
  6. extern u16 uAD_Buff_B[ADC_CHANNEL]; //ADC采集缓存B
  7. void ADC_GPIO_Config(u32 RCC_APBnPeriphn, GPIO_TypeDef *GPIOx,u16 PIN);
  8. void ADC_DMA_Config(u32 RCC_AHB_DMA,u32 DMA_Channel,ADC_TypeDef* ADCn,DMA_Stream_TypeDef *DMA_Stream);
  9. void ADC_DMA_Mode_Config(u32 RCC_APB_ADCn, u32 ADC_ExternalTrigConv, ADC_TypeDef* ADCn, u8 ADC_Channel[], u8 Channel_num);
  10. void ADC_NVIC_Config(u8 IRQChannel, u8 pre, u8 sub);
  11. void ADC_TIM_Config(TIM_TypeDef* TIMx,u16 psc, u16 per,
  12. void(*ClockCMD)(uint32_t, FunctionalState),u32 RCC_APBnPeriphn, //APB时钟使能设置
  13. void(*TIM_OCInit)(TIM_TypeDef*, TIM_OCInitTypeDef*), //OC通道设置
  14. void(*TIM_OCPreloadConfig)(TIM_TypeDef*, uint16_t));
  15. void ADC_SOFT_Mode_Config(u32 RCC_APBnPeriphn, ADC_TypeDef* ADCn, u8 Channel_num);
  16. u16 Get_SOFT_ADC(ADC_TypeDef* ADCn, u8 ADC_Channe);
  17. #endif