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.

31 lines
740 B

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