STM32L4R9I_EVAL BSP User Manual: stm32l4r9i_eval.h Source File

STM32L4R9I_EVAL BSP

stm32l4r9i_eval.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32l4r9i_eval.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains definitions for STM32L4R9I_EVAL's LEDs,
00006   *          push-buttons and COM ports hardware resources.
00007   ******************************************************************************
00008   * @attention
00009   *
00010   * <h2><center>&copy; COPYRIGHT(c) 2017 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 __STM32L4R9I_EVAL_H
00039 #define __STM32L4R9I_EVAL_H
00040 
00041 #ifdef __cplusplus
00042  extern "C" {
00043 #endif
00044 
00045 /**
00046   * @brief  Define for STM32L4R9I_EVAL board
00047   */
00048 
00049 /* Includes ------------------------------------------------------------------*/
00050 #include "stm32l4xx_hal.h"
00051 #include "stm32l4r9i_eval_io.h"
00052 #if defined(BSP_USE_CMSIS_OS)
00053 #include "cmsis_os.h"
00054 #endif
00055 
00056 /** @addtogroup BSP
00057   * @{
00058   */
00059 
00060 /** @addtogroup STM32L4R9I_EVAL
00061   * @{
00062   */
00063 
00064 
00065 /** @addtogroup STM32L4R9I_EVAL_Common
00066   * @{
00067   */
00068 
00069 /** @defgroup STM32L4R9I_EVAL_Exported_Types Exported Types
00070   * @{
00071   */
00072 
00073 /**
00074  * @brief LED Types Definition
00075  */
00076 typedef enum
00077 {
00078   LED1 = 0,
00079   LED_GREEN  = LED1,
00080 
00081   LED2 = 1,
00082   LED_ORANGE = LED2,
00083 
00084   LED3 = 2,
00085   LED_RED    = LED3,
00086 
00087   LED4 = 3,
00088   LED_BLUE   = LED4
00089 
00090 }Led_TypeDef;
00091 
00092 /**
00093  * @brief BUTTON Types Definition
00094  */
00095 typedef enum
00096 {
00097   BUTTON_WAKEUP = 0,
00098   BUTTON_SEL   = 1,
00099   BUTTON_LEFT  = 2,
00100   BUTTON_RIGHT = 3,
00101   BUTTON_DOWN  = 4,
00102   BUTTON_UP    = 5
00103 
00104 }Button_TypeDef;
00105 
00106 typedef enum
00107 {
00108   BUTTON_MODE_GPIO = 0,
00109   BUTTON_MODE_EXTI = 1
00110 
00111 }ButtonMode_TypeDef;
00112 
00113 /**
00114  * @brief JOYSTICK Types Definition
00115  */
00116 typedef enum
00117 {
00118   JOY_SEL   = 0,
00119   JOY_LEFT  = 1,
00120   JOY_RIGHT = 2,
00121   JOY_DOWN  = 3,
00122   JOY_UP    = 4,
00123   JOY_NONE  = 5
00124 
00125 }JOYState_TypeDef;
00126 
00127 typedef enum
00128 {
00129   JOY_MODE_GPIO = 0,
00130   JOY_MODE_EXTI = 1
00131 
00132 }JOYMode_TypeDef;
00133 
00134 /**
00135  * @brief COM Types Definition
00136  */
00137 typedef enum
00138 {
00139   COM1 = 0
00140 
00141 }COM_TypeDef;
00142 
00143 /**
00144   * @}
00145   */
00146 
00147 /** @defgroup STM32L4R9I_EVAL_Exported_Constants Exported Constants
00148   * @{
00149   */
00150 
00151 /** @defgroup STM32L4R9I_EVAL_LED LED Constants
00152   * @{
00153   */
00154 #define LEDn                             4
00155 
00156 #define LED1_PIN                         GPIO_PIN_15
00157 #define LED1_GPIO_PORT                   GPIOB
00158 #define LED1_GPIO_CLK_ENABLE()           __HAL_RCC_GPIOB_CLK_ENABLE()
00159 #define LED1_GPIO_CLK_DISABLE()          __HAL_RCC_GPIOB_CLK_DISABLE()
00160 
00161 #define LED2_PIN                         GPIO_PIN_13
00162 #define LED2_GPIO_PORT                   GPIOH
00163 #define LED2_GPIO_CLK_ENABLE()           __HAL_RCC_GPIOH_CLK_ENABLE()
00164 #define LED2_GPIO_CLK_DISABLE()          __HAL_RCC_GPIOH_CLK_DISABLE()
00165 
00166 #define LED3_PIN                         GPIO_PIN_14
00167 #define LED3_GPIO_PORT                   GPIOH
00168 #define LED3_GPIO_CLK_ENABLE()           __HAL_RCC_GPIOH_CLK_ENABLE()
00169 #define LED3_GPIO_CLK_DISABLE()          __HAL_RCC_GPIOH_CLK_DISABLE()
00170 
00171 #define LED4_PIN                         GPIO_PIN_15
00172 #define LED4_GPIO_PORT                   GPIOH
00173 #define LED4_GPIO_CLK_ENABLE()           __HAL_RCC_GPIOH_CLK_ENABLE()
00174 #define LED4_GPIO_CLK_DISABLE()          __HAL_RCC_GPIOH_CLK_DISABLE()
00175 
00176 #define LEDx_GPIO_CLK_ENABLE(__LED__)    do { if((__LED__) == LED1) { __HAL_RCC_GPIOB_CLK_ENABLE(); } else \
00177                                               __HAL_RCC_GPIOH_CLK_ENABLE(); } while(0)
00178 
00179 #define LEDx_GPIO_CLK_DISABLE(__LED__)   do { if((__LED__) == LED1) { __HAL_RCC_GPIOB_CLK_DISABLE(); } else \
00180                                               __HAL_RCC_GPIOH_CLK_DISABLE(); } while(0)
00181 /**
00182   * @}
00183   */
00184 
00185 /** @defgroup STM32L4R9I_EVAL_BUTTON  BUTTON Constants
00186   * @{
00187   */
00188 #define JOYn                             5
00189 #define BUTTONn                          1 + JOYn
00190 
00191 /**
00192  * @brief Wakeup/Tamper push-button
00193  */
00194 #define WAKEUP_BUTTON_PIN                GPIO_PIN_13
00195 #define WAKEUP_BUTTON_GPIO_PORT          GPIOC
00196 #define WAKEUP_BUTTON_GPIO_CLK_ENABLE()  __HAL_RCC_GPIOC_CLK_ENABLE()
00197 #define WAKEUP_BUTTON_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE()
00198 #define WAKEUP_BUTTON_EXTI_IRQn          EXTI15_10_IRQn
00199 
00200 #define BUTTONx_GPIO_CLK_ENABLE(__BUTTON__)     do { if((__BUTTON__) == BUTTON_WAKEUP) { WAKEUP_BUTTON_GPIO_CLK_ENABLE(); } } while(0)
00201 
00202 #define BUTTONx_GPIO_CLK_DISABLE(__BUTTON__)    do { if((__BUTTON__) == BUTTON_WAKEUP) { WAKEUP_BUTTON_GPIO_CLK_DISABLE(); } } while(0)
00203 
00204 
00205 /**********************************************************/
00206 /* The joystick buttons are accessed thru the IO Expander */
00207 /**********************************************************/
00208 
00209 /**
00210  * @brief Joystick Sel push-button
00211  */
00212 #define SEL_JOY_PIN                      IO_PIN_0
00213 #define SEL_JOY_EXTI_IRQn                EXTI0_IRQn
00214 
00215 /**
00216  * @brief Joystick Down push-button
00217  */
00218 #if defined(USE_STM32L4R9I_EVAL_REVA)
00219 /* Hide Joystick 180� rotation misplacement */
00220 #define DOWN_JOY_PIN                     IO_PIN_4
00221 #else
00222 #define DOWN_JOY_PIN                     IO_PIN_1
00223 #endif
00224 
00225 #define DOWN_JOY_EXTI_IRQn               EXTI0_IRQn
00226 
00227 /**
00228  * @brief Joystick Left push-button
00229  */
00230 #if defined(USE_STM32L4R9I_EVAL_REVA)
00231 /* Hide Joystick 180� rotation misplacement */
00232 #define LEFT_JOY_PIN                     IO_PIN_3
00233 #else
00234 #define LEFT_JOY_PIN                     IO_PIN_2
00235 #endif
00236 
00237 #define LEFT_JOY_EXTI_IRQn               EXTI0_IRQn
00238 
00239 /**
00240  * @brief Joystick Right push-button
00241  */
00242 #if defined(USE_STM32L4R9I_EVAL_REVA)
00243 /* Hide Joystick 180� rotation misplacement */
00244 #define RIGHT_JOY_PIN                    IO_PIN_2
00245 #else
00246 #define RIGHT_JOY_PIN                    IO_PIN_3
00247 #endif
00248 
00249 #define RIGHT_JOY_EXTI_IRQn              EXTI0_IRQn
00250 
00251 /**
00252  * @brief Joystick Up push-button
00253  */
00254 #if defined(USE_STM32L4R9I_EVAL_REVA)
00255 /* Hide Joystick 180� rotation misplacement */
00256 #define UP_JOY_PIN                       IO_PIN_1
00257 #else
00258 #define UP_JOY_PIN                       IO_PIN_4
00259 #endif
00260 
00261 #define UP_JOY_EXTI_IRQn                 EXTI0_IRQn
00262 
00263 
00264 #define JOY_ALL_PINS                     (RIGHT_JOY_PIN | LEFT_JOY_PIN | UP_JOY_PIN | DOWN_JOY_PIN | SEL_JOY_PIN)
00265 #define JOY_NONE_PIN                     JOY_ALL_PINS
00266 
00267 /**
00268   * @}
00269   */
00270 
00271 /** @defgroup STM32L4R9I_EVAL_COM  COM Constants
00272   * @{
00273   */
00274 #define COMn                                    1
00275 
00276 /**
00277  * @brief Definition for COM port1, connected to USART1
00278  */
00279 #define EVAL_COM1                               LPUART1
00280 #define EVAL_COM1_CLK_ENABLE()                  __HAL_RCC_LPUART1_CLK_ENABLE()
00281 #define EVAL_COM1_CLK_DISABLE()                 __HAL_RCC_LPUART1_CLK_DISABLE()
00282 
00283 #define EVAL_COM1_TX_PIN                        GPIO_PIN_7
00284 #define EVAL_COM1_TX_GPIO_PORT                  GPIOG
00285 #define EVAL_COM1_TX_GPIO_CLK_ENABLE()          __HAL_RCC_GPIOG_CLK_ENABLE()
00286 #define EVAL_COM1_TX_GPIO_CLK_DISABLE()         __HAL_RCC_GPIOG_CLK_DISABLE()
00287 #define EVAL_COM1_TX_AF                         GPIO_AF8_LPUART1
00288 
00289 #define EVAL_COM1_RX_PIN                        GPIO_PIN_8
00290 #define EVAL_COM1_RX_GPIO_PORT                  GPIOG
00291 #define EVAL_COM1_RX_GPIO_CLK_ENABLE()          __HAL_RCC_GPIOG_CLK_ENABLE()
00292 #define EVAL_COM1_RX_GPIO_CLK_DISABLE()         __HAL_RCC_GPIOG_CLK_DISABLE()
00293 #define EVAL_COM1_RX_AF                         GPIO_AF8_LPUART1
00294 
00295 #define EVAL_COM1_IRQn                          LPUART1_IRQn
00296 
00297 #define COMx_CLK_ENABLE(__INDEX__)              do { if((__INDEX__) == COM1) { EVAL_COM1_CLK_ENABLE(); } } while(0)
00298 #define COMx_CLK_DISABLE(__INDEX__)             do { if((__INDEX__) == COM1) { EVAL_COM1_CLK_DISABLE(); } } while(0)
00299 
00300 #define COMx_TX_GPIO_CLK_ENABLE(__INDEX__)      do { if((__INDEX__) == COM1) { EVAL_COM1_TX_GPIO_CLK_ENABLE(); } } while(0)
00301 #define COMx_TX_GPIO_CLK_DISABLE(__INDEX__)     do { if((__INDEX__) == COM1) { EVAL_COM1_TX_GPIO_CLK_DISABLE(); } } while(0)
00302 
00303 #define COMx_RX_GPIO_CLK_ENABLE(__INDEX__)      do { if((__INDEX__) == COM1) { EVAL_COM1_RX_GPIO_CLK_ENABLE(); } } while(0)
00304 #define COMx_RX_GPIO_CLK_DISABLE(__INDEX__)     do { if((__INDEX__) == COM1) { EVAL_COM1_RX_GPIO_CLK_DISABLE(); } } while(0)
00305 
00306 /**
00307   * @}
00308   */
00309 
00310 #ifdef HAL_ADC_MODULE_ENABLED
00311 
00312 /** @defgroup STM32L4R9I_EVAL_POTENTIOMETER  POTENTIOMETER Constants
00313   * @{
00314   */
00315 /**
00316  * @brief  Potentiometer Status values
00317  */
00318 #define BSP_POTENTIOMETER_OK       0x00
00319 #define BSP_POTENTIOMETER_ERROR    0xFF
00320 
00321 /**
00322  * @brief Definition for Potentiometer, connected to ADC1
00323  */
00324 #define ADCx                            ADC1
00325 #define ADCx_CLK_ENABLE()               __HAL_RCC_ADC_CLK_ENABLE()
00326 #define ADCx_CHANNEL_GPIO_CLK_ENABLE()  __HAL_RCC_GPIOA_CLK_ENABLE()
00327 
00328 #define ADCx_FORCE_RESET()              __HAL_RCC_ADC_FORCE_RESET()
00329 #define ADCx_RELEASE_RESET()            __HAL_RCC_ADC_RELEASE_RESET()
00330 
00331 /* Definition for ADCx Channel Pin */
00332 #define ADCx_CHANNEL_PIN                GPIO_PIN_0
00333 #define ADCx_CHANNEL_GPIO_PORT          GPIOA
00334 
00335 /* Definition for ADCx's Channel */
00336 #define ADCx_CHANNEL                    ADC_CHANNEL_5
00337 #define SAMPLINGTIME                    ADC_SAMPLETIME_3CYCLES
00338 #define ADCx_POLL_TIMEOUT               10
00339 
00340 #endif /* HAL_ADC_MODULE_ENABLED */
00341 
00342 /**
00343  * @brief Definition for Potentiometer connected to OPAMP
00344  */
00345 /* Definition for OPAMPx Pins */
00346 #define OPAMPx_INP_PIN                  GPIO_PIN_0
00347 #define OPAMPx_INP_GPIO_PORT            GPIOA
00348 #define OPAMPx_INM_PIN                  GPIO_PIN_1
00349 #define OPAMPx_INM_GPIO_PORT            GPIOA
00350 #define OPAMPx_VOUT_PIN                 GPIO_PIN_3
00351 #define OPAMPx_VOUT_GPIO_PORT           GPIOA
00352 
00353 #define OPAMPx                          OPAMP
00354 #define OPAMPx_CLK_ENABLE()             __HAL_RCC_OPAMP_CLK_ENABLE()
00355 #define OPAMPx_CLK_DISABLE()            __HAL_RCC_OPAMP_CLK_DISABLE()
00356 #define OPAMPx_GPIO_CLK_ENABLE()        __HAL_RCC_GPIOA_CLK_ENABLE()
00357 #define OPAMPx_GPIO_CLK_DISABLE()       __HAL_RCC_GPIOA_CLK_DISABLE()
00358 
00359 #define OPAMPx_FORCE_RESET()            __HAL_RCC_OPAMP_FORCE_RESET()
00360 #define OPAMPx_RELEASE_RESET()          __HAL_RCC_OPAMP_RELEASE_RESET()
00361 
00362 /**
00363   * @brief Eval Pins definition connected to MFX
00364   */
00365 
00366 #define DSI_RST_PIN                    IO_PIN_9
00367 #define EXT_RST_PIN                    IO_PIN_8
00368 #define LCD_DISP_PIN                   IO_PIN_11
00369 #define LCD_RST_PIN                    IO_PIN_12
00370 #define OTG_FS_POWER_SWITCH_PIN        IO_PIN_6
00371 #define OTG_FS_OVER_CURRENT_PIN        IO_PIN_7
00372 #define SD_DETECT_PIN                  IO_PIN_5
00373 #define SWIRE_PIN                      IO_PIN_13
00374 
00375 /**
00376   * @}
00377   */
00378 
00379 /** @defgroup STM32L4R9I_EVAL_BUS  BUS Constants
00380   * @{
00381   */
00382 /* Exported constant IO ------------------------------------------------------*/
00383 /*##################### I2Cx ###################################*/
00384 /* User can use this section to tailor I2Cx instance used and associated
00385    resources */
00386 /* Definition for I2Cx Pins */
00387 #define EVAL_I2Cx_SCL_PIN                       GPIO_PIN_4
00388 #define EVAL_I2Cx_SCL_GPIO_PORT                 GPIOH
00389 #define EVAL_I2Cx_SDA_PIN                       GPIO_PIN_5
00390 #define EVAL_I2Cx_SDA_GPIO_PORT                 GPIOH
00391 #define EVAL_I2Cx_SCL_SDA_AF                    GPIO_AF4_I2C2
00392 
00393 /* Definition for I2Cx clock resources */
00394 #define EVAL_I2Cx                               I2C2
00395 #define EVAL_I2Cx_CLK_ENABLE()                  __HAL_RCC_I2C2_CLK_ENABLE()
00396 #define EVAL_I2Cx_CLK_DISABLE()                 __HAL_RCC_I2C2_CLK_DISABLE()
00397 #define EVAL_I2Cx_SDA_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOH_CLK_ENABLE()
00398 #define EVAL_I2Cx_SDA_GPIO_CLK_DISABLE()        __HAL_RCC_GPIOH_CLK_DISABLE()
00399 #define EVAL_I2Cx_SCL_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOH_CLK_ENABLE()
00400 #define EVAL_I2Cx_SCL_GPIO_CLK_DISABLE()        __HAL_RCC_GPIOH_CLK_DISABLE()
00401 
00402 #define EVAL_I2Cx_FORCE_RESET()                 __HAL_RCC_I2C2_FORCE_RESET()
00403 #define EVAL_I2Cx_RELEASE_RESET()               __HAL_RCC_I2C2_RELEASE_RESET()
00404 
00405 /* Definition for I2Cx's NVIC */
00406 #define EVAL_I2Cx_EV_IRQn                       I2C2_EV_IRQn
00407 #define EVAL_I2Cx_EV_IRQHandler                 I2C2_EV_IRQHandler
00408 #define EVAL_I2Cx_ER_IRQn                       I2C2_ER_IRQn
00409 #define EVAL_I2Cx_ER_IRQHandler                 I2C2_ER_IRQHandler
00410 
00411 /* I2C clock setting */
00412 #define EVAL_RCC_PERIPHCLK_I2C                  RCC_PERIPHCLK_I2C2
00413 #define EVAL_RCC_CLKSOURCE_I2C                  RCC_I2C2CLKSOURCE_SYSCLK
00414 
00415 /* I2C TIMING Register define when I2C clock source is SYSCLK */
00416 /* I2C TIMING is calculated in case of the I2C Clock source is the SYSCLK = 120 MHz */
00417 /* Set 0xC080242F value to reach 100 KHz speed (Rise time = 640ns, Fall time = 20ns) */
00418 #ifndef EVAL_I2Cx_TIMING
00419  #define EVAL_I2Cx_TIMING                       0xC080242F
00420 #endif /* EVAL_I2Cx_TIMING */
00421 
00422 
00423 /* Definition for TS (Capacitive Touch Panel) I2Cx resources */
00424 #define EVAL_TS_I2Cx                            I2C2
00425 #define EVAL_TS_I2Cx_CLK_ENABLE()               __HAL_RCC_I2C2_CLK_ENABLE()
00426 #define EVAL_TS_DMAx_CLK_ENABLE()               __HAL_RCC_DMA1_CLK_ENABLE()
00427 #define EVAL_TS_I2Cx_SDA_GPIO_CLK_ENABLE()      __HAL_RCC_GPIOH_CLK_ENABLE()
00428 #define EVAL_TS_I2Cx_SDA_GPIO_CLK_DISABLE()     __HAL_RCC_GPIOH_CLK_DISABLE()
00429 #define EVAL_TS_I2Cx_SCL_GPIO_CLK_ENABLE()      __HAL_RCC_GPIOH_CLK_ENABLE()
00430 #define EVAL_TS_I2Cx_SCL_GPIO_CLK_DISABLE()     __HAL_RCC_GPIOH_CLK_DISABLE()
00431 
00432 #define EVAL_TS_I2Cx_FORCE_RESET()              __HAL_RCC_I2C2_FORCE_RESET()
00433 #define EVAL_TS_I2Cx_RELEASE_RESET()            __HAL_RCC_I2C2_RELEASE_RESET()
00434 
00435 /* Definition for I2Cx Pins */
00436 #define EVAL_TS_I2Cx_SCL_PIN                    GPIO_PIN_4
00437 #define EVAL_TS_I2Cx_SCL_GPIO_PORT              GPIOH
00438 #define EVAL_TS_I2Cx_SDA_PIN                    GPIO_PIN_5
00439 #define EVAL_TS_I2Cx_SDA_GPIO_PORT              GPIOH
00440 #define EVAL_TS_I2Cx_SCL_SDA_AF                 GPIO_AF4_I2C2
00441 
00442 /* I2C interrupt requests */
00443 #define EVAL_TS_I2Cx_EV_IRQn                    I2C2_EV_IRQn
00444 #define EVAL_TS_I2Cx_ER_IRQn                    I2C2_ER_IRQn
00445 
00446 /* I2C clock setting */
00447 #define EVAL_TS_RCC_PERIPHCLK_I2C               RCC_PERIPHCLK_I2C2
00448 #define EVAL_TS_RCC_CLKSOURCE_I2C               RCC_I2C2CLKSOURCE_SYSCLK
00449 
00450 
00451 /* Exported constantIO -------------------------------------------------------*/
00452 
00453 #define EEPROM_I2C_ADDRESS                      0xA0
00454 
00455 /* I2C clock speed configuration (in Hz)
00456    WARNING:
00457    Make sure that this define is not already declared in other files (ie.
00458    stm324xg_eval.h file). It can be used in parallel by other modules. */
00459 #ifndef BSP_I2C_SPEED
00460  #define BSP_I2C_SPEED                          100000
00461 #endif /* BSP_I2C_SPEED */
00462 
00463 
00464 #define IO_I2C_ADDRESS                          0x84
00465 #define IDD_I2C_ADDRESS                         IO_I2C_ADDRESS
00466 #define AUDIO_I2C_ADDRESS                       0x34
00467 #define LCD_RGB_I2C_ADDRESS                     0x70
00468 #define TS_RGB_I2C_ADDRESS                      0x70
00469 #define TS_DSI_I2C_ADDRESS                      0x70
00470 
00471 /* Maximum Timeout values for flags waiting loops. These timeouts are not based
00472    on accurate values, they just guarantee that the application will not remain
00473    stuck if the I2C communication is corrupted.
00474    You may modify these timeout values depending on CPU frequency and application
00475    conditions (interrupts routines ...). */
00476 #define EVAL_I2Cx_TIMEOUT_MAX                   3000
00477 
00478 
00479 /*##################### Audio Codec ##########################*/
00480 /* Audio INT Pin definition */
00481 #define AUDIO_INT_GPIO_PORT               GPIOI                      /* GPIOI */
00482 #define AUDIO_INT_GPIO_CLK_ENABLE()       __HAL_RCC_GPIOI_CLK_ENABLE()
00483 #define AUDIO_INT_GPIO_CLK_DISABLE()      __HAL_RCC_GPIOI_CLK_DISABLE()
00484 #define AUDIO_INT_PIN                     GPIO_PIN_6                 /* PI.06 */
00485 
00486 
00487 /*##################### MFX #################################*/
00488 /**
00489   * @brief  MFX interface pins
00490   */
00491 #define MFX_INT_GPIO_PORT                 GPIOA                       /* GPIOA */
00492 #define MFX_INT_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOA_CLK_ENABLE()
00493 #define MFX_INT_GPIO_CLK_DISABLE()        __HAL_RCC_GPIOA_CLK_DISABLE()
00494 #define MFX_INT_PIN                       GPIO_PIN_0                  /* PA.00 */
00495 #define MFX_INT_EXTI_IRQn                 EXTI0_IRQn
00496 
00497 #define MFX_WAKEUP_GPIO_PORT              GPIOG                       /* GPIOG */
00498 #define MFX_WAKEUP_GPIO_CLK_ENABLE()      __HAL_RCC_GPIOG_CLK_ENABLE()
00499 #define MFX_WAKEUP_GPIO_CLK_DISABLE()     __HAL_RCC_GPIOG_CLK_DISABLE()
00500 #define MFX_WAKEUP_PIN                    GPIO_PIN_9                  /* PG.09 */
00501 
00502 /* Legacy  */
00503 #define IDD_INT_GPIO_PORT                 MFX_INT_GPIO_PORT
00504 #define IDD_INT_GPIO_CLK_ENABLE()         MFX_INT_GPIO_CLK_ENABLE()
00505 #define IDD_INT_GPIO_CLK_DISABLE()        MFX_INT_GPIO_CLK_DISABLE()
00506 #define IDD_INT_PIN                       MFX_INT_PIN
00507 #define IDD_INT_EXTI_IRQn                 MFX_INT_EXTI_IRQn
00508 #define IDD_WAKEUP_GPIO_PORT              MFX_WAKEUP_GPIO_PORT
00509 #define IDD_WAKEUP_GPIO_CLK_ENABLE()      MFX_WAKEUP_GPIO_CLK_ENABLE()
00510 #define IDD_WAKEUP_GPIO_CLK_DISABLE()     MFX_WAKEUP_GPIO_CLK_DISABLE()
00511 #define IDD_WAKEUP_PIN                    MFX_WAKEUP_PIN
00512 
00513 /**
00514   * @brief  Idd current measurement interface pins on MFX
00515   */
00516 #define IDD_AMP_CONTROL_PIN               AGPIO_PIN_1
00517 
00518 /*##################### LCD ##########################*/
00519 
00520 /** MB1314 DSI **/
00521 
00522 /* DSI TE pin */
00523 #define LCD_DSI_TE_PIN                       GPIO_PIN_6
00524 #define LCD_DSI_TE_CTRL_GPIO_PORT            GPIOG
00525 #define LCD_DSI_TE_CTRL_GPIO_CLK_ENABLE()    __HAL_RCC_GPIOG_CLK_ENABLE()
00526 #define LCD_DSI_TE_CTRL_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOG_CLK_DISABLE()
00527 
00528 /* Backlight control pin */
00529 #define LCD_DSI_BL_CTRL_PIN                  GPIO_PIN_14
00530 #define LCD_DSI_BL_CTRL_GPIO_PORT            GPIOB
00531 #define LCD_DSI_BL_CTRL_GPIO_CLK_ENABLE()    __HAL_RCC_GPIOB_CLK_ENABLE()
00532 #define LCD_DSI_BL_CTRL_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOB_CLK_DISABLE()
00533 
00534 /* DSI TS INT pin */
00535 #define TS_DSI_INT_PIN                       GPIO_PIN_2
00536 #define TS_DSI_INT_GPIO_PORT                 GPIOC
00537 #define TS_DSI_INT_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOC_CLK_ENABLE()
00538 #define TS_DSI_INT_GPIO_CLK_DISABLE()        __HAL_RCC_GPIOC_CLK_DISABLE()
00539 #define TS_DSI_INT_EXTI_IRQn                 EXTI2_IRQn
00540 
00541 
00542 /** MB1315 RGB **/
00543 
00544 /* Display enable pin */
00545 #define LCD_RGB_DISP_PIN                     IO_PIN_11   /* MFX_GPIO11 */
00546 
00547 /* Display enable pin */
00548 #define LCD_RGB_RST_PIN                      IO_PIN_12   /* MFX_GPIO12 */
00549 
00550 /* Backlight control pin */
00551 #define LCD_RGB_BL_CTRL_PIN                  GPIO_PIN_5
00552 #define LCD_RGB_BL_CTRL_GPIO_PORT            GPIOA
00553 #define LCD_RGB_BL_CTRL_GPIO_CLK_ENABLE()    __HAL_RCC_GPIOA_CLK_ENABLE()
00554 #define LCD_RGB_BL_CTRL_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOA_CLK_DISABLE()
00555 
00556 /* RGB TS INT pin */
00557 #define TS_RGB_INT_PIN                       GPIO_PIN_2
00558 #define TS_RGB_INT_GPIO_PORT                 GPIOC
00559 #define TS_RGB_INT_GPIO_CLK_ENABLE()         __HAL_RCC_GPIOC_CLK_ENABLE()
00560 #define TS_RGB_INT_GPIO_CLK_DISABLE()        __HAL_RCC_GPIOC_CLK_DISABLE()
00561 #define TS_RGB_INT_EXTI_IRQn                 EXTI2_IRQn
00562 
00563 /**
00564   * @}
00565   */
00566 
00567 /**
00568   * @}
00569   */
00570 
00571 /** @defgroup STM32L4R9I_EVAL_Exported_Functions Exported Functions
00572   * @{
00573   */
00574 uint32_t         BSP_GetVersion(void);
00575 void             BSP_LED_Init(Led_TypeDef Led);
00576 void             BSP_LED_DeInit(Led_TypeDef Led);
00577 void             BSP_LED_On(Led_TypeDef Led);
00578 void             BSP_LED_Off(Led_TypeDef Led);
00579 void             BSP_LED_Toggle(Led_TypeDef Led);
00580 void             BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef ButtonMode);
00581 void             BSP_PB_DeInit(Button_TypeDef Button);
00582 uint32_t         BSP_PB_GetState(Button_TypeDef Button);
00583 #if defined(HAL_UART_MODULE_ENABLED)
00584 void             BSP_COM_Init(COM_TypeDef COM, UART_HandleTypeDef* huart);
00585 void             BSP_COM_DeInit(COM_TypeDef COM, UART_HandleTypeDef *huart);
00586 #endif /* HAL_UART_MODULE_ENABLED */
00587 #ifdef HAL_ADC_MODULE_ENABLED
00588 uint32_t         BSP_POTENTIOMETER_Init(void);
00589 uint32_t         BSP_POTENTIOMETER_DeInit(void);
00590 uint32_t         BSP_POTENTIOMETER_GetLevel(void);
00591 #endif /* HAL_ADC_MODULE_ENABLED */
00592 uint8_t          BSP_JOY_Init(JOYMode_TypeDef JoyMode);
00593 void             BSP_JOY_DeInit(void);
00594 JOYState_TypeDef BSP_JOY_GetState(void);
00595 
00596 /* These __weak functions can be surcharged by application code for specific application needs */
00597 void             BSP_ErrorHandler(void);
00598 
00599 /**
00600   * @}
00601   */
00602 
00603 /**
00604   * @}
00605   */
00606 
00607 /**
00608   * @}
00609   */
00610 
00611 /**
00612   * @}
00613   */
00614 
00615 #ifdef __cplusplus
00616 }
00617 #endif
00618 
00619 #endif /* __STM32L4R9I_EVAL_H */
00620 
00621 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Generated on Thu Oct 12 2017 10:53:59 for STM32L4R9I_EVAL BSP User Manual by   doxygen 1.7.6.1