BSP files for STM32H747I-Discovery Copy from ST Cube delivery
Dependents: DISCO_H747I_LCD_demo DISCO_H747I_AUDIO_demo
STM32H747I-Discovery/stm32h747i_discovery.h@3:bc403474b366, 2019-11-06 (annotated)
- Committer:
- Jerome Coutant
- Date:
- Wed Nov 06 11:32:01 2019 +0100
- Revision:
- 3:bc403474b366
- Parent:
- 0:146cf26a9bbb
Add PDM lib
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Jerome Coutant
0:146cf26a9bbb
|
1
|
/**
|
|
Jerome Coutant
0:146cf26a9bbb
|
2
|
******************************************************************************
|
|
Jerome Coutant
0:146cf26a9bbb
|
3
|
* @file stm32h747i_discovery.h
|
|
Jerome Coutant
0:146cf26a9bbb
|
4
|
* @author MCD Application Team
|
|
Jerome Coutant
0:146cf26a9bbb
|
5
|
* @brief This file contains definitions for STM32H747I-Discovery LEDs,
|
|
Jerome Coutant
0:146cf26a9bbb
|
6
|
* push-buttons hardware resources.
|
|
Jerome Coutant
0:146cf26a9bbb
|
7
|
******************************************************************************
|
|
Jerome Coutant
0:146cf26a9bbb
|
8
|
* @attention
|
|
Jerome Coutant
0:146cf26a9bbb
|
9
|
*
|
|
Jerome Coutant
0:146cf26a9bbb
|
10
|
* <h2><center>© Copyright (c) 2019 STMicroelectronics.
|
|
Jerome Coutant
0:146cf26a9bbb
|
11
|
* All rights reserved.</center></h2>
|
|
Jerome Coutant
0:146cf26a9bbb
|
12
|
*
|
|
Jerome Coutant
0:146cf26a9bbb
|
13
|
* This software component is licensed by ST under BSD 3-Clause license,
|
|
Jerome Coutant
0:146cf26a9bbb
|
14
|
* the "License"; You may not use this file except in compliance with the
|
|
Jerome Coutant
0:146cf26a9bbb
|
15
|
* License. You may obtain a copy of the License at:
|
|
Jerome Coutant
0:146cf26a9bbb
|
16
|
* opensource.org/licenses/BSD-3-Clause
|
|
Jerome Coutant
0:146cf26a9bbb
|
17
|
*
|
|
Jerome Coutant
0:146cf26a9bbb
|
18
|
******************************************************************************
|
|
Jerome Coutant
0:146cf26a9bbb
|
19
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
20
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
21
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
22
|
#ifndef __STM32H747I_DISCOVERY_H
|
|
Jerome Coutant
0:146cf26a9bbb
|
23
|
#define __STM32H747I_DISCOVERY_H
|
|
Jerome Coutant
0:146cf26a9bbb
|
24
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
25
|
#ifdef __cplusplus
|
|
Jerome Coutant
0:146cf26a9bbb
|
26
|
extern "C" {
|
|
Jerome Coutant
0:146cf26a9bbb
|
27
|
#endif
|
|
Jerome Coutant
0:146cf26a9bbb
|
28
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
29
|
/* Includes ------------------------------------------------------------------*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
30
|
#include "stm32h7xx_hal.h"
|
|
Jerome Coutant
0:146cf26a9bbb
|
31
|
#if defined(BSP_USE_CMSIS_OS)
|
|
Jerome Coutant
0:146cf26a9bbb
|
32
|
#include "cmsis_os.h"
|
|
Jerome Coutant
0:146cf26a9bbb
|
33
|
#endif
|
|
Jerome Coutant
0:146cf26a9bbb
|
34
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
35
|
/** @addtogroup BSP
|
|
Jerome Coutant
0:146cf26a9bbb
|
36
|
* @{
|
|
Jerome Coutant
0:146cf26a9bbb
|
37
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
38
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
39
|
/** @addtogroup STM32H747I_DISCOVERY
|
|
Jerome Coutant
0:146cf26a9bbb
|
40
|
* @{
|
|
Jerome Coutant
0:146cf26a9bbb
|
41
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
42
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
43
|
/** @addtogroup STM32H747I_DISCOVERY_LOW_LEVEL
|
|
Jerome Coutant
0:146cf26a9bbb
|
44
|
* @{
|
|
Jerome Coutant
0:146cf26a9bbb
|
45
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
46
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
47
|
/** @defgroup STM32H747I_DISCOVERY_LOW_LEVEL_Exported_Types Exported Types
|
|
Jerome Coutant
0:146cf26a9bbb
|
48
|
* @{
|
|
Jerome Coutant
0:146cf26a9bbb
|
49
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
50
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
51
|
/** @brief Led_TypeDef
|
|
Jerome Coutant
0:146cf26a9bbb
|
52
|
* STM32H747I_DISCOVERY board leds definitions.
|
|
Jerome Coutant
0:146cf26a9bbb
|
53
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
54
|
typedef enum
|
|
Jerome Coutant
0:146cf26a9bbb
|
55
|
{
|
|
Jerome Coutant
0:146cf26a9bbb
|
56
|
DISCO_LED1 = 0,
|
|
Jerome Coutant
0:146cf26a9bbb
|
57
|
LED_GREEN = DISCO_LED1,
|
|
Jerome Coutant
0:146cf26a9bbb
|
58
|
DISCO_LED2 = 1,
|
|
Jerome Coutant
0:146cf26a9bbb
|
59
|
LED_ORANGE = DISCO_LED2,
|
|
Jerome Coutant
0:146cf26a9bbb
|
60
|
DISCO_LED3 = 2,
|
|
Jerome Coutant
0:146cf26a9bbb
|
61
|
LED_RED = DISCO_LED3,
|
|
Jerome Coutant
0:146cf26a9bbb
|
62
|
DISCO_LED4 = 3,
|
|
Jerome Coutant
0:146cf26a9bbb
|
63
|
LED_BLUE = DISCO_LED4
|
|
Jerome Coutant
0:146cf26a9bbb
|
64
|
} Led_TypeDef;
|
|
Jerome Coutant
0:146cf26a9bbb
|
65
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
66
|
/** @brief Button_TypeDef
|
|
Jerome Coutant
0:146cf26a9bbb
|
67
|
* STM32H747I_DISCOVERY board Buttons definitions.
|
|
Jerome Coutant
0:146cf26a9bbb
|
68
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
69
|
typedef enum
|
|
Jerome Coutant
0:146cf26a9bbb
|
70
|
{
|
|
Jerome Coutant
0:146cf26a9bbb
|
71
|
BUTTON_WAKEUP = 0,
|
|
Jerome Coutant
0:146cf26a9bbb
|
72
|
} Button_TypeDef;
|
|
Jerome Coutant
0:146cf26a9bbb
|
73
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
74
|
#define BUTTON_USER BUTTON_WAKEUP
|
|
Jerome Coutant
0:146cf26a9bbb
|
75
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
76
|
/** @brief ButtonMode_TypeDef
|
|
Jerome Coutant
0:146cf26a9bbb
|
77
|
* STM32H747I_DISCOVERY board Buttons Modes definitions.
|
|
Jerome Coutant
0:146cf26a9bbb
|
78
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
79
|
typedef enum
|
|
Jerome Coutant
0:146cf26a9bbb
|
80
|
{
|
|
Jerome Coutant
0:146cf26a9bbb
|
81
|
BUTTON_MODE_GPIO = 0,
|
|
Jerome Coutant
0:146cf26a9bbb
|
82
|
BUTTON_MODE_EXTI = 1
|
|
Jerome Coutant
0:146cf26a9bbb
|
83
|
} ButtonMode_TypeDef;
|
|
Jerome Coutant
0:146cf26a9bbb
|
84
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
85
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
86
|
typedef enum
|
|
Jerome Coutant
0:146cf26a9bbb
|
87
|
{
|
|
Jerome Coutant
0:146cf26a9bbb
|
88
|
PB_SET = 0,
|
|
Jerome Coutant
0:146cf26a9bbb
|
89
|
PB_RESET = !PB_SET
|
|
Jerome Coutant
0:146cf26a9bbb
|
90
|
} ButtonValue_TypeDef;
|
|
Jerome Coutant
0:146cf26a9bbb
|
91
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
92
|
typedef enum
|
|
Jerome Coutant
0:146cf26a9bbb
|
93
|
{
|
|
Jerome Coutant
0:146cf26a9bbb
|
94
|
JOY_MODE_GPIO = 0,
|
|
Jerome Coutant
0:146cf26a9bbb
|
95
|
JOY_MODE_EXTI = 1
|
|
Jerome Coutant
0:146cf26a9bbb
|
96
|
} JOYMode_TypeDef;
|
|
Jerome Coutant
0:146cf26a9bbb
|
97
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
98
|
typedef enum
|
|
Jerome Coutant
0:146cf26a9bbb
|
99
|
{
|
|
Jerome Coutant
0:146cf26a9bbb
|
100
|
JOY_SEL = 0,
|
|
Jerome Coutant
0:146cf26a9bbb
|
101
|
JOY_DOWN = 1,
|
|
Jerome Coutant
0:146cf26a9bbb
|
102
|
JOY_LEFT = 2,
|
|
Jerome Coutant
0:146cf26a9bbb
|
103
|
JOY_RIGHT = 3,
|
|
Jerome Coutant
0:146cf26a9bbb
|
104
|
JOY_UP = 4,
|
|
Jerome Coutant
0:146cf26a9bbb
|
105
|
JOY_NONE = 5
|
|
Jerome Coutant
0:146cf26a9bbb
|
106
|
} JOYState_TypeDef;
|
|
Jerome Coutant
0:146cf26a9bbb
|
107
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
108
|
/** @brief DISCO_Status_TypeDef
|
|
Jerome Coutant
0:146cf26a9bbb
|
109
|
* STM32H747I_DISCO board Status return possible values.
|
|
Jerome Coutant
0:146cf26a9bbb
|
110
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
111
|
typedef enum
|
|
Jerome Coutant
0:146cf26a9bbb
|
112
|
{
|
|
Jerome Coutant
0:146cf26a9bbb
|
113
|
DISCO_OK = 0,
|
|
Jerome Coutant
0:146cf26a9bbb
|
114
|
DISCO_ERROR = 1
|
|
Jerome Coutant
0:146cf26a9bbb
|
115
|
} DISCO_Status_TypeDef;
|
|
Jerome Coutant
0:146cf26a9bbb
|
116
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
117
|
/**
|
|
Jerome Coutant
0:146cf26a9bbb
|
118
|
* @}
|
|
Jerome Coutant
0:146cf26a9bbb
|
119
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
120
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
121
|
/** @defgroup STM32H747I_DISCOVERY_LOW_LEVEL_Exported_Constants Exported Constants
|
|
Jerome Coutant
0:146cf26a9bbb
|
122
|
* @{
|
|
Jerome Coutant
0:146cf26a9bbb
|
123
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
124
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
125
|
/**
|
|
Jerome Coutant
0:146cf26a9bbb
|
126
|
* @brief Define for STM32H747I_DISCOVERY board
|
|
Jerome Coutant
0:146cf26a9bbb
|
127
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
128
|
#if !defined (USE_STM32H747I_DISCO)
|
|
Jerome Coutant
0:146cf26a9bbb
|
129
|
#define USE_STM32H747I_DISCO
|
|
Jerome Coutant
0:146cf26a9bbb
|
130
|
#endif
|
|
Jerome Coutant
0:146cf26a9bbb
|
131
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
132
|
#define LEDn ((uint32_t)4)
|
|
Jerome Coutant
0:146cf26a9bbb
|
133
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
134
|
#define LED1_GPIO_PORT GPIOI
|
|
Jerome Coutant
0:146cf26a9bbb
|
135
|
#define LED1_PIN GPIO_PIN_12
|
|
Jerome Coutant
0:146cf26a9bbb
|
136
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
137
|
#define LED2_GPIO_PORT GPIOI
|
|
Jerome Coutant
0:146cf26a9bbb
|
138
|
#define LED2_PIN GPIO_PIN_13
|
|
Jerome Coutant
0:146cf26a9bbb
|
139
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
140
|
#define LED3_GPIO_PORT GPIOI
|
|
Jerome Coutant
0:146cf26a9bbb
|
141
|
#define LED3_PIN GPIO_PIN_14
|
|
Jerome Coutant
0:146cf26a9bbb
|
142
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
143
|
#define LED4_GPIO_PORT GPIOI
|
|
Jerome Coutant
0:146cf26a9bbb
|
144
|
#define LED4_PIN GPIO_PIN_15
|
|
Jerome Coutant
0:146cf26a9bbb
|
145
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
146
|
#define LEDx_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
|
|
Jerome Coutant
0:146cf26a9bbb
|
147
|
#define LEDx_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE()
|
|
Jerome Coutant
0:146cf26a9bbb
|
148
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
149
|
/* Only one User/Wakeup button */
|
|
Jerome Coutant
0:146cf26a9bbb
|
150
|
#define BUTTONn ((uint8_t)1)
|
|
Jerome Coutant
0:146cf26a9bbb
|
151
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
152
|
/**
|
|
Jerome Coutant
0:146cf26a9bbb
|
153
|
* @brief Wakeup push-button
|
|
Jerome Coutant
0:146cf26a9bbb
|
154
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
155
|
#define WAKEUP_BUTTON_PIN GPIO_PIN_13
|
|
Jerome Coutant
0:146cf26a9bbb
|
156
|
#define WAKEUP_BUTTON_GPIO_PORT GPIOC
|
|
Jerome Coutant
0:146cf26a9bbb
|
157
|
#define WAKEUP_BUTTON_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
|
|
Jerome Coutant
0:146cf26a9bbb
|
158
|
#define WAKEUP_BUTTON_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE()
|
|
Jerome Coutant
0:146cf26a9bbb
|
159
|
#define WAKEUP_BUTTON_EXTI_IRQn EXTI15_10_IRQn
|
|
Jerome Coutant
0:146cf26a9bbb
|
160
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
161
|
/* Define the USER button as an alias of the Wakeup button */
|
|
Jerome Coutant
0:146cf26a9bbb
|
162
|
#define USER_BUTTON_PIN WAKEUP_BUTTON_PIN
|
|
Jerome Coutant
0:146cf26a9bbb
|
163
|
#define USER_BUTTON_GPIO_PORT WAKEUP_BUTTON_GPIO_PORT
|
|
Jerome Coutant
0:146cf26a9bbb
|
164
|
#define USER_BUTTON_GPIO_CLK_ENABLE() WAKEUP_BUTTON_GPIO_CLK_ENABLE()
|
|
Jerome Coutant
0:146cf26a9bbb
|
165
|
#define USER_BUTTON_GPIO_CLK_DISABLE() WAKEUP_BUTTON_GPIO_CLK_DISABLE()
|
|
Jerome Coutant
0:146cf26a9bbb
|
166
|
#define USER_BUTTON_EXTI_IRQn WAKEUP_BUTTON_EXTI_IRQn
|
|
Jerome Coutant
0:146cf26a9bbb
|
167
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
168
|
#define BUTTON_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
|
|
Jerome Coutant
0:146cf26a9bbb
|
169
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
170
|
#define JOYn ((uint8_t)5)
|
|
Jerome Coutant
0:146cf26a9bbb
|
171
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
172
|
/**
|
|
Jerome Coutant
0:146cf26a9bbb
|
173
|
* @brief Joystick Selection push-button
|
|
Jerome Coutant
0:146cf26a9bbb
|
174
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
175
|
#define SEL_JOY_PIN GPIO_PIN_2
|
|
Jerome Coutant
0:146cf26a9bbb
|
176
|
#define SEL_JOY_GPIO_PORT GPIOK
|
|
Jerome Coutant
0:146cf26a9bbb
|
177
|
#define SEL_JOY_GPIO_CLK_ENABLE() __HAL_RCC_GPIOK_CLK_ENABLE()
|
|
Jerome Coutant
0:146cf26a9bbb
|
178
|
#define SEL_JOY_GPIO_CLK_DISABLE() __HAL_RCC_GPIOK_CLK_DISABLE()
|
|
Jerome Coutant
0:146cf26a9bbb
|
179
|
#define SEL_JOY_EXTI_IRQn EXTI2_IRQn
|
|
Jerome Coutant
0:146cf26a9bbb
|
180
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
181
|
/**
|
|
Jerome Coutant
0:146cf26a9bbb
|
182
|
* @brief Joystick Down push-button
|
|
Jerome Coutant
0:146cf26a9bbb
|
183
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
184
|
#define DOWN_JOY_PIN GPIO_PIN_3
|
|
Jerome Coutant
0:146cf26a9bbb
|
185
|
#define DOWN_JOY_GPIO_PORT GPIOK
|
|
Jerome Coutant
0:146cf26a9bbb
|
186
|
#define DOWN_JOY_GPIO_CLK_ENABLE() __HAL_RCC_GPIOK_CLK_ENABLE()
|
|
Jerome Coutant
0:146cf26a9bbb
|
187
|
#define DOWN_JOY_GPIO_CLK_DISABLE() __HAL_RCC_GPIOK_CLK_DISABLE()
|
|
Jerome Coutant
0:146cf26a9bbb
|
188
|
#define DOWN_JOY_EXTI_IRQn EXTI3_IRQn
|
|
Jerome Coutant
0:146cf26a9bbb
|
189
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
190
|
/**
|
|
Jerome Coutant
0:146cf26a9bbb
|
191
|
* @brief Joystick Left push-button
|
|
Jerome Coutant
0:146cf26a9bbb
|
192
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
193
|
#define LEFT_JOY_PIN GPIO_PIN_4
|
|
Jerome Coutant
0:146cf26a9bbb
|
194
|
#define LEFT_JOY_GPIO_PORT GPIOK
|
|
Jerome Coutant
0:146cf26a9bbb
|
195
|
#define LEFT_JOY_GPIO_CLK_ENABLE() __HAL_RCC_GPIOK_CLK_ENABLE()
|
|
Jerome Coutant
0:146cf26a9bbb
|
196
|
#define LEFT_JOY_GPIO_CLK_DISABLE() __HAL_RCC_GPIOK_CLK_DISABLE()
|
|
Jerome Coutant
0:146cf26a9bbb
|
197
|
#define LEFT_JOY_EXTI_IRQn EXTI4_IRQn
|
|
Jerome Coutant
0:146cf26a9bbb
|
198
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
199
|
/**
|
|
Jerome Coutant
0:146cf26a9bbb
|
200
|
* @brief Joystick Right push-button
|
|
Jerome Coutant
0:146cf26a9bbb
|
201
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
202
|
#define RIGHT_JOY_PIN GPIO_PIN_5
|
|
Jerome Coutant
0:146cf26a9bbb
|
203
|
#define RIGHT_JOY_GPIO_PORT GPIOK
|
|
Jerome Coutant
0:146cf26a9bbb
|
204
|
#define RIGHT_JOY_GPIO_CLK_ENABLE() __HAL_RCC_GPIOK_CLK_ENABLE()
|
|
Jerome Coutant
0:146cf26a9bbb
|
205
|
#define RIGHT_JOY_GPIO_CLK_DISABLE() __HAL_RCC_GPIOK_CLK_DISABLE()
|
|
Jerome Coutant
0:146cf26a9bbb
|
206
|
#define RIGHT_JOY_EXTI_IRQn EXTI9_5_IRQn
|
|
Jerome Coutant
0:146cf26a9bbb
|
207
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
208
|
/**
|
|
Jerome Coutant
0:146cf26a9bbb
|
209
|
* @brief Joystick Up push-button
|
|
Jerome Coutant
0:146cf26a9bbb
|
210
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
211
|
#define UP_JOY_PIN GPIO_PIN_6
|
|
Jerome Coutant
0:146cf26a9bbb
|
212
|
#define UP_JOY_GPIO_PORT GPIOK
|
|
Jerome Coutant
0:146cf26a9bbb
|
213
|
#define UP_JOY_GPIO_CLK_ENABLE() __HAL_RCC_GPIOK_CLK_ENABLE()
|
|
Jerome Coutant
0:146cf26a9bbb
|
214
|
#define UP_JOY_GPIO_CLK_DISABLE() __HAL_RCC_GPIOK_CLK_DISABLE()
|
|
Jerome Coutant
0:146cf26a9bbb
|
215
|
#define UP_JOY_EXTI_IRQn EXTI9_5_IRQn
|
|
Jerome Coutant
0:146cf26a9bbb
|
216
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
217
|
#define JOYx_GPIO_CLK_ENABLE(__JOY__) do { if((__JOY__) == JOY_SEL) { SEL_JOY_GPIO_CLK_ENABLE(); } else \
|
|
Jerome Coutant
0:146cf26a9bbb
|
218
|
if((__JOY__) == JOY_DOWN) { DOWN_JOY_GPIO_CLK_ENABLE(); } else \
|
|
Jerome Coutant
0:146cf26a9bbb
|
219
|
if((__JOY__) == JOY_LEFT) { LEFT_JOY_GPIO_CLK_ENABLE(); } else \
|
|
Jerome Coutant
0:146cf26a9bbb
|
220
|
if((__JOY__) == JOY_RIGHT) { RIGHT_JOY_GPIO_CLK_ENABLE(); } else \
|
|
Jerome Coutant
0:146cf26a9bbb
|
221
|
if((__JOY__) == JOY_UP) { UP_JOY_GPIO_CLK_ENABLE(); } } while(0)
|
|
Jerome Coutant
0:146cf26a9bbb
|
222
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
223
|
#define JOYx_GPIO_CLK_DISABLE(__JOY__) do { if((__JOY__) == JOY_SEL) { SEL_JOY_GPIO_CLK_DISABLE(); } else \
|
|
Jerome Coutant
0:146cf26a9bbb
|
224
|
if((__JOY__) == JOY_DOWN) { DOWN_JOY_GPIO_CLK_DISABLE(); } else \
|
|
Jerome Coutant
0:146cf26a9bbb
|
225
|
if((__JOY__) == JOY_LEFT) { LEFT_JOY_GPIO_CLK_DISABLE(); } else \
|
|
Jerome Coutant
0:146cf26a9bbb
|
226
|
if((__JOY__) == JOY_RIGHT) { RIGHT_JOY_GPIO_CLK_DISABLE(); } else \
|
|
Jerome Coutant
0:146cf26a9bbb
|
227
|
if((__JOY__) == JOY_UP) { UP_JOY_GPIO_CLK_DISABLE(); } } while(0)
|
|
Jerome Coutant
0:146cf26a9bbb
|
228
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
229
|
#define JOY_ALL_PINS (RIGHT_JOY_PIN | LEFT_JOY_PIN | UP_JOY_PIN | DOWN_JOY_PIN | SEL_JOY_PIN)
|
|
Jerome Coutant
0:146cf26a9bbb
|
230
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
231
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
232
|
/**
|
|
Jerome Coutant
0:146cf26a9bbb
|
233
|
* @brief USB OTG HS Over Current signal
|
|
Jerome Coutant
0:146cf26a9bbb
|
234
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
235
|
#define OTG_HS_OVER_CURRENT_PIN GPIO_PIN_1
|
|
Jerome Coutant
0:146cf26a9bbb
|
236
|
#define OTG_HS_OVER_CURRENT_PORT GPIOJ
|
|
Jerome Coutant
0:146cf26a9bbb
|
237
|
#define OTG_HS_OVER_CURRENT_PORT_CLK_ENABLE() __HAL_RCC_GPIOJ_CLK_ENABLE()
|
|
Jerome Coutant
0:146cf26a9bbb
|
238
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
239
|
/**
|
|
Jerome Coutant
0:146cf26a9bbb
|
240
|
* @brief SD-detect signal
|
|
Jerome Coutant
0:146cf26a9bbb
|
241
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
242
|
#define SD_DETECT_PIN ((uint32_t)GPIO_PIN_8)
|
|
Jerome Coutant
0:146cf26a9bbb
|
243
|
#define SD_DETECT_GPIO_PORT ((GPIO_TypeDef*)GPIOI)
|
|
Jerome Coutant
0:146cf26a9bbb
|
244
|
#define SD_DETECT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
|
|
Jerome Coutant
0:146cf26a9bbb
|
245
|
#define SD_DETECT_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE()
|
|
Jerome Coutant
0:146cf26a9bbb
|
246
|
#define SD_DETECT_EXTI_IRQn EXTI9_5_IRQn
|
|
Jerome Coutant
0:146cf26a9bbb
|
247
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
248
|
/**
|
|
Jerome Coutant
0:146cf26a9bbb
|
249
|
* @brief TS_INT signal from TouchScreen when it is configured in interrupt mode
|
|
Jerome Coutant
0:146cf26a9bbb
|
250
|
* GPIOI13 is used for that purpose on Manta Dragon Discovery board
|
|
Jerome Coutant
0:146cf26a9bbb
|
251
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
252
|
#define TS_INT_PIN ((uint32_t)GPIO_PIN_7)
|
|
Jerome Coutant
0:146cf26a9bbb
|
253
|
#define TS_INT_GPIO_PORT ((GPIO_TypeDef*)GPIOK)
|
|
Jerome Coutant
0:146cf26a9bbb
|
254
|
#define TS_INT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOK_CLK_ENABLE()
|
|
Jerome Coutant
0:146cf26a9bbb
|
255
|
#define TS_INT_GPIO_CLK_DISABLE() __HAL_RCC_GPIOK_CLK_DISABLE()
|
|
Jerome Coutant
0:146cf26a9bbb
|
256
|
#define TS_INT_EXTI_IRQn EXTI9_5_IRQn
|
|
Jerome Coutant
0:146cf26a9bbb
|
257
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
258
|
/**
|
|
Jerome Coutant
0:146cf26a9bbb
|
259
|
* @brief TouchScreen FT6206 Slave I2C address 1
|
|
Jerome Coutant
0:146cf26a9bbb
|
260
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
261
|
#define TS_I2C_ADDRESS ((uint16_t)0x54)
|
|
Jerome Coutant
0:146cf26a9bbb
|
262
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
263
|
/**
|
|
Jerome Coutant
0:146cf26a9bbb
|
264
|
* @brief TouchScreen FT6336G Slave I2C address 2
|
|
Jerome Coutant
0:146cf26a9bbb
|
265
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
266
|
#define TS_I2C_ADDRESS_A02 ((uint16_t)0x70)
|
|
Jerome Coutant
0:146cf26a9bbb
|
267
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
268
|
/**
|
|
Jerome Coutant
0:146cf26a9bbb
|
269
|
* @brief LCD DSI Slave I2C address 1
|
|
Jerome Coutant
0:146cf26a9bbb
|
270
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
271
|
#define LCD_DSI_ADDRESS TS_I2C_ADDRESS
|
|
Jerome Coutant
0:146cf26a9bbb
|
272
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
273
|
/**
|
|
Jerome Coutant
0:146cf26a9bbb
|
274
|
* @brief LCD DSI Slave I2C address 2
|
|
Jerome Coutant
0:146cf26a9bbb
|
275
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
276
|
#define LCD_DSI_ADDRESS_A02 TS_I2C_ADDRESS_A02
|
|
Jerome Coutant
0:146cf26a9bbb
|
277
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
278
|
/**
|
|
Jerome Coutant
0:146cf26a9bbb
|
279
|
* @brief Audio I2C Slave address
|
|
Jerome Coutant
0:146cf26a9bbb
|
280
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
281
|
#define AUDIO_I2C_ADDRESS ((uint16_t)0x34)
|
|
Jerome Coutant
0:146cf26a9bbb
|
282
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
283
|
#define CAMERA_I2C_ADDRESS ((uint16_t)0x60)
|
|
Jerome Coutant
0:146cf26a9bbb
|
284
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
285
|
/**
|
|
Jerome Coutant
0:146cf26a9bbb
|
286
|
* @brief User can use this section to tailor I2C4/I2C4 instance used and associated
|
|
Jerome Coutant
0:146cf26a9bbb
|
287
|
* resources (audio codec).
|
|
Jerome Coutant
0:146cf26a9bbb
|
288
|
* Definition for I2C4 clock resources
|
|
Jerome Coutant
0:146cf26a9bbb
|
289
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
290
|
#define DISCOVERY_I2Cx I2C4
|
|
Jerome Coutant
0:146cf26a9bbb
|
291
|
#define DISCOVERY_I2Cx_CLK_ENABLE() __HAL_RCC_I2C4_CLK_ENABLE()
|
|
Jerome Coutant
0:146cf26a9bbb
|
292
|
#define DISCOVERY_I2Cx_SCL_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
|
|
Jerome Coutant
0:146cf26a9bbb
|
293
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
294
|
#define DISCOVERY_I2Cx_FORCE_RESET() __HAL_RCC_I2C4_FORCE_RESET()
|
|
Jerome Coutant
0:146cf26a9bbb
|
295
|
#define DISCOVERY_I2Cx_RELEASE_RESET() __HAL_RCC_I2C4_RELEASE_RESET()
|
|
Jerome Coutant
0:146cf26a9bbb
|
296
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
297
|
/** @brief Definition for I2C4 Pins
|
|
Jerome Coutant
0:146cf26a9bbb
|
298
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
299
|
#define DISCOVERY_I2Cx_SCL_PIN GPIO_PIN_12 /*!< PD12 */
|
|
Jerome Coutant
0:146cf26a9bbb
|
300
|
#define DISCOVERY_I2Cx_SDA_PIN GPIO_PIN_13 /*!< PD13 */
|
|
Jerome Coutant
0:146cf26a9bbb
|
301
|
#define DISCOVERY_I2Cx_SCL_SDA_AF GPIO_AF4_I2C4
|
|
Jerome Coutant
0:146cf26a9bbb
|
302
|
#define DISCOVERY_I2Cx_SCL_SDA_GPIO_PORT GPIOD
|
|
Jerome Coutant
0:146cf26a9bbb
|
303
|
/** @brief Definition of I2C4 interrupt requests
|
|
Jerome Coutant
0:146cf26a9bbb
|
304
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
305
|
#define DISCOVERY_I2Cx_EV_IRQn I2C4_EV_IRQn
|
|
Jerome Coutant
0:146cf26a9bbb
|
306
|
#define DISCOVERY_I2Cx_ER_IRQn I2C4_ER_IRQn
|
|
Jerome Coutant
0:146cf26a9bbb
|
307
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
308
|
/* I2C TIMING Register define when I2C clock source is SYSCLK */
|
|
Jerome Coutant
0:146cf26a9bbb
|
309
|
/* I2C TIMING is calculated from APB1 source clock = 50 MHz */
|
|
Jerome Coutant
0:146cf26a9bbb
|
310
|
/* Due to the big MOFSET capacity for adapting the camera level the rising time is very large (>1us) */
|
|
Jerome Coutant
0:146cf26a9bbb
|
311
|
/* 0x40912732 takes in account the big rising and aims a clock of 100khz */
|
|
Jerome Coutant
0:146cf26a9bbb
|
312
|
#ifndef DISCOVERY_I2Cx_TIMING
|
|
Jerome Coutant
0:146cf26a9bbb
|
313
|
#define DISCOVERY_I2Cx_TIMING ((uint32_t)0x40912732)
|
|
Jerome Coutant
0:146cf26a9bbb
|
314
|
#endif /* DISCOVERY_I2Cx_TIMING */
|
|
Jerome Coutant
0:146cf26a9bbb
|
315
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
316
|
/**
|
|
Jerome Coutant
0:146cf26a9bbb
|
317
|
* @}
|
|
Jerome Coutant
0:146cf26a9bbb
|
318
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
319
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
320
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
321
|
/** @addtogroup STM32H747I_DISCOVERY_LOW_LEVEL_Exported_Functions
|
|
Jerome Coutant
0:146cf26a9bbb
|
322
|
* @{
|
|
Jerome Coutant
0:146cf26a9bbb
|
323
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
324
|
uint32_t BSP_GetVersion(void);
|
|
Jerome Coutant
0:146cf26a9bbb
|
325
|
void BSP_LED_Init(Led_TypeDef Led);
|
|
Jerome Coutant
0:146cf26a9bbb
|
326
|
void BSP_LED_DeInit(Led_TypeDef Led);
|
|
Jerome Coutant
0:146cf26a9bbb
|
327
|
void BSP_LED_On(Led_TypeDef Led);
|
|
Jerome Coutant
0:146cf26a9bbb
|
328
|
void BSP_LED_Off(Led_TypeDef Led);
|
|
Jerome Coutant
0:146cf26a9bbb
|
329
|
void BSP_LED_Toggle(Led_TypeDef Led);
|
|
Jerome Coutant
0:146cf26a9bbb
|
330
|
void BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef Button_Mode);
|
|
Jerome Coutant
0:146cf26a9bbb
|
331
|
void BSP_PB_DeInit(Button_TypeDef Button);
|
|
Jerome Coutant
0:146cf26a9bbb
|
332
|
uint32_t BSP_PB_GetState(Button_TypeDef Button);
|
|
Jerome Coutant
0:146cf26a9bbb
|
333
|
uint8_t BSP_JOY_Init(JOYMode_TypeDef Joy_Mode);
|
|
Jerome Coutant
0:146cf26a9bbb
|
334
|
void BSP_JOY_DeInit(void);
|
|
Jerome Coutant
0:146cf26a9bbb
|
335
|
JOYState_TypeDef BSP_JOY_GetState(void);
|
|
Jerome Coutant
0:146cf26a9bbb
|
336
|
void BSP_ErrorNotify(void);
|
|
Jerome Coutant
0:146cf26a9bbb
|
337
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
338
|
/**
|
|
Jerome Coutant
0:146cf26a9bbb
|
339
|
* @}
|
|
Jerome Coutant
0:146cf26a9bbb
|
340
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
341
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
342
|
/**
|
|
Jerome Coutant
0:146cf26a9bbb
|
343
|
* @}
|
|
Jerome Coutant
0:146cf26a9bbb
|
344
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
345
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
346
|
/**
|
|
Jerome Coutant
0:146cf26a9bbb
|
347
|
* @}
|
|
Jerome Coutant
0:146cf26a9bbb
|
348
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
349
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
350
|
/**
|
|
Jerome Coutant
0:146cf26a9bbb
|
351
|
* @}
|
|
Jerome Coutant
0:146cf26a9bbb
|
352
|
*/
|
|
Jerome Coutant
0:146cf26a9bbb
|
353
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
354
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
355
|
#ifdef __cplusplus
|
|
Jerome Coutant
0:146cf26a9bbb
|
356
|
}
|
|
Jerome Coutant
0:146cf26a9bbb
|
357
|
#endif
|
|
Jerome Coutant
0:146cf26a9bbb
|
358
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
359
|
#endif /* __STM32H747I_DISCOVERY_H */
|
|
Jerome Coutant
0:146cf26a9bbb
|
360
|
|
|
Jerome Coutant
0:146cf26a9bbb
|
361
|
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
|