STM32469I-Discovery BSP User Manual: stm32469i_discovery.h Source File

STM32469I-Discovery BSP Drivers

stm32469i_discovery.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32469i_discovery.h
00004   * @author  MCD Application Team
00005   * @version V2.0.0
00006   * @date    31-January-2017
00007   * @brief   This file contains definitions for STM32469I-Discovery LEDs,
00008   *          push-buttons hardware resources.
00009   ******************************************************************************
00010   * @attention
00011   *
00012   * <h2><center>&copy; COPYRIGHT(c) 2017 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 __STM32469I_DISCOVERY_H
00041 #define __STM32469I_DISCOVERY_H
00042 
00043 #ifdef __cplusplus
00044  extern "C" {
00045 #endif
00046 
00047 
00048  /* Includes ------------------------------------------------------------------*/
00049 #include "stm32f4xx_hal.h"
00050 
00051 /** @addtogroup BSP
00052   * @{
00053   */
00054 
00055 /** @addtogroup STM32469I_Discovery
00056   * @{
00057   */
00058 
00059 /** @addtogroup STM32469I_Discovery_LOW_LEVEL 
00060   * @{
00061   */
00062 
00063 /** @defgroup STM32469I_Discovery_LOW_LEVEL_Exported_Types STM32469I Discovery LOW LEVEL Exported Types
00064  * @{
00065  */
00066 
00067 /** @brief Led_TypeDef
00068   *  STM32469I_Discovery board leds definitions.
00069   */
00070 typedef enum
00071 {
00072  LED1 = 0,
00073  LED_GREEN = LED1,
00074  LED2 = 1,
00075  LED_ORANGE = LED2,
00076  LED3 = 2,
00077  LED_RED = LED3,
00078  LED4 = 3,
00079  LED_BLUE = LED4
00080 
00081 } Led_TypeDef;
00082 
00083 /** @brief Button_TypeDef
00084   *  STM32469I_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   *  STM32469I_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 /** @addtogroup Exported_types
00104   * @{
00105   */ 
00106 typedef enum 
00107 {
00108   PB_SET = 0, 
00109   PB_RESET = !PB_SET
00110 } ButtonValue_TypeDef;
00111 
00112 
00113 /** @brief DISCO_Status_TypeDef
00114   *  STM32469I_DISCO board Status return possible values.
00115   */
00116 typedef enum
00117 {
00118  DISCO_OK    = 0,
00119  DISCO_ERROR = 1
00120 
00121 } DISCO_Status_TypeDef;
00122 
00123 /**
00124   * @}
00125   */
00126   
00127 /**
00128   * @}
00129   */
00130 
00131 /** @defgroup STM32469I_Discovery_LOW_LEVEL_Exported_Constants STM32469I Discovery LOW LEVEL Exported Constants
00132   * @{
00133   */
00134 
00135 
00136 /** @defgroup STM32469I_Discovery_LOW_LEVEL_LED STM32469I Discovery LOW LEVEL LED
00137   * @{
00138   */
00139 /* Always four leds for all revisions of Discovery boards */
00140 #define LEDn                             ((uint8_t)4)
00141 
00142 
00143 /* 4 Leds are connected to MCU directly on PG6, PD4, PD5, PK3 */
00144 #define LED1_GPIO_PORT                   ((GPIO_TypeDef*)GPIOG)
00145 #define LED2_GPIO_PORT                   ((GPIO_TypeDef*)GPIOD)
00146 #define LED3_GPIO_PORT                   ((GPIO_TypeDef*)GPIOD)
00147 #define LED4_GPIO_PORT                   ((GPIO_TypeDef*)GPIOK)
00148 
00149 #define LED1_GPIO_CLK_ENABLE()           __HAL_RCC_GPIOG_CLK_ENABLE()
00150 #define LED1_GPIO_CLK_DISABLE()          __HAL_RCC_GPIOG_CLK_DISABLE()
00151 #define LED2_GPIO_CLK_ENABLE()           __HAL_RCC_GPIOD_CLK_ENABLE()
00152 #define LED2_GPIO_CLK_DISABLE()          __HAL_RCC_GPIOD_CLK_DISABLE()
00153 #define LED3_GPIO_CLK_ENABLE()           __HAL_RCC_GPIOD_CLK_ENABLE()
00154 #define LED3_GPIO_CLK_DISABLE()          __HAL_RCC_GPIOD_CLK_DISABLE()
00155 #define LED4_GPIO_CLK_ENABLE()           __HAL_RCC_GPIOK_CLK_ENABLE()
00156 #define LED4_GPIO_CLK_DISABLE()          __HAL_RCC_GPIOK_CLK_DISABLE()
00157 
00158 #define LED1_PIN                         ((uint32_t)GPIO_PIN_6)
00159 #define LED2_PIN                         ((uint32_t)GPIO_PIN_4)
00160 #define LED3_PIN                         ((uint32_t)GPIO_PIN_5)
00161 #define LED4_PIN                         ((uint32_t)GPIO_PIN_3)
00162 /**
00163   * @}
00164   */
00165 
00166 /** @addtogroup STM32469I_Discovery_LOW_LEVEL_BUTTON STM32469I Discovery LOW LEVEL BUTTON
00167   * @{
00168   */
00169 /* Only one User/Wakeup button */
00170 #define BUTTONn                             ((uint8_t)1)
00171 
00172 /**
00173   * @brief Wakeup push-button
00174   */
00175 #define WAKEUP_BUTTON_PIN                   GPIO_PIN_0
00176 #define WAKEUP_BUTTON_GPIO_PORT             GPIOA
00177 #define WAKEUP_BUTTON_GPIO_CLK_ENABLE()     __HAL_RCC_GPIOA_CLK_ENABLE()
00178 #define WAKEUP_BUTTON_GPIO_CLK_DISABLE()    __HAL_RCC_GPIOA_CLK_DISABLE()
00179 #define WAKEUP_BUTTON_EXTI_IRQn             EXTI0_IRQn
00180 
00181 /* Define the USER button as an alias of the Wakeup button */
00182 #define USER_BUTTON_PIN                   WAKEUP_BUTTON_PIN
00183 #define USER_BUTTON_GPIO_PORT             WAKEUP_BUTTON_GPIO_PORT
00184 #define USER_BUTTON_GPIO_CLK_ENABLE()     WAKEUP_BUTTON_GPIO_CLK_ENABLE()
00185 #define USER_BUTTON_GPIO_CLK_DISABLE()    WAKEUP_BUTTON_GPIO_CLK_DISABLE()
00186 #define USER_BUTTON_EXTI_IRQn             WAKEUP_BUTTON_EXTI_IRQn
00187 
00188 #define BUTTON_GPIO_CLK_ENABLE()            __HAL_RCC_GPIOA_CLK_ENABLE()
00189 
00190 /**
00191   * @}
00192   */
00193 
00194 /**
00195   * @brief OTG_FS1 OVER_CURRENT and POWER_SWITCH Pins definition
00196   */
00197 #define AUDIO_INT_PIN                  GPIO_PIN_7
00198 #define AUDIO_INT_PORT                 GPIOB
00199 #define AUDIO_INT_PORT_CLK_ENABLE()     __HAL_RCC_GPIOB_CLK_ENABLE()
00200 
00201 #define OTG_FS1_OVER_CURRENT_PIN                  GPIO_PIN_7
00202 #define OTG_FS1_OVER_CURRENT_PORT                 GPIOB
00203 #define OTG_FS1_OVER_CURRENT_PORT_CLK_ENABLE()     __HAL_RCC_GPIOB_CLK_ENABLE()
00204 
00205 #define OTG_FS1_POWER_SWITCH_PIN                  GPIO_PIN_2
00206 #define OTG_FS1_POWER_SWITCH_PORT                 GPIOB
00207 #define OTG_FS1_POWER_SWITCH_PORT_CLK_ENABLE()     __HAL_RCC_GPIOB_CLK_ENABLE()
00208 
00209 /**
00210   * @brief SD-detect signal
00211   */
00212 #define SD_DETECT_PIN                        ((uint32_t)GPIO_PIN_2)
00213 #define SD_DETECT_GPIO_PORT                  ((GPIO_TypeDef*)GPIOG)
00214 #define SD_DETECT_GPIO_CLK_ENABLE()          __HAL_RCC_GPIOG_CLK_ENABLE()
00215 #define SD_DETECT_GPIO_CLK_DISABLE()         __HAL_RCC_GPIOG_CLK_DISABLE()
00216 #define SD_DETECT_EXTI_IRQn                  EXTI2_IRQn
00217 
00218 /**
00219   * @brief TS_INT signal from TouchScreen when it is configured in interrupt mode
00220   */
00221 #define TS_INT_PIN                        ((uint32_t)GPIO_PIN_5)
00222 #define TS_INT_GPIO_PORT                  ((GPIO_TypeDef*)GPIOJ)
00223 #define TS_INT_GPIO_CLK_ENABLE()          __HAL_RCC_GPIOJ_CLK_ENABLE()
00224 #define TS_INT_GPIO_CLK_DISABLE()         __HAL_RCC_GPIOJ_CLK_DISABLE()
00225 #define TS_INT_EXTI_IRQn                  EXTI9_5_IRQn
00226 
00227 /**
00228   * @brief TouchScreen FT6206 Slave I2C address 1
00229   */
00230 #define TS_I2C_ADDRESS                   ((uint16_t)0x54)
00231 
00232 /**
00233   * @brief TouchScreen FT6336G Slave I2C address 2
00234   */
00235 #define TS_I2C_ADDRESS_A02               ((uint16_t)0x70)
00236 
00237 
00238 /**
00239   * @brief Audio I2C Slave address
00240   */
00241 #define AUDIO_I2C_ADDRESS                ((uint16_t)0x94)
00242 
00243 /**
00244   * @brief EEPROM I2C Slave address 1
00245   */
00246 #define EEPROM_I2C_ADDRESS_A01           ((uint16_t)0xA0)
00247 
00248 /**
00249   * @brief EEPROM I2C Slave address 2
00250   */
00251 #define EEPROM_I2C_ADDRESS_A02           ((uint16_t)0xA6)
00252 
00253 /**
00254   * @brief I2C clock speed configuration (in Hz)
00255   * WARNING:
00256   * Make sure that this define is not already declared in other files
00257   * It can be used in parallel by other modules.
00258   */
00259 #ifndef I2C1_SCL_FREQ_KHZ
00260 #define I2C1_SCL_FREQ_KHZ                  400000 /*!< f(I2C_SCL) = 400 kHz */
00261 #endif /* I2C1_SCL_FREQ_KHZ */
00262 
00263 /**
00264   * @brief User can use this section to tailor I2C1/I2C1 instance used and associated
00265   * resources.
00266   * Definition for I2C1 clock resources
00267   */
00268 #define DISCO_I2C1                             I2C1
00269 #define DISCO_I2C1_CLK_ENABLE()                __HAL_RCC_I2C1_CLK_ENABLE()
00270 #define DISCO_DMAx_CLK_ENABLE()                __HAL_RCC_DMA1_CLK_ENABLE()
00271 #define DISCO_I2C1_SCL_SDA_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOB_CLK_ENABLE()
00272 
00273 #define DISCO_I2C1_FORCE_RESET()               __HAL_RCC_I2C1_FORCE_RESET()
00274 #define DISCO_I2C1_RELEASE_RESET()             __HAL_RCC_I2C1_RELEASE_RESET()
00275 
00276 /** @brief Definition for I2C1 Pins
00277   */
00278 #define DISCO_I2C1_SCL_PIN                     GPIO_PIN_8 /*!< PB8 */
00279 #define DISCO_I2C1_SCL_SDA_GPIO_PORT           GPIOB
00280 #define DISCO_I2C1_SCL_SDA_AF                  GPIO_AF4_I2C1
00281 #define DISCO_I2C1_SDA_PIN                     GPIO_PIN_9 /*!< PB9 */
00282 
00283 /** @brief Definition of I2C interrupt requests
00284   */
00285 #define DISCO_I2C1_EV_IRQn                     I2C1_EV_IRQn
00286 #define DISCO_I2C1_ER_IRQn                     I2C1_ER_IRQn
00287 
00288 
00289 
00290 /**
00291   * @brief I2C2 clock speed configuration (in Hz)
00292   * WARNING:
00293   * Make sure that this define is not already declared in other files
00294   * It can be used in parallel by other modules.
00295   */
00296 #ifndef I2C2_SCL_FREQ_KHZ
00297 #define I2C2_SCL_FREQ_KHZ                  100000 /*!< f(I2C2_SCL) < 100 kHz */
00298 #endif /* I2C2_SCL_FREQ_KHZ */
00299 
00300 /**
00301   * @brief User can use this section to tailor I2C2/I2C2 instance used and associated
00302   * resources (audio codec).
00303   * Definition for I2C2 clock resources
00304   */
00305 #define DISCO_I2C2                             I2C2
00306 #define DISCO_I2C2_CLK_ENABLE()                __HAL_RCC_I2C2_CLK_ENABLE()
00307 #define DISCO_I2C2_SCL_SDA_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOH_CLK_ENABLE()
00308 
00309 #define DISCO_I2C2_FORCE_RESET()               __HAL_RCC_I2C2_FORCE_RESET()
00310 #define DISCO_I2C2_RELEASE_RESET()             __HAL_RCC_I2C2_RELEASE_RESET()
00311 
00312 /** @brief Definition for I2C2 Pins
00313   */
00314 #define DISCO_I2C2_SCL_PIN                     GPIO_PIN_4 /*!< PH4 */
00315 #define DISCO_I2C2_SCL_SDA_GPIO_PORT           GPIOH
00316 #define DISCO_I2C2_SCL_SDA_AF                  GPIO_AF4_I2C2
00317 #define DISCO_I2C2_SDA_PIN                     GPIO_PIN_5 /*!< PH5 */
00318 
00319 /** @brief Definition of I2C2 interrupt requests
00320   */
00321 #define DISCO_I2C2_EV_IRQn                     I2C2_EV_IRQn
00322 #define DISCO_I2C2_ER_IRQn                     I2C2_ER_IRQn
00323 
00324 
00325 /**
00326   * @}
00327   */
00328 
00329 /** @defgroup STM32469I_Discovery_LOW_LEVEL_Exported_Macros STM32469I Discovery LOW LEVEL Exported Macros
00330   * @{
00331   */
00332 /**
00333   * @}
00334   */
00335 
00336 /** @defgroup STM32469I_Discovery_LOW_LEVEL_Exported_Functions STM32469I Discovery LOW LEVEL Exported Functions
00337   * @{
00338   */
00339 uint32_t         BSP_GetVersion(void);
00340 void             BSP_LED_Init(Led_TypeDef Led);
00341 void             BSP_LED_DeInit(Led_TypeDef Led);
00342 void             BSP_LED_On(Led_TypeDef Led);
00343 void             BSP_LED_Off(Led_TypeDef Led);
00344 void             BSP_LED_Toggle(Led_TypeDef Led);
00345 void             BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef Button_Mode);
00346 void             BSP_PB_DeInit(Button_TypeDef Button);
00347 uint32_t         BSP_PB_GetState(Button_TypeDef Button);
00348 
00349 /**
00350   * @}
00351   */
00352 
00353 /**
00354   * @}
00355   */
00356 
00357 /**
00358   * @}
00359   */
00360 
00361 /**
00362   * @}
00363   */
00364 
00365 
00366 #ifdef __cplusplus
00367 }
00368 #endif
00369 
00370 #endif /* __STM32469I_DISCOVERY_H */
00371 
00372 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Generated on Fri Jan 13 2017 11:00:15 for STM32469I-Discovery BSP User Manual by   doxygen 1.7.6.1