fix_bsp_gpadc.h 779 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef _FIX_BSP_GP_ADC_H_
  2. #define _FIX_BSP_GP_ADC_H_
  3. #include "bsp_register_macro.h"
  4. #define FIFO_DEEP 16
  5. #define GADC_FREQ_500K 16
  6. #define GADC_FREQ_1M 8
  7. #define GADC_FREQ_2M 4
  8. #define GADC_FREQ_4M 2
  9. #define GADC_FREQ_8M 1
  10. #define GADC_REF_2_47V 1
  11. #define GADC_REF_AVDD 2
  12. typedef struct gadc_cache_struct{
  13. unsigned int value_2 : 10;
  14. unsigned int chanel_2 : 4;
  15. unsigned int : 2;
  16. unsigned int value_1 : 10;
  17. unsigned int chanel_1 : 4;
  18. unsigned int : 2;
  19. }gadc_cache_t;
  20. int fix_init_adc(uint8_t freq,uint8_t gadc_ref);
  21. void fix_adc_gpio_config(uint16_t channels);
  22. void test_xc_gpadc(void);
  23. void user_config_adc_init(void);
  24. uint16_t user_get_adc_data(uint8_t channel);
  25. void user_config_adc_channel(uint8_t channel);
  26. #endif