bat.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. #ifndef __12VBAT_H
  2. #define __12VBAT_H
  3. #include "stm32f2xx.h"
  4. #define ON 1
  5. #define OFF 0
  6. #define GPIO0_PIN GPIO_Pin_1
  7. #define GPIO0_PORT GPIOG
  8. #define GPIO0_CLK RCC_AHB1Periph_GPIOG
  9. #define GPIO1_PIN GPIO_Pin_11
  10. #define GPIO1_PORT GPIOB
  11. #define GPIO1_CLK RCC_AHB1Periph_GPIOB
  12. #define GPIO2_PIN GPIO_Pin_12
  13. #define GPIO2_PORT GPIOB
  14. #define GPIO2_CLK RCC_AHB1Periph_GPIOB
  15. #define GPIO3_PIN GPIO_Pin_13
  16. #define GPIO3_PORT GPIOB
  17. #define GPIO3_CLK RCC_AHB1Periph_GPIOB
  18. #define GPIO4_PIN GPIO_Pin_14
  19. #define GPIO4_PORT GPIOB
  20. #define GPIO4_CLK RCC_AHB1Periph_GPIOB
  21. #define GPIO5_PIN GPIO_Pin_15
  22. #define GPIO5_PORT GPIOB
  23. #define GPIO5_CLK RCC_AHB1Periph_GPIOB
  24. #define GPIO6_PIN GPIO_Pin_10
  25. #define GPIO6_PORT GPIOD
  26. #define GPIO6_CLK RCC_AHB1Periph_GPIOD
  27. #define GPIO7_PIN GPIO_Pin_11
  28. #define GPIO7_PORT GPIOD
  29. #define GPIO7_CLK RCC_AHB1Periph_GPIOD
  30. #define GPIO8_PIN GPIO_Pin_12
  31. #define GPIO8_PORT GPIOD
  32. #define GPIO8_CLK RCC_AHB1Periph_GPIOD
  33. #define GPIO9_PIN GPIO_Pin_13
  34. #define GPIO9_PORT GPIOD
  35. #define GPIO9_CLK RCC_AHB1Periph_GPIOD
  36. #define GPIO10_PIN GPIO_Pin_14
  37. #define GPIO10_PORT GPIOD
  38. #define GPIO10_CLK RCC_AHB1Periph_GPIOD
  39. #define GPIO11_PIN GPIO_Pin_15
  40. #define GPIO11_PORT GPIOD
  41. #define GPIO11_CLK RCC_AHB1Periph_GPIOD
  42. #define GPIO12_PIN GPIO_Pin_2
  43. #define GPIO12_PORT GPIOG
  44. #define GPIO12_CLK RCC_AHB1Periph_GPIOG
  45. #define GPIO13_PIN GPIO_Pin_3
  46. #define GPIO13_PORT GPIOG
  47. #define GPIO13_CLK RCC_AHB1Periph_GPIOG
  48. #define GPIO14_PIN GPIO_Pin_4
  49. #define GPIO14_PORT GPIOG
  50. #define GPIO14_CLK RCC_AHB1Periph_GPIOG
  51. #define GPIO15_PIN GPIO_Pin_5
  52. #define GPIO15_PORT GPIOG
  53. #define GPIO15_CLK RCC_AHB1Periph_GPIOG
  54. #define GPIO16_PIN GPIO_Pin_6
  55. #define GPIO16_PORT GPIOG
  56. #define GPIO16_CLK RCC_AHB1Periph_GPIOG
  57. #define GPIO17_PIN GPIO_Pin_7
  58. #define GPIO17_PORT GPIOG
  59. #define GPIO17_CLK RCC_AHB1Periph_GPIOG
  60. #define GPIO18_PIN GPIO_Pin_8
  61. #define GPIO18_PORT GPIOG
  62. #define GPIO18_CLK RCC_AHB1Periph_GPIOG
  63. #define GPIO19_PIN GPIO_Pin_6
  64. #define GPIO19_PORT GPIOC
  65. #define GPIO19_CLK RCC_AHB1Periph_GPIOC
  66. #define GPIO20_PIN GPIO_Pin_7
  67. #define GPIO20_PORT GPIOC
  68. #define GPIO20_CLK RCC_AHB1Periph_GPIOC
  69. #define GPIO21_PIN GPIO_Pin_8
  70. #define GPIO21_PORT GPIOC
  71. #define GPIO21_CLK RCC_AHB1Periph_GPIOC
  72. #define GPIO22_PIN GPIO_Pin_9
  73. #define GPIO22_PORT GPIOC
  74. #define GPIO22_CLK RCC_AHB1Periph_GPIOC
  75. #define GPIO23_PIN GPIO_Pin_8
  76. #define GPIO23_PORT GPIOA
  77. #define GPIO23_CLK RCC_AHB1Periph_GPIOA
  78. #define EVM_5V_PIN GPIO_Pin_12
  79. #define EVM_5V_PORT GPIOA
  80. #define EVM_5V_CLK RCC_AHB1Periph_GPIOA
  81. void BAT_12V_Config(void);
  82. void BAT_5V_Config(void);
  83. void all_12VBAT(uint8_t cmd);
  84. void BAT12V(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, uint8_t a);
  85. #endif