You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
769 B

4 years ago
3 years ago
4 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
3 years ago
4 years ago
  1. #ifndef _ADC_H_
  2. #define _ADC_H_
  3. #include "port.h"
  4. #include "systick.h"
  5. void ADCInit(uint8_t *port, uint8_t pin);
  6. void ADCPA2Init();
  7. void get_adc_value(void);
  8. void get_pa2_adc_value(void);
  9. void try_adc_gather(void);
  10. void beg_average_value(uint16_t *adc_buff);
  11. typedef struct {
  12. bool abnormal_state;
  13. bool past_count_reached_five;
  14. bool first_detection_abnormal;
  15. uint16_t adc_value_buff[5];
  16. uint8_t adc_value_count;
  17. uint16_t adc_just_now_gather_val;
  18. uint8_t *port;
  19. uint8_t pin;
  20. } adc_t;
  21. void record_adc_gather_value(uint16_t adc_value);
  22. // typedef struct {
  23. // uint16_t adc_value_buff[5];
  24. // uint8_t adc_value_count;
  25. // bool abnormal_state;
  26. // bool past_count_reached_five; //����ʹ��
  27. // } adc_t;
  28. #endif