stm32_eval.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  1. /**
  2. ******************************************************************************
  3. * @file stm32_eval.h
  4. * @author MCD Application Team
  5. * @version V4.5.0
  6. * @date 07-March-2011
  7. * @brief Header file for stm32_eval.c module.
  8. ******************************************************************************
  9. * @attention
  10. *
  11. * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  12. * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
  13. * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
  14. * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
  15. * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
  16. * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  17. *
  18. * <h2><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h2>
  19. ******************************************************************************
  20. */
  21. /* Define to prevent recursive inclusion -------------------------------------*/
  22. #ifndef __STM32_EVAL_H
  23. #define __STM32_EVAL_H
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. /* Includes ------------------------------------------------------------------*/
  28. /** @addtogroup Utilities
  29. * @{
  30. */
  31. /** @addtogroup STM32_EVAL
  32. * @{
  33. */
  34. /** @defgroup STM32_EVAL_Abstraction_Layer
  35. * @{
  36. */
  37. /** @defgroup STM32_EVAL_HARDWARE_RESOURCES
  38. * @{
  39. */
  40. /**
  41. @code
  42. The table below gives an overview of the hardware resources supported by each
  43. STM32 EVAL board.
  44. - LCD: TFT Color LCD (Parallel (FSMC) and Serial (SPI))
  45. - IOE: IO Expander on I2C
  46. - sFLASH: serial SPI FLASH (M25Pxxx)
  47. - sEE: serial I2C EEPROM (M24C08, M24C32, M24C64)
  48. - TSENSOR: Temperature Sensor (LM75)
  49. - SD: SD Card memory (SPI and SDIO (SD Card MODE))
  50. =================================================================================================================+
  51. STM32 EVAL | LED | Buttons | Com Ports | LCD | IOE | sFLASH | sEE | TSENSOR | SD (SPI) | SD(SDIO) |
  52. =================================================================================================================+
  53. STM3210B-EVAL | 4 | 8 | 2 | YES (SPI) | NO | YES | NO | YES | YES | NO |
  54. -----------------------------------------------------------------------------------------------------------------+
  55. STM3210E-EVAL | 4 | 8 | 2 | YES (FSMC)| NO | YES | NO | YES | NO | YES |
  56. -----------------------------------------------------------------------------------------------------------------+
  57. STM3210C-EVAL | 4 | 3 | 1 | YES (SPI) | YES | NO | YES | NO | YES | NO |
  58. -----------------------------------------------------------------------------------------------------------------+
  59. STM32100B-EVAL | 4 | 8 | 2 | YES (SPI) | NO | YES | NO | YES | YES | NO |
  60. -----------------------------------------------------------------------------------------------------------------+
  61. STM32L152-EVAL | 4 | 8 | 2 | YES (SPI) | NO | NO | NO | YES | YES | NO |
  62. -----------------------------------------------------------------------------------------------------------------+
  63. STM32100E-EVAL | 4 | 8 | 2 | YES (FSMC)| YES | YES | YES | YES | YES | NO |
  64. =================================================================================================================+
  65. @endcode
  66. */
  67. /**
  68. * @}
  69. */
  70. /** @defgroup STM32_EVAL_Exported_Types
  71. * @{
  72. */
  73. typedef enum
  74. {
  75. LED1 = 0,
  76. LED2 = 1,
  77. LED3 = 2,
  78. LED4 = 3
  79. } Led_TypeDef;
  80. typedef enum
  81. {
  82. BUTTON_WAKEUP = 0,
  83. BUTTON_TAMPER = 1,
  84. BUTTON_KEY = 2,
  85. BUTTON_RIGHT = 3,
  86. BUTTON_LEFT = 4,
  87. BUTTON_UP = 5,
  88. BUTTON_DOWN = 6,
  89. BUTTON_SEL = 7
  90. } Button_TypeDef;
  91. typedef enum
  92. {
  93. BUTTON_MODE_GPIO = 0,
  94. BUTTON_MODE_EXTI = 1
  95. } ButtonMode_TypeDef;
  96. typedef enum
  97. {
  98. JOY_NONE = 0,
  99. JOY_SEL = 1,
  100. JOY_DOWN = 2,
  101. JOY_LEFT = 3,
  102. JOY_RIGHT = 4,
  103. JOY_UP = 5
  104. } JOYState_TypeDef
  105. ;
  106. typedef enum
  107. {
  108. COM1 = 0,
  109. COM2 = 1
  110. } COM_TypeDef;
  111. /**
  112. * @}
  113. */
  114. /** @defgroup STM32_EVAL_Exported_Constants
  115. * @{
  116. */
  117. /**
  118. * @brief Uncomment the line corresponding to the STMicroelectronics evaluation
  119. * board used in your application.
  120. *
  121. * Tip: To avoid modifying this file each time you need to switch between these
  122. * boards, you can define the board in your toolchain compiler preprocessor.
  123. */
  124. #if !defined (USE_STM32100B_EVAL) && !defined (USE_STM3210B_EVAL) && !defined (USE_STM3210E_EVAL)\
  125. && !defined (USE_STM3210C_EVAL) && !defined (USE_STM32L152_EVAL) && !defined (USE_STM32100E_EVAL)
  126. //#define USE_STM32100B_EVAL
  127. //#define USE_STM3210B_EVAL
  128. //#define USE_STM3210E_EVAL
  129. //#define USE_STM3210C_EVAL
  130. //#define USE_STM32L152_EVAL
  131. //#define USE_STM32100E_EVAL
  132. #endif
  133. #ifdef USE_STM32100B_EVAL
  134. #include "stm32f10x.h"
  135. #include "stm32100b_eval/stm32100b_eval.h"
  136. #elif defined USE_STM3210B_EVAL
  137. #include "stm32f10x.h"
  138. #include "stm3210b_eval/stm3210b_eval.h"
  139. #elif defined USE_STM3210E_EVAL
  140. #include "stm32f10x.h"
  141. #include "stm3210e_eval/stm3210e_eval.h"
  142. #elif defined USE_STM3210C_EVAL
  143. #include "stm32f10x.h"
  144. #include "stm3210c_eval/stm3210c_eval.h"
  145. #elif defined USE_STM32L152_EVAL
  146. #include "stm32l1xx.h"
  147. #include "stm32l152_eval/stm32l152_eval.h"
  148. #elif defined USE_STM32100E_EVAL
  149. #include "stm32f10x.h"
  150. #include "stm32100e_eval/stm32100e_eval.h"
  151. #else
  152. #error "Please select first the STM32 EVAL board to be used (in stm32_eval.h)"
  153. #endif
  154. /**
  155. * @brief STM32 Button Defines Legacy
  156. */
  157. #define Button_WAKEUP BUTTON_WAKEUP
  158. #define Button_TAMPER BUTTON_TAMPER
  159. #define Button_KEY BUTTON_KEY
  160. #define Button_RIGHT BUTTON_RIGHT
  161. #define Button_LEFT BUTTON_LEFT
  162. #define Button_UP BUTTON_UP
  163. #define Button_DOWN BUTTON_DOWN
  164. #define Button_SEL BUTTON_SEL
  165. #define Mode_GPIO BUTTON_MODE_GPIO
  166. #define Mode_EXTI BUTTON_MODE_EXTI
  167. #define Button_Mode_TypeDef ButtonMode_TypeDef
  168. #define JOY_CENTER JOY_SEL
  169. #define JOY_State_TypeDef JOYState_TypeDef
  170. /**
  171. * @brief LCD Defines Legacy
  172. */
  173. #define LCD_RSNWR_GPIO_CLK LCD_NWR_GPIO_CLK
  174. #define LCD_SPI_GPIO_PORT LCD_SPI_SCK_GPIO_PORT
  175. #define LCD_SPI_GPIO_CLK LCD_SPI_SCK_GPIO_CLK
  176. #define R0 LCD_REG_0
  177. #define R1 LCD_REG_1
  178. #define R2 LCD_REG_2
  179. #define R3 LCD_REG_3
  180. #define R4 LCD_REG_4
  181. #define R5 LCD_REG_5
  182. #define R6 LCD_REG_6
  183. #define R7 LCD_REG_7
  184. #define R8 LCD_REG_8
  185. #define R9 LCD_REG_9
  186. #define R10 LCD_REG_10
  187. #define R12 LCD_REG_12
  188. #define R13 LCD_REG_13
  189. #define R14 LCD_REG_14
  190. #define R15 LCD_REG_15
  191. #define R16 LCD_REG_16
  192. #define R17 LCD_REG_17
  193. #define R18 LCD_REG_18
  194. #define R19 LCD_REG_19
  195. #define R20 LCD_REG_20
  196. #define R21 LCD_REG_21
  197. #define R22 LCD_REG_22
  198. #define R23 LCD_REG_23
  199. #define R24 LCD_REG_24
  200. #define R25 LCD_REG_25
  201. #define R26 LCD_REG_26
  202. #define R27 LCD_REG_27
  203. #define R28 LCD_REG_28
  204. #define R29 LCD_REG_29
  205. #define R30 LCD_REG_30
  206. #define R31 LCD_REG_31
  207. #define R32 LCD_REG_32
  208. #define R33 LCD_REG_33
  209. #define R34 LCD_REG_34
  210. #define R36 LCD_REG_36
  211. #define R37 LCD_REG_37
  212. #define R40 LCD_REG_40
  213. #define R41 LCD_REG_41
  214. #define R43 LCD_REG_43
  215. #define R45 LCD_REG_45
  216. #define R48 LCD_REG_48
  217. #define R49 LCD_REG_49
  218. #define R50 LCD_REG_50
  219. #define R51 LCD_REG_51
  220. #define R52 LCD_REG_52
  221. #define R53 LCD_REG_53
  222. #define R54 LCD_REG_54
  223. #define R55 LCD_REG_55
  224. #define R56 LCD_REG_56
  225. #define R57 LCD_REG_57
  226. #define R59 LCD_REG_59
  227. #define R60 LCD_REG_60
  228. #define R61 LCD_REG_61
  229. #define R62 LCD_REG_62
  230. #define R63 LCD_REG_63
  231. #define R64 LCD_REG_64
  232. #define R65 LCD_REG_65
  233. #define R66 LCD_REG_66
  234. #define R67 LCD_REG_67
  235. #define R68 LCD_REG_68
  236. #define R69 LCD_REG_69
  237. #define R70 LCD_REG_70
  238. #define R71 LCD_REG_71
  239. #define R72 LCD_REG_72
  240. #define R73 LCD_REG_73
  241. #define R74 LCD_REG_74
  242. #define R75 LCD_REG_75
  243. #define R76 LCD_REG_76
  244. #define R77 LCD_REG_77
  245. #define R78 LCD_REG_78
  246. #define R79 LCD_REG_79
  247. #define R80 LCD_REG_80
  248. #define R81 LCD_REG_81
  249. #define R82 LCD_REG_82
  250. #define R83 LCD_REG_83
  251. #define R96 LCD_REG_96
  252. #define R97 LCD_REG_97
  253. #define R106 LCD_REG_106
  254. #define R118 LCD_REG_118
  255. #define R128 LCD_REG_128
  256. #define R129 LCD_REG_129
  257. #define R130 LCD_REG_130
  258. #define R131 LCD_REG_131
  259. #define R132 LCD_REG_132
  260. #define R133 LCD_REG_133
  261. #define R134 LCD_REG_134
  262. #define R135 LCD_REG_135
  263. #define R136 LCD_REG_136
  264. #define R137 LCD_REG_137
  265. #define R139 LCD_REG_139
  266. #define R140 LCD_REG_140
  267. #define R141 LCD_REG_141
  268. #define R143 LCD_REG_143
  269. #define R144 LCD_REG_144
  270. #define R145 LCD_REG_145
  271. #define R146 LCD_REG_146
  272. #define R147 LCD_REG_147
  273. #define R148 LCD_REG_148
  274. #define R149 LCD_REG_149
  275. #define R150 LCD_REG_150
  276. #define R151 LCD_REG_151
  277. #define R152 LCD_REG_152
  278. #define R153 LCD_REG_153
  279. #define R154 LCD_REG_154
  280. #define R157 LCD_REG_157
  281. #define R192 LCD_REG_192
  282. #define R193 LCD_REG_193
  283. #define R227 LCD_REG_227
  284. #define R229 LCD_REG_229
  285. #define R231 LCD_REG_231
  286. #define R239 LCD_REG_239
  287. #define White LCD_COLOR_WHITE
  288. #define Black LCD_COLOR_BLACK
  289. #define Grey LCD_COLOR_GREY
  290. #define Blue LCD_COLOR_BLUE
  291. #define Blue2 LCD_COLOR_BLUE2
  292. #define Red LCD_COLOR_RED
  293. #define Magenta LCD_COLOR_MAGENTA
  294. #define Green LCD_COLOR_GREEN
  295. #define Cyan LCD_COLOR_CYAN
  296. #define Yellow LCD_COLOR_YELLOW
  297. #define Line0 LCD_LINE_0
  298. #define Line1 LCD_LINE_1
  299. #define Line2 LCD_LINE_2
  300. #define Line3 LCD_LINE_3
  301. #define Line4 LCD_LINE_4
  302. #define Line5 LCD_LINE_5
  303. #define Line6 LCD_LINE_6
  304. #define Line7 LCD_LINE_7
  305. #define Line8 LCD_LINE_8
  306. #define Line9 LCD_LINE_9
  307. #define Horizontal LCD_DIR_HORIZONTAL
  308. #define Vertical LCD_DIR_VERTICAL
  309. /**
  310. * @}
  311. */
  312. /** @defgroup STM32_EVAL_Exported_Macros
  313. * @{
  314. */
  315. /**
  316. * @}
  317. */
  318. /** @defgroup STM32_EVAL_Exported_Functions
  319. * @{
  320. */
  321. /**
  322. * @}
  323. */
  324. #ifdef __cplusplus
  325. }
  326. #endif
  327. #endif /* __STM32_EVAL_H */
  328. /**
  329. * @}
  330. */
  331. /**
  332. * @}
  333. */
  334. /**
  335. * @}
  336. */
  337. /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/