stm32f4_discovery.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. /**
  2. ******************************************************************************
  3. * @file stm32f4_discovery.h
  4. * @author MCD Application Team
  5. * @version V1.1.0
  6. * @date 28-October-2011
  7. * @brief This file contains definitions for STM32F4-Discovery Kit's Leds and
  8. * push-button hardware resources.
  9. ******************************************************************************
  10. * @attention
  11. *
  12. * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  13. * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
  14. * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
  15. * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
  16. * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
  17. * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  18. *
  19. * <h2><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h2>
  20. ******************************************************************************
  21. */
  22. /* Define to prevent recursive inclusion -------------------------------------*/
  23. #ifndef __STM32F4_DISCOVERY_H
  24. #define __STM32F4_DISCOVERY_H
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28. /* Includes ------------------------------------------------------------------*/
  29. #include "stm32f4xx.h"
  30. /** @addtogroup Utilities
  31. * @{
  32. */
  33. /** @addtogroup STM32F4_DISCOVERY
  34. * @{
  35. */
  36. /** @addtogroup STM32F4_DISCOVERY_LOW_LEVEL
  37. * @{
  38. */
  39. /** @defgroup STM32F4_DISCOVERY_LOW_LEVEL_Exported_Types
  40. * @{
  41. */
  42. typedef enum
  43. {
  44. LED4 = 0,
  45. LED3 = 1,
  46. LED5 = 2,
  47. LED6 = 3
  48. } Led_TypeDef;
  49. typedef enum
  50. {
  51. BUTTON_USER = 0,
  52. } Button_TypeDef;
  53. typedef enum
  54. {
  55. BUTTON_MODE_GPIO = 0,
  56. BUTTON_MODE_EXTI = 1
  57. } ButtonMode_TypeDef;
  58. /**
  59. * @}
  60. */
  61. /** @defgroup STM32F4_DISCOVERY_LOW_LEVEL_Exported_Constants
  62. * @{
  63. */
  64. /** @addtogroup STM32F4_DISCOVERY_LOW_LEVEL_LED
  65. * @{
  66. */
  67. #define LEDn 4
  68. #define LED4_PIN GPIO_Pin_12
  69. #define LED4_GPIO_PORT GPIOD
  70. #define LED4_GPIO_CLK RCC_AHB1Periph_GPIOD
  71. #define LED3_PIN GPIO_Pin_13
  72. #define LED3_GPIO_PORT GPIOD
  73. #define LED3_GPIO_CLK RCC_AHB1Periph_GPIOD
  74. #define LED5_PIN GPIO_Pin_14
  75. #define LED5_GPIO_PORT GPIOD
  76. #define LED5_GPIO_CLK RCC_AHB1Periph_GPIOD
  77. #define LED6_PIN GPIO_Pin_15
  78. #define LED6_GPIO_PORT GPIOD
  79. #define LED6_GPIO_CLK RCC_AHB1Periph_GPIOD
  80. /**
  81. * @}
  82. */
  83. /** @addtogroup STM32F4_DISCOVERY_LOW_LEVEL_BUTTON
  84. * @{
  85. */
  86. #define BUTTONn 1
  87. /**
  88. * @brief Wakeup push-button
  89. */
  90. #define USER_BUTTON_PIN GPIO_Pin_0
  91. #define USER_BUTTON_GPIO_PORT GPIOA
  92. #define USER_BUTTON_GPIO_CLK RCC_AHB1Periph_GPIOA
  93. #define USER_BUTTON_EXTI_LINE EXTI_Line0
  94. #define USER_BUTTON_EXTI_PORT_SOURCE EXTI_PortSourceGPIOA
  95. #define USER_BUTTON_EXTI_PIN_SOURCE EXTI_PinSource0
  96. #define USER_BUTTON_EXTI_IRQn EXTI0_IRQn
  97. /**
  98. * @}
  99. */
  100. /** @defgroup STM32F4_DISCOVERY_LOW_LEVEL_Exported_Macros
  101. * @{
  102. */
  103. /**
  104. * @}
  105. */
  106. /** @defgroup STM32F4_DISCOVERY_LOW_LEVEL_Exported_Functions
  107. * @{
  108. */
  109. void STM_EVAL_LEDInit(Led_TypeDef Led);
  110. void STM_EVAL_LEDOn(Led_TypeDef Led);
  111. void STM_EVAL_LEDOff(Led_TypeDef Led);
  112. void STM_EVAL_LEDToggle(Led_TypeDef Led);
  113. void STM_EVAL_PBInit(Button_TypeDef Button, ButtonMode_TypeDef Button_Mode);
  114. uint32_t STM_EVAL_PBGetState(Button_TypeDef Button);
  115. /**
  116. * @}
  117. */
  118. #ifdef __cplusplus
  119. }
  120. #endif
  121. #endif /* __STM32F4_DISCOVERY_H */
  122. /**
  123. * @}
  124. */
  125. /**
  126. * @}
  127. */
  128. /**
  129. * @}
  130. */
  131. /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/