Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 

50 строки
1.4 KiB

  1. /**
  2. * @file main.h
  3. * @brief 主程序公共定义和 PLC 输出引脚映射。
  4. * @version 2.0
  5. * @author zengbingjie
  6. * @date 2026-07-29
  7. * @copyright 版权所有 (c) 2026 Xinje Electric。
  8. * @note 修改记录:2.0 将线圈 0 至 7 映射到 Q0 至 Q7。
  9. */
  10. #ifndef MAIN_H
  11. #define MAIN_H
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. #include "stm32f4xx_hal.h"
  16. #include "app_cfg.h"
  17. #include "os_cfg.h"
  18. #include "ucos_ii.h"
  19. extern UART_HandleTypeDef Uart1Handle;
  20. #define PLC_Q0_PORT (GPIOF)
  21. #define PLC_Q0_PIN (GPIO_PIN_6)
  22. #define PLC_Q1_PORT (GPIOF)
  23. #define PLC_Q1_PIN (GPIO_PIN_8)
  24. #define PLC_Q2_PORT (GPIOF)
  25. #define PLC_Q2_PIN (GPIO_PIN_7)
  26. #define PLC_Q3_PORT (GPIOF)
  27. #define PLC_Q3_PIN (GPIO_PIN_9)
  28. #define PLC_Q4_PORT (GPIOI)
  29. #define PLC_Q4_PIN (GPIO_PIN_8)
  30. #define PLC_Q5_PORT (GPIOE)
  31. #define PLC_Q5_PIN (GPIO_PIN_6)
  32. #define PLC_Q6_PORT (GPIOE)
  33. #define PLC_Q6_PIN (GPIO_PIN_5)
  34. #define PLC_Q7_PORT (GPIOE)
  35. #define PLC_Q7_PIN (GPIO_PIN_4)
  36. void Error_Handler(void);
  37. #ifdef __cplusplus
  38. }
  39. #endif
  40. #endif