STM32vldiscovery.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. /**
  2. ******************************************************************************
  3. * @file STM32vldiscovery.h
  4. * @author MCD Application Team
  5. * @version V1.0.0
  6. * @date 09/13/2010
  7. * @brief Header file for STM32vldiscovery.c module.
  8. ******************************************************************************
  9. * @copy
  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 2010 STMicroelectronics</center></h2>
  19. */
  20. /* Define to prevent recursive inclusion -------------------------------------*/
  21. #ifndef __STM32F100_Dicovery_H
  22. #define __STM32F100_Dicovery_H
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. /* Includes ------------------------------------------------------------------*/
  27. #include "stm32f10x.h"
  28. /** @addtogroup Utilities
  29. * @{
  30. */
  31. /** @addtogroup STM32vldiscovery
  32. * @{
  33. */
  34. /** @defgroup STM32vldiscovery_Abstraction_Layer
  35. * @{
  36. */
  37. /** @defgroup STM32vldiscovery_HARDWARE_RESOURCES
  38. * @{
  39. */
  40. /** @defgroup STM32vldiscovery_Exported_Types
  41. * @{
  42. */
  43. typedef enum
  44. {
  45. LED3 = 0,
  46. LED4 = 1
  47. } Led_TypeDef;
  48. typedef enum
  49. {
  50. BUTTON_USER = 0
  51. } Button_TypeDef;
  52. typedef enum
  53. {
  54. BUTTON_MODE_GPIO = 0,
  55. BUTTON_MODE_EXTI = 1
  56. } ButtonMode_TypeDef;
  57. /**
  58. * @brief STM32F100 Button Defines Legacy
  59. */
  60. #define Button_USER BUTTON_USER
  61. #define Mode_GPIO BUTTON_MODE_GPIO
  62. #define Mode_EXTI BUTTON_MODE_EXTI
  63. #define Button_Mode_TypeDef ButtonMode_TypeDef
  64. /** @addtogroup STM32vldiscovery_LOW_LEVEL_LED
  65. * @{
  66. */
  67. #define LEDn 2
  68. #define LED3_PIN GPIO_Pin_9
  69. #define LED3_GPIO_PORT GPIOC
  70. #define LED3_GPIO_CLK RCC_APB2Periph_GPIOC
  71. #define LED4_PIN GPIO_Pin_8
  72. #define LED4_GPIO_PORT GPIOC
  73. #define LED4_GPIO_CLK RCC_APB2Periph_GPIOC
  74. /**
  75. * @}
  76. */
  77. /** @addtogroup STM32vldiscovery_LOW_LEVEL_BUTTON
  78. * @{
  79. */
  80. #define BUTTONn 1
  81. /* * @brief USER push-button
  82. */
  83. #define USER_BUTTON_PIN GPIO_Pin_0
  84. #define USER_BUTTON_GPIO_PORT GPIOA
  85. #define USER_BUTTON_GPIO_CLK RCC_APB2Periph_GPIOA
  86. #define USER_BUTTON_EXTI_PORT_SOURCE GPIO_PortSourceGPIOA
  87. #define USER_BUTTON_EXTI_PIN_SOURCE GPIO_PinSource0
  88. #define USER_BUTTON_EXTI_LINE EXTI_Line0
  89. #define USER_BUTTON_EXTI_IRQn EXTI0_IRQn
  90. /**
  91. * @}
  92. */
  93. /** @defgroup STM32vldiscovery_LOW_LEVEL__Exported_Functions
  94. * @{
  95. */
  96. void STM32vldiscovery_LEDInit(Led_TypeDef Led);
  97. void STM32vldiscovery_LEDOn(Led_TypeDef Led);
  98. void STM32vldiscovery_LEDOff(Led_TypeDef Led);
  99. void STM32vldiscovery_LEDToggle(Led_TypeDef Led);
  100. void STM32vldiscovery_PBInit(Button_TypeDef Button, ButtonMode_TypeDef Button_Mode);
  101. uint32_t STM32vldiscovery_PBGetState(Button_TypeDef Button);
  102. /**
  103. * @}
  104. */
  105. #ifdef __cplusplus
  106. }
  107. #endif
  108. #endif /* __STM32vldiscovery_H */
  109. /**
  110. * @}
  111. */
  112. /**
  113. * @}
  114. */
  115. /**
  116. * @}
  117. */
  118. /******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE****/