STM32769I_EVAL BSP User Manual
|
stm32f769i_eval.h
Go to the documentation of this file.
00001 /** 00002 ****************************************************************************** 00003 * @file stm32f769i_eval.h 00004 * @author MCD Application Team 00005 * @version V2.0.0 00006 * @date 30-December-2016 00007 * @brief This file contains definitions for STM32F769I_EVAL LEDs, 00008 * push-buttons and COM ports 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 __STM32F769I_EVAL_H 00041 #define __STM32F769I_EVAL_H 00042 00043 #ifdef __cplusplus 00044 extern "C" { 00045 #endif 00046 00047 /* Includes ------------------------------------------------------------------*/ 00048 #include "stm32f7xx_hal.h" 00049 00050 /** @addtogroup BSP 00051 * @{ 00052 */ 00053 00054 /** @addtogroup STM32F769I_EVAL 00055 * @{ 00056 */ 00057 00058 /** @addtogroup STM32F769I_EVAL_LOW_LEVEL 00059 * @{ 00060 */ 00061 00062 /** @defgroup STM32F769I_EVAL_LOW_LEVEL_Exported_Types LOW LEVEL Exported Types 00063 * @{ 00064 */ 00065 typedef enum 00066 { 00067 LED1 = 0, 00068 LED_GREEN = LED1, 00069 LED2 = 1, 00070 LED_ORANGE = LED2, 00071 LED3 = 2, 00072 LED_RED = LED3, 00073 LED4 = 3, 00074 LED_BLUE = LED4 00075 }Led_TypeDef; 00076 00077 typedef enum 00078 { 00079 BUTTON_WAKEUP = 0, 00080 BUTTON_TAMPER = 1, 00081 BUTTON_KEY = 2 00082 }Button_TypeDef; 00083 00084 typedef enum 00085 { 00086 BUTTON_MODE_GPIO = 0, 00087 BUTTON_MODE_EXTI = 1 00088 }ButtonMode_TypeDef; 00089 00090 #if defined(USE_IOEXPANDER) 00091 typedef enum 00092 { 00093 JOY_MODE_GPIO = 0, 00094 JOY_MODE_EXTI = 1 00095 }JOYMode_TypeDef; 00096 00097 typedef enum 00098 { 00099 JOY_NONE = 0, 00100 JOY_SEL = 1, 00101 JOY_DOWN = 2, 00102 JOY_LEFT = 3, 00103 JOY_RIGHT = 4, 00104 JOY_UP = 5 00105 }JOYState_TypeDef; 00106 #endif /* USE_IOEXPANDER */ 00107 00108 typedef enum 00109 { 00110 COM1 = 0, 00111 COM2 = 1 00112 }COM_TypeDef; 00113 /** 00114 * @} 00115 */ 00116 00117 /** @defgroup STM32F769I_EVAL_LOW_LEVEL_Exported_Constants LOW LEVEL Exported Constants 00118 * @{ 00119 */ 00120 00121 /** 00122 * @brief Define for STM32F769I_EVAL board 00123 */ 00124 #if !defined (USE_STM32F769I_EVAL) 00125 #define USE_STM32F769I_EVAL 00126 #endif 00127 00128 /** @addtogroup STM32F769I_EVAL_LOW_LEVEL_LED EVAL LOW LEVEL LED 00129 * @{ 00130 */ 00131 #define LEDn ((uint32_t)4) 00132 00133 #define LED1_GPIO_PORT GPIOI 00134 #define LED1_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE() 00135 #define LED1_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE() 00136 #define LED1_PIN GPIO_PIN_15 00137 00138 #define LED2_GPIO_PORT GPIOJ 00139 #define LED2_GPIO_CLK_ENABLE() __HAL_RCC_GPIOJ_CLK_ENABLE() 00140 #define LED2_GPIO_CLK_DISABLE() __HAL_RCC_GPIOJ_CLK_DISABLE() 00141 #define LED2_PIN GPIO_PIN_0 00142 00143 #define LED3_GPIO_PORT GPIOJ 00144 #define LED3_GPIO_CLK_ENABLE() __HAL_RCC_GPIOJ_CLK_ENABLE() 00145 #define LED3_GPIO_CLK_DISABLE() __HAL_RCC_GPIOJ_CLK_DISABLE() 00146 #define LED3_PIN GPIO_PIN_1 00147 00148 #define LED4_GPIO_PORT GPIOJ 00149 #define LED4_GPIO_CLK_ENABLE() __HAL_RCC_GPIOJ_CLK_ENABLE() 00150 #define LED4_GPIO_CLK_DISABLE() __HAL_RCC_GPIOJ_CLK_DISABLE() 00151 #define LED4_PIN GPIO_PIN_3 00152 00153 #define LEDx_GPIO_CLK_ENABLE(__INDEX__) do{if((__INDEX__) == 0) LED1_GPIO_CLK_ENABLE(); else \ 00154 if((__INDEX__) == 1) LED2_GPIO_CLK_ENABLE(); else \ 00155 if((__INDEX__) == 2) LED3_GPIO_CLK_ENABLE(); else \ 00156 if((__INDEX__) == 3) LED4_GPIO_CLK_ENABLE(); \ 00157 }while(0) 00158 00159 #define LEDx_GPIO_CLK_DISABLE(__INDEX__) do{if((__INDEX__) == 0) LED1_GPIO_CLK_DISABLE(); else \ 00160 if((__INDEX__) == 1) LED2_GPIO_CLK_DISABLE(); else \ 00161 if((__INDEX__) == 2) LED3_GPIO_CLK_DISABLE(); else \ 00162 if((__INDEX__) == 3) LED4_GPIO_CLK_DISABLE(); \ 00163 }while(0) 00164 00165 /** 00166 * @} 00167 */ 00168 00169 /** 00170 * @brief MFX_IRQOUt pin 00171 */ 00172 #define MFX_IRQOUT_PIN GPIO_PIN_8 00173 #define MFX_IRQOUT_GPIO_PORT GPIOI 00174 #define MFX_IRQOUT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE() 00175 #define MFX_IRQOUT_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE() 00176 #define MFX_IRQOUT_EXTI_IRQn EXTI9_5_IRQn 00177 00178 /** @addtogroup STM32F769I_EVAL_LOW_LEVEL_BUTTON LOW LEVEL BUTTON 00179 * @{ 00180 */ 00181 /* Joystick pins are connected to IO Expander (accessible through I2C1 interface) */ 00182 #define BUTTONn ((uint8_t)3) 00183 00184 /** 00185 * @brief Wakeup push-button 00186 */ 00187 #define WAKEUP_BUTTON_PIN GPIO_PIN_13 00188 #define WAKEUP_BUTTON_GPIO_PORT GPIOC 00189 #define WAKEUP_BUTTON_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE() 00190 #define WAKEUP_BUTTON_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE() 00191 #define WAKEUP_BUTTON_EXTI_IRQn EXTI15_10_IRQn 00192 00193 /** 00194 * @brief Tamper push-button 00195 */ 00196 #define TAMPER_BUTTON_PIN GPIO_PIN_13 00197 #define TAMPER_BUTTON_GPIO_PORT GPIOC 00198 #define TAMPER_BUTTON_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE() 00199 #define TAMPER_BUTTON_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE() 00200 #define TAMPER_BUTTON_EXTI_IRQn EXTI15_10_IRQn 00201 00202 /** 00203 * @brief Key push-button 00204 */ 00205 #define KEY_BUTTON_PIN GPIO_PIN_13 00206 #define KEY_BUTTON_GPIO_PORT GPIOC 00207 #define KEY_BUTTON_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE() 00208 #define KEY_BUTTON_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE() 00209 #define KEY_BUTTON_EXTI_IRQn EXTI15_10_IRQn 00210 00211 #define BUTTONx_GPIO_CLK_ENABLE(__INDEX__) do { if((__INDEX__) == 0) WAKEUP_BUTTON_GPIO_CLK_ENABLE(); else\ 00212 if((__INDEX__) == 1) TAMPER_BUTTON_GPIO_CLK_ENABLE(); else\ 00213 KEY_BUTTON_GPIO_CLK_ENABLE(); } while(0) 00214 00215 #define BUTTONx_GPIO_CLK_DISABLE(__INDEX__) (((__INDEX__) == 0) ? WAKEUP_BUTTON_GPIO_CLK_DISABLE() :\ 00216 ((__INDEX__) == 1) ? TAMPER_BUTTON_GPIO_CLK_DISABLE() : KEY_BUTTON_GPIO_CLK_DISABLE()) 00217 /** 00218 * @} 00219 */ 00220 00221 /** @addtogroup STM32F769I_EVAL_LOW_LEVEL_COM LOW LEVEL COM 00222 * @{ 00223 */ 00224 #define COMn ((uint8_t)1) 00225 00226 /** 00227 * @brief Definition for COM port1, connected to USART1 00228 */ 00229 #define EVAL_COM1 USART1 00230 #define EVAL_COM1_CLK_ENABLE() __HAL_RCC_USART1_CLK_ENABLE() 00231 #define EVAL_COM1_CLK_DISABLE() __HAL_RCC_USART1_CLK_DISABLE() 00232 00233 #define EVAL_COM1_TX_PIN GPIO_PIN_9 00234 #define EVAL_COM1_TX_GPIO_PORT GPIOA 00235 #define EVAL_COM1_TX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE() 00236 #define EVAL_COM1_TX_GPIO_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE() 00237 #define EVAL_COM1_TX_AF GPIO_AF7_USART1 00238 00239 #define EVAL_COM1_RX_PIN GPIO_PIN_10 00240 #define EVAL_COM1_RX_GPIO_PORT GPIOA 00241 #define EVAL_COM1_RX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE() 00242 #define EVAL_COM1_RX_GPIO_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE() 00243 #define EVAL_COM1_RX_AF GPIO_AF7_USART1 00244 00245 #define EVAL_COM1_IRQn USART1_IRQn 00246 00247 #define EVAL_COMx_CLK_ENABLE(__INDEX__) do { if((__INDEX__) == COM1) EVAL_COM1_CLK_ENABLE(); } while(0) 00248 #define EVAL_COMx_CLK_DISABLE(__INDEX__) (((__INDEX__) == 0) ? EVAL_COM1_CLK_DISABLE() : 0) 00249 00250 #define EVAL_COMx_TX_GPIO_CLK_ENABLE(__INDEX__) do { if((__INDEX__) == COM1) EVAL_COM1_TX_GPIO_CLK_ENABLE(); } while(0) 00251 #define EVAL_COMx_TX_GPIO_CLK_DISABLE(__INDEX__) (((__INDEX__) == 0) ? EVAL_COM1_TX_GPIO_CLK_DISABLE() : 0) 00252 00253 #define EVAL_COMx_RX_GPIO_CLK_ENABLE(__INDEX__) do { if((__INDEX__) == COM1) EVAL_COM1_RX_GPIO_CLK_ENABLE(); } while(0) 00254 #define EVAL_COMx_RX_GPIO_CLK_DISABLE(__INDEX__) (((__INDEX__) == 0) ? EVAL_COM1_RX_GPIO_CLK_DISABLE() : 0) 00255 00256 /** 00257 * @brief Definition for Potentiometer, connected to ADC3 00258 */ 00259 #define ADCx ADC3 00260 #define ADCx_CLK_ENABLE() __HAL_RCC_ADC3_CLK_ENABLE() 00261 #define ADCx_CHANNEL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE() 00262 00263 #define ADCx_FORCE_RESET() __HAL_RCC_ADC_FORCE_RESET() 00264 #define ADCx_RELEASE_RESET() __HAL_RCC_ADC_RELEASE_RESET() 00265 00266 /* Definition for ADCx Channel Pin */ 00267 #define ADCx_CHANNEL_PIN GPIO_PIN_10 00268 #define ADCx_CHANNEL_GPIO_PORT GPIOF 00269 00270 /* Definition for ADCx's Channel */ 00271 #define ADCx_CHANNEL ADC_CHANNEL_8 00272 #define SAMPLINGTIME ADC_SAMPLETIME_3CYCLES 00273 #define ADCx_POLL_TIMEOUT 10 00274 00275 /** 00276 * @brief Joystick Pins definition 00277 */ 00278 #if defined(USE_IOEXPANDER) 00279 #define JOY_SEL_PIN IO_PIN_0 00280 #define JOY_DOWN_PIN IO_PIN_1 00281 #define JOY_LEFT_PIN IO_PIN_2 00282 #define JOY_RIGHT_PIN IO_PIN_3 00283 #define JOY_UP_PIN IO_PIN_4 00284 #define JOY_NONE_PIN JOY_ALL_PINS 00285 #define JOY_ALL_PINS (IO_PIN_0 | IO_PIN_1 | IO_PIN_2 | IO_PIN_3 | IO_PIN_4) 00286 #endif /* USE_IOEXPANDER */ 00287 /** 00288 * @brief Eval Pins definition connected to MFX 00289 */ 00290 00291 #if defined(USE_IOEXPANDER) 00292 #define XSDN_PIN IO_PIN_16 00293 #define MII_INT_PIN IO_PIN_13 00294 #define RSTI_PIN IO_PIN_11 00295 #define CAM_PLUG_PIN IO_PIN_12 00296 #define TS_INT_PIN IO_PIN_14 00297 #define AUDIO_INT_PIN IO_PIN_5 00298 #define OTG_FS1_OVER_CURRENT_PIN IO_PIN_6 00299 #define OTG_FS1_POWER_SWITCH_PIN IO_PIN_7 00300 #define OTG_FS2_OVER_CURRENT_PIN IO_PIN_8 00301 #define OTG_FS2_POWER_SWITCH_PIN IO_PIN_9 00302 #define SD1_DETECT_PIN IO_PIN_15 00303 #define SD2_DETECT_PIN IO_PIN_10 00304 #define SD_DETECT_PIN SD1_DETECT_PIN 00305 #endif /* USE_IOEXPANDER */ 00306 00307 00308 /* Exported constant IO ------------------------------------------------------*/ 00309 00310 /* The MFX_I2C_ADDR input pin selects the MFX I2C device address 00311 MFX_I2C_ADDR input pin MFX I2C device address 00312 0 b: 1000 010x (0x84) 00313 1 b: 1000 011x (0x86) 00314 This input is sampled during the MFX firmware startup. */ 00315 #define IO_I2C_ADDRESS ((uint16_t)0x84) /*mfx MFX_I2C_ADDR 0*/ 00316 #define IO_I2C_ADDRESS_2 ((uint16_t)0x86) /*mfx MFX_I2C_ADDR 1*/ 00317 /** 00318 * @brief TouchScreen FT6206 Slave I2C address 1 00319 */ 00320 #define TS_I2C_ADDRESS ((uint16_t)0x54) 00321 00322 /** 00323 * @brief TouchScreen FT6336G Slave I2C address 2 00324 */ 00325 #define TS_I2C_ADDRESS_A02 ((uint16_t)0x70) 00326 #define CAMERA_I2C_ADDRESS ((uint16_t)0x5A) 00327 #define AUDIO_I2C_ADDRESS ((uint16_t)0x34) 00328 #define EEPROM_I2C_ADDRESS_A01 ((uint16_t)0xA0) 00329 #define EEPROM_I2C_ADDRESS_A02 ((uint16_t)0xA6) 00330 /* I2C clock speed configuration (in Hz) 00331 WARNING: 00332 Make sure that this define is not already declared in other files (ie. 00333 stm32f769i_eval.h file). It can be used in parallel by other modules. */ 00334 #ifndef I2C_SPEED 00335 #define I2C_SPEED ((uint32_t)100000) 00336 #endif /* I2C_SPEED */ 00337 00338 /* User can use this section to tailor I2Cx/I2Cx instance used and associated 00339 resources */ 00340 /* Definition for I2Cx clock resources */ 00341 #define EVAL_I2Cx I2C1 00342 #define EVAL_I2Cx_CLK_ENABLE() __HAL_RCC_I2C1_CLK_ENABLE() 00343 #define EVAL_DMAx_CLK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE() 00344 #define EVAL_I2Cx_SCL_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE() 00345 00346 #define EVAL_I2Cx_FORCE_RESET() __HAL_RCC_I2C1_FORCE_RESET() 00347 #define EVAL_I2Cx_RELEASE_RESET() __HAL_RCC_I2C1_RELEASE_RESET() 00348 00349 /* Definition for I2Cx Pins */ 00350 #define EVAL_I2Cx_SCL_PIN GPIO_PIN_8 00351 #define EVAL_I2Cx_SCL_SDA_GPIO_PORT GPIOB 00352 #define EVAL_I2Cx_SCL_SDA_AF GPIO_AF4_I2C1 00353 #define EVAL_I2Cx_SDA_PIN GPIO_PIN_9 00354 00355 /* I2C interrupt requests */ 00356 #define EVAL_I2Cx_EV_IRQn I2C1_EV_IRQn 00357 #define EVAL_I2Cx_ER_IRQn I2C1_ER_IRQn 00358 00359 /* I2C TIMING Register define when I2C clock source is SYSCLK */ 00360 /* I2C TIMING is calculated from APB1 source clock = 50 MHz */ 00361 /* Due to the big MOFSET capacity for adapting the camera level the rising time is very large (>1us) */ 00362 /* 0x40912732 takes in account the big rising and aims a clock of 100khz */ 00363 #ifndef EVAL_I2Cx_TIMING 00364 #define EVAL_I2Cx_TIMING ((uint32_t)0x40912732) 00365 #endif /* EVAL_I2Cx_TIMING */ 00366 00367 /** 00368 * @} 00369 */ 00370 00371 /** 00372 * @} 00373 */ 00374 00375 /** @defgroup STM32F769I_EVAL_LOW_LEVEL_Exported_Macros LOW LEVEL Exported Macros 00376 * @{ 00377 */ 00378 /** 00379 * @} 00380 */ 00381 00382 /** @defgroup STM32F769I_EVAL_LOW_LEVEL_Exported_Functions LOW LEVEL Exported Functions 00383 * @{ 00384 */ 00385 uint32_t BSP_GetVersion(void); 00386 void BSP_LED_Init(Led_TypeDef Led); 00387 void BSP_LED_DeInit(Led_TypeDef Led); 00388 void BSP_LED_On(Led_TypeDef Led); 00389 void BSP_LED_Off(Led_TypeDef Led); 00390 void BSP_LED_Toggle(Led_TypeDef Led); 00391 void BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef ButtonMode); 00392 void BSP_PB_DeInit(Button_TypeDef Button); 00393 uint32_t BSP_PB_GetState(Button_TypeDef Button); 00394 void BSP_COM_Init(COM_TypeDef COM, UART_HandleTypeDef *husart); 00395 void BSP_COM_DeInit(COM_TypeDef COM, UART_HandleTypeDef *huart); 00396 void BSP_POTENTIOMETER_Init(void); 00397 uint32_t BSP_POTENTIOMETER_GetLevel(void); 00398 #if defined(USE_IOEXPANDER) 00399 uint8_t BSP_JOY_Init(JOYMode_TypeDef JoyMode); 00400 void BSP_JOY_DeInit(void); 00401 JOYState_TypeDef BSP_JOY_GetState(void); 00402 #endif /* USE_IOEXPANDER */ 00403 00404 /** 00405 * @} 00406 */ 00407 00408 /** 00409 * @} 00410 */ 00411 00412 /** 00413 * @} 00414 */ 00415 00416 /** 00417 * @} 00418 */ 00419 00420 #ifdef __cplusplus 00421 } 00422 #endif 00423 00424 #endif /* __STM32F769I_EVAL_H */ 00425 00426 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Generated on Fri Dec 30 2016 20:55:35 for STM32769I_EVAL BSP User Manual by 1.7.6.1