api_rt_adc.h 438 B

12345678910111213141516171819202122232425
  1. #ifndef _API_RT_ADC_H_
  2. #define _API_RT_ADC_H_
  3. #include <stdint.h>
  4. #include "api_adc.h"
  5. #include "gd32f30x.h"
  6. #define ADC_DEVICE_COUNT 1
  7. #define ADC_RESULT_SIZE 16
  8. typedef struct
  9. {
  10. uint32_t AdcBase;
  11. uint32_t DmaBase;
  12. dma_channel_enum *DmaChannelBase;
  13. uint16_t Results[ADC_RESULT_SIZE];
  14. } Adc_Handle;
  15. extern Adc_Handle Adcs[3];
  16. void iRtAdc_Init(void);
  17. void iRtAdc_CompleteIsr(uint8_t devIndex);
  18. #endif