main.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. /* USER CODE BEGIN Header */
  2. /**
  3. ******************************************************************************
  4. * @file : main.h
  5. * @brief : Header for main.c file.
  6. * This file contains the common defines of the application.
  7. ******************************************************************************
  8. * @attention
  9. *
  10. * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
  11. * All rights reserved.</center></h2>
  12. *
  13. * This software component is licensed by ST under Ultimate Liberty license
  14. * SLA0044, the "License"; You may not use this file except in compliance with
  15. * the License. You may obtain a copy of the License at:
  16. * www.st.com/SLA0044
  17. *
  18. ******************************************************************************
  19. */
  20. /* USER CODE END Header */
  21. /* Define to prevent recursive inclusion -------------------------------------*/
  22. #ifndef __MAIN_H
  23. #define __MAIN_H
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. /* Includes ------------------------------------------------------------------*/
  28. #include "stm32f1xx_hal.h"
  29. /* Private includes ----------------------------------------------------------*/
  30. /* USER CODE BEGIN Includes */
  31. #include "includes.h"
  32. /* USER CODE END Includes */
  33. /* Exported types ------------------------------------------------------------*/
  34. /* USER CODE BEGIN ET */
  35. /* USER CODE END ET */
  36. /* Exported constants --------------------------------------------------------*/
  37. /* USER CODE BEGIN EC */
  38. /* USER CODE END EC */
  39. /* Exported macro ------------------------------------------------------------*/
  40. /* USER CODE BEGIN EM */
  41. /* USER CODE END EM */
  42. /* Exported functions prototypes ---------------------------------------------*/
  43. void Error_Handler(void);
  44. /* USER CODE BEGIN EFP */
  45. /* USER CODE END EFP */
  46. /* Private defines -----------------------------------------------------------*/
  47. #define LED1_Pin GPIO_PIN_13
  48. #define LED1_GPIO_Port GPIOC
  49. #define MIC_EN_Pin GPIO_PIN_0
  50. #define MIC_EN_GPIO_Port GPIOC
  51. #define MIC_ENB_Pin GPIO_PIN_1
  52. #define MIC_ENB_GPIO_Port GPIOC
  53. #define POWER_EN_Pin GPIO_PIN_2
  54. #define POWER_EN_GPIO_Port GPIOC
  55. #define KEY_PTT_Pin GPIO_PIN_3
  56. #define KEY_PTT_GPIO_Port GPIOC
  57. #define SPI_NESS_Pin GPIO_PIN_4
  58. #define SPI_NESS_GPIO_Port GPIOA
  59. #define SPK_ENB_Pin GPIO_PIN_4
  60. #define SPK_ENB_GPIO_Port GPIOC
  61. #define MODEM_EN_Pin GPIO_PIN_0
  62. #define MODEM_EN_GPIO_Port GPIOB
  63. #define MODEM_RESE_Pin GPIO_PIN_1
  64. #define MODEM_RESE_GPIO_Port GPIOB
  65. #define LCD_CS_Pin GPIO_PIN_12
  66. #define LCD_CS_GPIO_Port GPIOB
  67. #define LCD_SCK_Pin GPIO_PIN_13
  68. #define LCD_SCK_GPIO_Port GPIOB
  69. #define LCD_A0_Pin GPIO_PIN_14
  70. #define LCD_A0_GPIO_Port GPIOB
  71. #define LCD_SDA_Pin GPIO_PIN_15
  72. #define LCD_SDA_GPIO_Port GPIOB
  73. #define LCD_RESET_Pin GPIO_PIN_6
  74. #define LCD_RESET_GPIO_Port GPIOC
  75. #define LCD_BL_EN_Pin GPIO_PIN_7
  76. #define LCD_BL_EN_GPIO_Port GPIOC
  77. #define SPK_EN1_Pin GPIO_PIN_8
  78. #define SPK_EN1_GPIO_Port GPIOC
  79. #define GPS_POWER_Pin GPIO_PIN_9
  80. #define GPS_POWER_GPIO_Port GPIOC
  81. #define FLASH_CS2_Pin GPIO_PIN_8
  82. #define FLASH_CS2_GPIO_Port GPIOA
  83. #define R522_RST_Pin GPIO_PIN_11
  84. #define R522_RST_GPIO_Port GPIOA
  85. #define R522_SDA_Pin GPIO_PIN_12
  86. #define R522_SDA_GPIO_Port GPIOA
  87. #define VLUME_DATA_Pin GPIO_PIN_11
  88. #define VLUME_DATA_GPIO_Port GPIOC
  89. #define VOLUME_CLK_Pin GPIO_PIN_12
  90. #define VOLUME_CLK_GPIO_Port GPIOC
  91. #define LED2_Pin GPIO_PIN_2
  92. #define LED2_GPIO_Port GPIOD
  93. #define KEY_MENU_Pin GPIO_PIN_3
  94. #define KEY_MENU_GPIO_Port GPIOB
  95. #define KEY_EXIT_Pin GPIO_PIN_4
  96. #define KEY_EXIT_GPIO_Port GPIOB
  97. #define KEY_UP_Pin GPIO_PIN_5
  98. #define KEY_UP_GPIO_Port GPIOB
  99. #define KEY_DOWN_Pin GPIO_PIN_6
  100. #define KEY_DOWN_GPIO_Port GPIOB
  101. #define KEY_OK_Pin GPIO_PIN_7
  102. #define KEY_OK_GPIO_Port GPIOB
  103. #define R522_SCL_Pin GPIO_PIN_8
  104. #define R522_SCL_GPIO_Port GPIOB
  105. #define TYPEC_Pin GPIO_PIN_9
  106. #define TYPEC_GPIO_Port GPIOB
  107. /* USER CODE BEGIN Private defines */
  108. #define SPK_ENB_HIGH HAL_GPIO_WritePin(SPK_ENB_GPIO_Port, SPK_ENB_Pin, GPIO_PIN_SET);
  109. #define SPK_ENB_LOW HAL_GPIO_WritePin(SPK_ENB_GPIO_Port, SPK_ENB_Pin, GPIO_PIN_RESET);
  110. //#define SPK_EN1_Pin GPIO_PIN_8
  111. //#define SPK_EN1_GPIO_Port GPIOC
  112. #define SPK_EN1_HIGH HAL_GPIO_WritePin(SPK_EN1_GPIO_Port, SPK_EN1_Pin, GPIO_PIN_SET);
  113. #define SPK_EN1_LOW HAL_GPIO_WritePin(SPK_EN1_GPIO_Port, SPK_EN1_Pin, GPIO_PIN_RESET);
  114. /* USER CODE END Private defines */
  115. #ifdef __cplusplus
  116. }
  117. #endif
  118. #endif /* __MAIN_H */
  119. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/