main.h 633 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef __MAIN_H
  2. #define __MAIN_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #define VOLTAGE_CMD 0xA5A5
  7. #define ADC_CONVERT_COUNT (1000)
  8. #define Vref (33)
  9. #define COUNT_BASE (4096)
  10. #define ALL_RES (501000)
  11. #define GATHER_RES (1000)
  12. #include "stm32f0xx_hal.h"
  13. typedef union{
  14. uint8_t u8_buff[4];
  15. uint16_t u16_buff[2];
  16. uint32_t u32_buff;
  17. }Data;
  18. typedef union{
  19. uint8_t u8_tx[4];
  20. uint32_t f_data;
  21. }Tx_Data;
  22. void Error_Handler(void);
  23. #ifdef __cplusplus
  24. }
  25. #endif
  26. #endif /* __MAIN_H */