STM32F723E-Discovery BSP User Manual
|
stm32f723e_discovery.h
Go to the documentation of this file.
00001 /** 00002 ****************************************************************************** 00003 * @file stm32f723e_discovery.h 00004 * @author MCD Application Team 00005 * @brief This file contains definitions for STM32F723E-Discovery LEDs, 00006 * push-buttons hardware resources. 00007 ****************************************************************************** 00008 * @attention 00009 * 00010 * <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2> 00011 * 00012 * Redistribution and use in source and binary forms, with or without modification, 00013 * are permitted provided that the following conditions are met: 00014 * 1. Redistributions of source code must retain the above copyright notice, 00015 * this list of conditions and the following disclaimer. 00016 * 2. Redistributions in binary form must reproduce the above copyright notice, 00017 * this list of conditions and the following disclaimer in the documentation 00018 * and/or other materials provided with the distribution. 00019 * 3. Neither the name of STMicroelectronics nor the names of its contributors 00020 * may be used to endorse or promote products derived from this software 00021 * without specific prior written permission. 00022 * 00023 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00024 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00025 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00026 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 00027 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00028 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00029 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00030 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00031 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00032 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00033 * 00034 ****************************************************************************** 00035 */ 00036 00037 /* Define to prevent recursive inclusion -------------------------------------*/ 00038 #ifndef __STM32F723E_DISCOVERY_H 00039 #define __STM32F723E_DISCOVERY_H 00040 00041 #ifdef __cplusplus 00042 extern "C" { 00043 #endif 00044 00045 00046 /* Includes ------------------------------------------------------------------*/ 00047 #include "stm32f7xx_hal.h" 00048 00049 /** @addtogroup BSP 00050 * @{ 00051 */ 00052 00053 /** @addtogroup STM32F723E_DISCOVERY 00054 * @{ 00055 */ 00056 00057 /** @addtogroup STM32F723E_DISCOVERY_LOW_LEVEL 00058 * @{ 00059 */ 00060 00061 /** @defgroup STM32F723E_DISCOVERY_LOW_LEVEL_Exported_Types STM32F723E Discovery Low Level Exported Types 00062 * @{ 00063 */ 00064 00065 /** 00066 * @brief Define for STM32F723E_DISCOVERY board 00067 */ 00068 #if !defined (USE_STM32F723E_DISCO) 00069 #define USE_STM32F723E_DISCO 00070 #endif 00071 00072 /** @brief Led_TypeDef 00073 * STM32F723E_Discovery board leds definitions. 00074 */ 00075 typedef enum 00076 { 00077 LED5 = 0, 00078 LED_RED = LED5, 00079 LED6 = 1, 00080 LED_GREEN = LED6 00081 } Led_TypeDef; 00082 00083 /** @brief Button_TypeDef 00084 * STM32F723E_Discovery board Buttons definitions. 00085 */ 00086 typedef enum 00087 { 00088 BUTTON_WAKEUP = 0, 00089 } Button_TypeDef; 00090 00091 #define BUTTON_USER BUTTON_WAKEUP 00092 00093 /** @brief ButtonMode_TypeDef 00094 * STM32F723E_Discovery board Buttons Modes definitions. 00095 */ 00096 typedef enum 00097 { 00098 BUTTON_MODE_GPIO = 0, 00099 BUTTON_MODE_EXTI = 1 00100 00101 } ButtonMode_TypeDef; 00102 00103 typedef enum 00104 { 00105 PB_SET = 0, 00106 PB_RESET = !PB_SET 00107 } ButtonValue_TypeDef; 00108 00109 typedef enum 00110 { 00111 COM1 = 0, 00112 }COM_TypeDef; 00113 00114 /** @brief DISCO_Status_TypeDef 00115 * STM32F723E_DISCO board Status return possible values. 00116 */ 00117 typedef enum 00118 { 00119 DISCO_OK = 0, 00120 DISCO_ERROR = 1 00121 00122 } DISCO_Status_TypeDef; 00123 00124 /** 00125 * @} 00126 */ 00127 00128 /** @addtogroup STM32F723E_DISCOVERY_LOW_LEVEL_LED STM32F723E Discovery Low Level Led 00129 * @{ 00130 */ 00131 /* Always four leds for all revisions of Discovery boards */ 00132 #define LEDn ((uint8_t)2) 00133 00134 00135 /* 2 Leds are connected to MCU directly on PA7 and PB1 */ 00136 #define LED5_GPIO_PORT ((GPIO_TypeDef*)GPIOA) 00137 #define LED6_GPIO_PORT ((GPIO_TypeDef*)GPIOB) 00138 00139 #define LED5_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE() 00140 #define LED6_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE() 00141 00142 #define LED5_GPIO_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE() 00143 #define LED6_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE() 00144 00145 00146 #define LEDx_GPIO_CLK_ENABLE(__INDEX__) do{if((__INDEX__) == 0) LED5_GPIO_CLK_ENABLE(); else \ 00147 if((__INDEX__) == 1) LED6_GPIO_CLK_ENABLE(); \ 00148 }while(0) 00149 00150 #define LEDx_GPIO_CLK_DISABLE(__INDEX__) do{if((__INDEX__) == 0) LED5_GPIO_CLK_DISABLE(); else \ 00151 if((__INDEX__) == 1) LED6_GPIO_CLK_DISABLE(); \ 00152 }while(0) 00153 00154 #define LED5_PIN ((uint32_t)GPIO_PIN_7) 00155 #define LED6_PIN ((uint32_t)GPIO_PIN_1) 00156 00157 /** 00158 * @} 00159 */ 00160 00161 /** @addtogroup STM32F723E_DISCOVERY_LOW_LEVEL_BUTTON STM32F723E Discovery Low Level Button 00162 * @{ 00163 */ 00164 /* Only one User/Wakeup button */ 00165 #define BUTTONn ((uint8_t)1) 00166 00167 /** 00168 * @brief Wakeup push-button 00169 */ 00170 #define WAKEUP_BUTTON_PIN GPIO_PIN_0 00171 #define WAKEUP_BUTTON_GPIO_PORT GPIOA 00172 #define WAKEUP_BUTTON_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE() 00173 #define WAKEUP_BUTTON_GPIO_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE() 00174 #define WAKEUP_BUTTON_EXTI_IRQn EXTI0_IRQn 00175 00176 /* Define the USER button as an alias of the Wakeup button */ 00177 #define USER_BUTTON_PIN WAKEUP_BUTTON_PIN 00178 #define USER_BUTTON_GPIO_PORT WAKEUP_BUTTON_GPIO_PORT 00179 #define USER_BUTTON_GPIO_CLK_ENABLE() WAKEUP_BUTTON_GPIO_CLK_ENABLE() 00180 #define USER_BUTTON_GPIO_CLK_DISABLE() WAKEUP_BUTTON_GPIO_CLK_DISABLE() 00181 #define USER_BUTTON_EXTI_IRQn WAKEUP_BUTTON_EXTI_IRQn 00182 00183 #define BUTTON_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE() 00184 00185 /** 00186 * @} 00187 */ 00188 00189 /** @defgroup STM32F723E_DISCOVERY_LOW_LEVEL_Exported_Constants LOW_LEVEL Exported Constants 00190 * @{ 00191 */ 00192 /** 00193 * @brief USB OTG HS Over Current signal 00194 */ 00195 #define OTG_HS_OVER_CURRENT_PIN GPIO_PIN_10 00196 #define OTG_HS_OVER_CURRENT_PORT GPIOH 00197 #define OTG_HS_OVER_CURRENT_PORT_CLK_ENABLE() __HAL_RCC_GPIOH_CLK_ENABLE() 00198 00199 /** 00200 * @brief USB OTG FS Over Current signal 00201 */ 00202 #define OTG_FS_OVER_CURRENT_PIN GPIO_PIN_8 00203 #define OTG_FS_OVER_CURRENT_PORT GPIOC 00204 #define OTG_FS_OVER_CURRENT_PORT_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE() 00205 00206 /** 00207 * @brief TS_INT signal from TouchScreen 00208 */ 00209 #define TS_INT_PIN ((uint32_t)GPIO_PIN_9) 00210 #define TS_INT_GPIO_PORT ((GPIO_TypeDef*)GPIOI) 00211 #define TS_INT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE() 00212 #define TS_INT_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE() 00213 #define TS_INT_EXTI_IRQn EXTI9_5_IRQn 00214 00215 /** 00216 * @brief TS RESET pin 00217 */ 00218 #define TS_RESET_PIN GPIO_PIN_9 00219 #define TS_RESET_GPIO_PORT GPIOH 00220 #define TS_RESET_GPIO_CLK_ENABLE() __HAL_RCC_GPIOH_CLK_ENABLE() 00221 #define TS_RESET_GPIO_CLK_DISABLE() __HAL_RCC_GPIOH_CLK_DISABLE() 00222 #define TS_RESET_EXTI_IRQn EXTI15_10_IRQn 00223 00224 /** 00225 * @brief Definition for I2C3 Touchscreen Pins 00226 * resources (touchescreen). 00227 * Definition for I2C3 clock resources 00228 */ 00229 #define TS_I2Cx I2C3 00230 #define TS_I2Cx_CLK_ENABLE() __HAL_RCC_I2C3_CLK_ENABLE() 00231 #define TS_I2Cx_SCL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE() 00232 #define TS_I2Cx_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOH_CLK_ENABLE() 00233 00234 #define TS_I2Cx_FORCE_RESET() __HAL_RCC_I2C3_FORCE_RESET() 00235 #define TS_I2Cx_RELEASE_RESET() __HAL_RCC_I2C3_RELEASE_RESET() 00236 00237 /** @brief Definition for Touchscreen Pins 00238 */ 00239 #define TS_I2Cx_SCL_PIN GPIO_PIN_8 00240 #define TS_I2Cx_SCL_AF GPIO_AF4_I2C3 00241 #define TS_I2Cx_SCL_GPIO_PORT GPIOA 00242 #define TS_I2Cx_SDA_PIN GPIO_PIN_8 00243 #define TS_I2Cx_SDA_AF GPIO_AF4_I2C3 00244 #define TS_I2Cx_SDA_GPIO_PORT GPIOH 00245 00246 #define TS_I2Cx_EV_IRQn I2C3_EV_IRQn 00247 #define TS_I2Cx_ER_IRQn I2C3_ER_IRQn 00248 00249 /** 00250 * @brief TouchScreen FT6206 Slave I2C address 00251 */ 00252 #define TS_I2C_ADDRESS ((uint16_t)0x70) 00253 00254 /** 00255 * @} 00256 */ 00257 00258 /** @addtogroup STM32F723E_DISCOVERY_LOW_LEVEL_COM STM32F723E DISCOVERY Low Level COM 00259 * @{ 00260 */ 00261 #define COMn ((uint8_t)1) 00262 00263 /** 00264 * @brief Definition for COM port1, connected to USART2 00265 */ 00266 #define DISCOVERY_COM1 USART2 00267 #define DISCOVERY_COM1_CLK_ENABLE() __HAL_RCC_USART2_CLK_ENABLE() 00268 #define DISCOVERY_COM1_CLK_DISABLE() __HAL_RCC_USART2_CLK_DISABLE() 00269 00270 #define DISCOVERY_COM1_TX_PIN GPIO_PIN_3 00271 #define DISCOVERY_COM1_TX_GPIO_PORT GPIOA 00272 #define DISCOVERY_COM1_TX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE() 00273 #define DISCOVERY_COM1_TX_GPIO_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE() 00274 #define DISCOVERY_COM1_TX_AF GPIO_AF7_USART2 00275 00276 #define DISCOVERY_COM1_RX_PIN GPIO_PIN_2 00277 #define DISCOVERY_COM1_RX_GPIO_PORT GPIOA 00278 #define DISCOVERY_COM1_RX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE() 00279 #define DISCOVERY_COM1_RX_GPIO_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE() 00280 #define DISCOVERY_COM1_RX_AF GPIO_AF7_USART2 00281 00282 #define DISCOVERY_COM1_IRQn USART2_IRQn 00283 00284 #define DISCOVERY_COMx_CLK_ENABLE(__INDEX__) do { if((__INDEX__) == COM1) {DISCOVERY_COM1_CLK_ENABLE();} } while(0) 00285 #define DISCOVERY_COMx_CLK_DISABLE(__INDEX__) (((__INDEX__) == 0) ? DISCOVERY_COM1_CLK_DISABLE() : 0) 00286 00287 #define DISCOVERY_COMx_TX_GPIO_CLK_ENABLE(__INDEX__) do { if((__INDEX__) == COM1) {DISCOVERY_COM1_TX_GPIO_CLK_ENABLE();} } while(0) 00288 #define DISCOVERY_COMx_TX_GPIO_CLK_DISABLE(__INDEX__) (((__INDEX__) == 0) ? DISCOVERY_COM1_TX_GPIO_CLK_DISABLE() : 0) 00289 00290 #define DISCOVERY_COMx_RX_GPIO_CLK_ENABLE(__INDEX__) do { if((__INDEX__) == COM1) {DISCOVERY_COM1_RX_GPIO_CLK_ENABLE();} } while(0) 00291 #define DISCOVERY_COMx_RX_GPIO_CLK_DISABLE(__INDEX__) (((__INDEX__) == 0) ? DISCOVERY_COM1_RX_GPIO_CLK_DISABLE() : 0) 00292 00293 00294 /** 00295 * @brief Audio I2C Slave address 00296 */ 00297 #define AUDIO_I2C_ADDRESS ((uint16_t)0x34) 00298 00299 /** 00300 * @brief User can use this section to tailor I2C1 instance used and associated 00301 * resources (audio codec). 00302 * Definition for I2C1 clock resources 00303 */ 00304 #define DISCOVERY_AUDIO_I2Cx I2C1 00305 #define DISCOVERY_AUDIO_I2Cx_CLK_ENABLE() __HAL_RCC_I2C1_CLK_ENABLE() 00306 #define DISCOVERY_AUDIO_I2Cx_SCL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE() 00307 #define DISCOVERY_AUDIO_I2Cx_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE() 00308 00309 #define DISCOVERY_AUDIO_I2Cx_FORCE_RESET() __HAL_RCC_I2C1_FORCE_RESET() 00310 #define DISCOVERY_AUDIO_I2Cx_RELEASE_RESET() __HAL_RCC_I2C1_RELEASE_RESET() 00311 00312 /** @brief Definition for I2C1 Pins 00313 */ 00314 #define DISCOVERY_AUDIO_I2Cx_SCL_PIN GPIO_PIN_8 /*!< PB8 */ 00315 #define DISCOVERY_AUDIO_I2Cx_SCL_AF GPIO_AF4_I2C1 00316 #define DISCOVERY_AUDIO_I2Cx_SCL_GPIO_PORT GPIOB 00317 #define DISCOVERY_AUDIO_I2Cx_SDA_PIN GPIO_PIN_9 /*!< PB9 */ 00318 #define DISCOVERY_AUDIO_I2Cx_SDA_AF GPIO_AF4_I2C1 00319 #define DISCOVERY_AUDIO_I2Cx_SDA_GPIO_PORT GPIOB 00320 /** @brief Definition of I2C1 interrupt requests 00321 */ 00322 #define DISCOVERY_AUDIO_I2Cx_EV_IRQn I2C1_EV_IRQn 00323 #define DISCOVERY_AUDIO_I2Cx_ER_IRQn I2C1_ER_IRQn 00324 00325 00326 /* Definition for external, camera and Arduino connector I2Cx resources */ 00327 #define DISCOVERY_EXT_I2Cx I2C2 00328 #define DISCOVERY_EXT_I2Cx_CLK_ENABLE() __HAL_RCC_I2C2_CLK_ENABLE() 00329 #define DISCOVERY_EXT_DMAx_CLK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE() 00330 #define DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOH_CLK_ENABLE() 00331 00332 #define DISCOVERY_EXT_I2Cx_FORCE_RESET() __HAL_RCC_I2C2_FORCE_RESET() 00333 #define DISCOVERY_EXT_I2Cx_RELEASE_RESET() __HAL_RCC_I2C2_RELEASE_RESET() 00334 00335 /* Definition for I2Cx Pins */ 00336 #define DISCOVERY_EXT_I2Cx_SCL_PIN GPIO_PIN_4 00337 #define DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_PORT GPIOH 00338 #define DISCOVERY_EXT_I2Cx_SCL_SDA_AF GPIO_AF4_I2C2 00339 #define DISCOVERY_EXT_I2Cx_SDA_PIN GPIO_PIN_5 00340 00341 /* I2C interrupt requests */ 00342 #define DISCOVERY_EXT_I2Cx_EV_IRQn I2C2_EV_IRQn 00343 #define DISCOVERY_EXT_I2Cx_ER_IRQn I2C2_ER_IRQn 00344 00345 00346 /* I2C TIMING Register define when I2C clock source is SYSCLK */ 00347 /* I2C TIMING is calculated from APB1 source clock = 50 MHz */ 00348 /* Due to the big MOFSET capacity for adapting the camera level the rising time is very large (>1us) */ 00349 /* 0x40912732 takes in account the big rising and aims a clock of 100khz */ 00350 #ifndef DISCOVERY_I2Cx_TIMING 00351 #define DISCOVERY_I2Cx_TIMING ((uint32_t)0x40912732) 00352 #endif /* DISCOVERY_I2Cx_TIMING */ 00353 00354 00355 /** 00356 * @} 00357 */ 00358 00359 /** @defgroup STM32F723E_DISCOVERY_LOW_LEVEL_Exported_Macros STM32F723E Discovery Low Level Exported Macros 00360 * @{ 00361 */ 00362 /** 00363 * @} 00364 */ 00365 00366 /** @defgroup STM32F723E_DISCOVERY_LOW_LEVEL_Exported_Functions STM32F723E Discovery Low Level Exported Functions 00367 * @{ 00368 */ 00369 uint32_t BSP_GetVersion(void); 00370 void BSP_LED_Init(Led_TypeDef Led); 00371 void BSP_LED_DeInit(Led_TypeDef Led); 00372 void BSP_LED_On(Led_TypeDef Led); 00373 void BSP_LED_Off(Led_TypeDef Led); 00374 void BSP_LED_Toggle(Led_TypeDef Led); 00375 void BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef Button_Mode); 00376 void BSP_PB_DeInit(Button_TypeDef Button); 00377 uint32_t BSP_PB_GetState(Button_TypeDef Button); 00378 void BSP_COM_Init(COM_TypeDef COM, UART_HandleTypeDef *huart); 00379 void BSP_COM_DeInit(COM_TypeDef COM, UART_HandleTypeDef *huart); 00380 00381 /** 00382 * @} 00383 */ 00384 00385 /** 00386 * @} 00387 */ 00388 00389 /** 00390 * @} 00391 */ 00392 00393 /** 00394 * @} 00395 */ 00396 00397 /** 00398 * @} 00399 */ 00400 00401 /** 00402 * @} 00403 */ 00404 00405 #ifdef __cplusplus 00406 } 00407 #endif 00408 00409 #endif /* __STM32F723E_DISCOVERY_H */ 00410 00411 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Generated on Tue May 30 2017 13:59:12 for STM32F723E-Discovery BSP User Manual by 1.7.6.1