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