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