STM32L4R9I_EVAL BSP User Manual: stm32l4r9i_eval.h File Reference

STM32L4R9I_EVAL BSP

stm32l4r9i_eval.h File Reference

This file contains definitions for STM32L4R9I_EVAL's LEDs, push-buttons and COM ports hardware resources. More...

#include "stm32l4xx_hal.h" #include "stm32l4r9i_eval_io.h"

Go to the source code of this file.

Defines

#define LEDn   4
#define LED1_PIN   GPIO_PIN_15
#define LED1_GPIO_PORT   GPIOB
#define LED1_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOB_CLK_ENABLE()
#define LED1_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOB_CLK_DISABLE()
#define LED2_PIN   GPIO_PIN_13
#define LED2_GPIO_PORT   GPIOH
#define LED2_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOH_CLK_ENABLE()
#define LED2_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOH_CLK_DISABLE()
#define LED3_PIN   GPIO_PIN_14
#define LED3_GPIO_PORT   GPIOH
#define LED3_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOH_CLK_ENABLE()
#define LED3_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOH_CLK_DISABLE()
#define LED4_PIN   GPIO_PIN_15
#define LED4_GPIO_PORT   GPIOH
#define LED4_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOH_CLK_ENABLE()
#define LED4_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOH_CLK_DISABLE()
#define LEDx_GPIO_CLK_ENABLE(__LED__)
#define LEDx_GPIO_CLK_DISABLE(__LED__)
#define JOYn   5
#define BUTTONn   1 + JOYn
#define WAKEUP_BUTTON_PIN   GPIO_PIN_13
 Wakeup/Tamper push-button.
#define WAKEUP_BUTTON_GPIO_PORT   GPIOC
#define WAKEUP_BUTTON_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOC_CLK_ENABLE()
#define WAKEUP_BUTTON_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOC_CLK_DISABLE()
#define WAKEUP_BUTTON_EXTI_IRQn   EXTI15_10_IRQn
#define BUTTONx_GPIO_CLK_ENABLE(__BUTTON__)   do { if((__BUTTON__) == BUTTON_WAKEUP) { WAKEUP_BUTTON_GPIO_CLK_ENABLE(); } } while(0)
#define BUTTONx_GPIO_CLK_DISABLE(__BUTTON__)   do { if((__BUTTON__) == BUTTON_WAKEUP) { WAKEUP_BUTTON_GPIO_CLK_DISABLE(); } } while(0)
#define SEL_JOY_PIN   IO_PIN_0
 Joystick Sel push-button.
#define SEL_JOY_EXTI_IRQn   EXTI0_IRQn
#define DOWN_JOY_PIN   IO_PIN_1
 Joystick Down push-button.
#define DOWN_JOY_EXTI_IRQn   EXTI0_IRQn
#define LEFT_JOY_PIN   IO_PIN_2
 Joystick Left push-button.
#define LEFT_JOY_EXTI_IRQn   EXTI0_IRQn
#define RIGHT_JOY_PIN   IO_PIN_3
 Joystick Right push-button.
#define RIGHT_JOY_EXTI_IRQn   EXTI0_IRQn
#define UP_JOY_PIN   IO_PIN_4
 Joystick Up push-button.
#define UP_JOY_EXTI_IRQn   EXTI0_IRQn
#define JOY_ALL_PINS   (RIGHT_JOY_PIN | LEFT_JOY_PIN | UP_JOY_PIN | DOWN_JOY_PIN | SEL_JOY_PIN)
#define JOY_NONE_PIN   JOY_ALL_PINS
#define COMn   1
#define EVAL_COM1   LPUART1
 Definition for COM port1, connected to USART1.
#define EVAL_COM1_CLK_ENABLE()   __HAL_RCC_LPUART1_CLK_ENABLE()
#define EVAL_COM1_CLK_DISABLE()   __HAL_RCC_LPUART1_CLK_DISABLE()
#define EVAL_COM1_TX_PIN   GPIO_PIN_7
#define EVAL_COM1_TX_GPIO_PORT   GPIOG
#define EVAL_COM1_TX_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOG_CLK_ENABLE()
#define EVAL_COM1_TX_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOG_CLK_DISABLE()
#define EVAL_COM1_TX_AF   GPIO_AF8_LPUART1
#define EVAL_COM1_RX_PIN   GPIO_PIN_8
#define EVAL_COM1_RX_GPIO_PORT   GPIOG
#define EVAL_COM1_RX_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOG_CLK_ENABLE()
#define EVAL_COM1_RX_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOG_CLK_DISABLE()
#define EVAL_COM1_RX_AF   GPIO_AF8_LPUART1
#define EVAL_COM1_IRQn   LPUART1_IRQn
#define COMx_CLK_ENABLE(__INDEX__)   do { if((__INDEX__) == COM1) { EVAL_COM1_CLK_ENABLE(); } } while(0)
#define COMx_CLK_DISABLE(__INDEX__)   do { if((__INDEX__) == COM1) { EVAL_COM1_CLK_DISABLE(); } } while(0)
#define COMx_TX_GPIO_CLK_ENABLE(__INDEX__)   do { if((__INDEX__) == COM1) { EVAL_COM1_TX_GPIO_CLK_ENABLE(); } } while(0)
#define COMx_TX_GPIO_CLK_DISABLE(__INDEX__)   do { if((__INDEX__) == COM1) { EVAL_COM1_TX_GPIO_CLK_DISABLE(); } } while(0)
#define COMx_RX_GPIO_CLK_ENABLE(__INDEX__)   do { if((__INDEX__) == COM1) { EVAL_COM1_RX_GPIO_CLK_ENABLE(); } } while(0)
#define COMx_RX_GPIO_CLK_DISABLE(__INDEX__)   do { if((__INDEX__) == COM1) { EVAL_COM1_RX_GPIO_CLK_DISABLE(); } } while(0)
#define BSP_POTENTIOMETER_OK   0x00
 Potentiometer Status values.
#define BSP_POTENTIOMETER_ERROR   0xFF
#define ADCx   ADC1
 Definition for Potentiometer, connected to ADC1.
#define ADCx_CLK_ENABLE()   __HAL_RCC_ADC_CLK_ENABLE()
#define ADCx_CHANNEL_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOA_CLK_ENABLE()
#define ADCx_FORCE_RESET()   __HAL_RCC_ADC_FORCE_RESET()
#define ADCx_RELEASE_RESET()   __HAL_RCC_ADC_RELEASE_RESET()
#define ADCx_CHANNEL_PIN   GPIO_PIN_0
#define ADCx_CHANNEL_GPIO_PORT   GPIOA
#define ADCx_CHANNEL   ADC_CHANNEL_5
#define SAMPLINGTIME   ADC_SAMPLETIME_3CYCLES
#define ADCx_POLL_TIMEOUT   10
#define OPAMPx_INP_PIN   GPIO_PIN_0
 Definition for Potentiometer connected to OPAMP.
#define OPAMPx_INP_GPIO_PORT   GPIOA
#define OPAMPx_INM_PIN   GPIO_PIN_1
#define OPAMPx_INM_GPIO_PORT   GPIOA
#define OPAMPx_VOUT_PIN   GPIO_PIN_3
#define OPAMPx_VOUT_GPIO_PORT   GPIOA
#define OPAMPx   OPAMP
#define OPAMPx_CLK_ENABLE()   __HAL_RCC_OPAMP_CLK_ENABLE()
#define OPAMPx_CLK_DISABLE()   __HAL_RCC_OPAMP_CLK_DISABLE()
#define OPAMPx_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOA_CLK_ENABLE()
#define OPAMPx_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOA_CLK_DISABLE()
#define OPAMPx_FORCE_RESET()   __HAL_RCC_OPAMP_FORCE_RESET()
#define OPAMPx_RELEASE_RESET()   __HAL_RCC_OPAMP_RELEASE_RESET()
#define DSI_RST_PIN   IO_PIN_9
 Eval Pins definition connected to MFX.
#define EXT_RST_PIN   IO_PIN_8
#define LCD_DISP_PIN   IO_PIN_11
#define LCD_RST_PIN   IO_PIN_12
#define OTG_FS_POWER_SWITCH_PIN   IO_PIN_6
#define OTG_FS_OVER_CURRENT_PIN   IO_PIN_7
#define SD_DETECT_PIN   IO_PIN_5
#define SWIRE_PIN   IO_PIN_13
#define EVAL_I2Cx_SCL_PIN   GPIO_PIN_4
#define EVAL_I2Cx_SCL_GPIO_PORT   GPIOH
#define EVAL_I2Cx_SDA_PIN   GPIO_PIN_5
#define EVAL_I2Cx_SDA_GPIO_PORT   GPIOH
#define EVAL_I2Cx_SCL_SDA_AF   GPIO_AF4_I2C2
#define EVAL_I2Cx   I2C2
#define EVAL_I2Cx_CLK_ENABLE()   __HAL_RCC_I2C2_CLK_ENABLE()
#define EVAL_I2Cx_CLK_DISABLE()   __HAL_RCC_I2C2_CLK_DISABLE()
#define EVAL_I2Cx_SDA_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOH_CLK_ENABLE()
#define EVAL_I2Cx_SDA_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOH_CLK_DISABLE()
#define EVAL_I2Cx_SCL_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOH_CLK_ENABLE()
#define EVAL_I2Cx_SCL_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOH_CLK_DISABLE()
#define EVAL_I2Cx_FORCE_RESET()   __HAL_RCC_I2C2_FORCE_RESET()
#define EVAL_I2Cx_RELEASE_RESET()   __HAL_RCC_I2C2_RELEASE_RESET()
#define EVAL_I2Cx_EV_IRQn   I2C2_EV_IRQn
#define EVAL_I2Cx_EV_IRQHandler   I2C2_EV_IRQHandler
#define EVAL_I2Cx_ER_IRQn   I2C2_ER_IRQn
#define EVAL_I2Cx_ER_IRQHandler   I2C2_ER_IRQHandler
#define EVAL_RCC_PERIPHCLK_I2C   RCC_PERIPHCLK_I2C2
#define EVAL_RCC_CLKSOURCE_I2C   RCC_I2C2CLKSOURCE_SYSCLK
#define EVAL_TS_I2Cx   I2C2
#define EVAL_TS_I2Cx_CLK_ENABLE()   __HAL_RCC_I2C2_CLK_ENABLE()
#define EVAL_TS_DMAx_CLK_ENABLE()   __HAL_RCC_DMA1_CLK_ENABLE()
#define EVAL_TS_I2Cx_SDA_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOH_CLK_ENABLE()
#define EVAL_TS_I2Cx_SDA_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOH_CLK_DISABLE()
#define EVAL_TS_I2Cx_SCL_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOH_CLK_ENABLE()
#define EVAL_TS_I2Cx_SCL_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOH_CLK_DISABLE()
#define EVAL_TS_I2Cx_FORCE_RESET()   __HAL_RCC_I2C2_FORCE_RESET()
#define EVAL_TS_I2Cx_RELEASE_RESET()   __HAL_RCC_I2C2_RELEASE_RESET()
#define EVAL_TS_I2Cx_SCL_PIN   GPIO_PIN_4
#define EVAL_TS_I2Cx_SCL_GPIO_PORT   GPIOH
#define EVAL_TS_I2Cx_SDA_PIN   GPIO_PIN_5
#define EVAL_TS_I2Cx_SDA_GPIO_PORT   GPIOH
#define EVAL_TS_I2Cx_SCL_SDA_AF   GPIO_AF4_I2C2
#define EVAL_TS_I2Cx_EV_IRQn   I2C2_EV_IRQn
#define EVAL_TS_I2Cx_ER_IRQn   I2C2_ER_IRQn
#define EVAL_TS_RCC_PERIPHCLK_I2C   RCC_PERIPHCLK_I2C2
#define EVAL_TS_RCC_CLKSOURCE_I2C   RCC_I2C2CLKSOURCE_SYSCLK
#define EEPROM_I2C_ADDRESS   0xA0
#define IO_I2C_ADDRESS   0x84
#define IDD_I2C_ADDRESS   IO_I2C_ADDRESS
#define AUDIO_I2C_ADDRESS   0x34
#define LCD_RGB_I2C_ADDRESS   0x70
#define TS_RGB_I2C_ADDRESS   0x70
#define TS_DSI_I2C_ADDRESS   0x70
#define EVAL_I2Cx_TIMEOUT_MAX   3000
#define AUDIO_INT_GPIO_PORT   GPIOI /* GPIOI */
#define AUDIO_INT_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOI_CLK_ENABLE()
#define AUDIO_INT_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOI_CLK_DISABLE()
#define AUDIO_INT_PIN   GPIO_PIN_6 /* PI.06 */
#define MFX_INT_GPIO_PORT   GPIOA /* GPIOA */
 MFX interface pins.
#define MFX_INT_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOA_CLK_ENABLE()
#define MFX_INT_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOA_CLK_DISABLE()
#define MFX_INT_PIN   GPIO_PIN_0 /* PA.00 */
#define MFX_INT_EXTI_IRQn   EXTI0_IRQn
#define MFX_WAKEUP_GPIO_PORT   GPIOG /* GPIOG */
#define MFX_WAKEUP_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOG_CLK_ENABLE()
#define MFX_WAKEUP_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOG_CLK_DISABLE()
#define MFX_WAKEUP_PIN   GPIO_PIN_9 /* PG.09 */
#define IDD_INT_GPIO_PORT   MFX_INT_GPIO_PORT
#define IDD_INT_GPIO_CLK_ENABLE()   MFX_INT_GPIO_CLK_ENABLE()
#define IDD_INT_GPIO_CLK_DISABLE()   MFX_INT_GPIO_CLK_DISABLE()
#define IDD_INT_PIN   MFX_INT_PIN
#define IDD_INT_EXTI_IRQn   MFX_INT_EXTI_IRQn
#define IDD_WAKEUP_GPIO_PORT   MFX_WAKEUP_GPIO_PORT
#define IDD_WAKEUP_GPIO_CLK_ENABLE()   MFX_WAKEUP_GPIO_CLK_ENABLE()
#define IDD_WAKEUP_GPIO_CLK_DISABLE()   MFX_WAKEUP_GPIO_CLK_DISABLE()
#define IDD_WAKEUP_PIN   MFX_WAKEUP_PIN
#define IDD_AMP_CONTROL_PIN   AGPIO_PIN_1
 Idd current measurement interface pins on MFX.
#define LCD_DSI_TE_PIN   GPIO_PIN_6
 MB1314 DSI.
#define LCD_DSI_TE_CTRL_GPIO_PORT   GPIOG
#define LCD_DSI_TE_CTRL_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOG_CLK_ENABLE()
#define LCD_DSI_TE_CTRL_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOG_CLK_DISABLE()
#define LCD_DSI_BL_CTRL_PIN   GPIO_PIN_14
#define LCD_DSI_BL_CTRL_GPIO_PORT   GPIOB
#define LCD_DSI_BL_CTRL_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOB_CLK_ENABLE()
#define LCD_DSI_BL_CTRL_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOB_CLK_DISABLE()
#define TS_DSI_INT_PIN   GPIO_PIN_2
#define TS_DSI_INT_GPIO_PORT   GPIOC
#define TS_DSI_INT_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOC_CLK_ENABLE()
#define TS_DSI_INT_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOC_CLK_DISABLE()
#define TS_DSI_INT_EXTI_IRQn   EXTI2_IRQn
#define LCD_RGB_DISP_PIN   IO_PIN_11 /* MFX_GPIO11 */
 MB1315 RGB.
#define LCD_RGB_RST_PIN   IO_PIN_12 /* MFX_GPIO12 */
#define LCD_RGB_BL_CTRL_PIN   GPIO_PIN_5
#define LCD_RGB_BL_CTRL_GPIO_PORT   GPIOA
#define LCD_RGB_BL_CTRL_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOA_CLK_ENABLE()
#define LCD_RGB_BL_CTRL_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOA_CLK_DISABLE()
#define TS_RGB_INT_PIN   GPIO_PIN_2
#define TS_RGB_INT_GPIO_PORT   GPIOC
#define TS_RGB_INT_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOC_CLK_ENABLE()
#define TS_RGB_INT_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOC_CLK_DISABLE()
#define TS_RGB_INT_EXTI_IRQn   EXTI2_IRQn

Enumerations

enum  Led_TypeDef {
  LED1 = 0, LED_GREEN = LED1, LED2 = 1, LED_ORANGE = LED2,
  LED3 = 2, LED_RED = LED3, LED4 = 3, LED_BLUE = LED4
}
 LED Types Definition. More...
enum  Button_TypeDef {
  BUTTON_WAKEUP = 0, BUTTON_SEL = 1, BUTTON_LEFT = 2, BUTTON_RIGHT = 3,
  BUTTON_DOWN = 4, BUTTON_UP = 5
}
 BUTTON Types Definition. More...
enum  ButtonMode_TypeDef { BUTTON_MODE_GPIO = 0, BUTTON_MODE_EXTI = 1 }
enum  JOYState_TypeDef {
  JOY_SEL = 0, JOY_LEFT = 1, JOY_RIGHT = 2, JOY_DOWN = 3,
  JOY_UP = 4, JOY_NONE = 5
}
 JOYSTICK Types Definition. More...
enum  JOYMode_TypeDef { JOY_MODE_GPIO = 0, JOY_MODE_EXTI = 1 }
enum  COM_TypeDef { COM1 = 0 }
 COM Types Definition. More...

Functions

uint32_t BSP_GetVersion (void)
 This method returns the STM32L4R9I EVAL BSP Driver revision.
void BSP_LED_Init (Led_TypeDef Led)
 Initialize LED GPIO.
void BSP_LED_DeInit (Led_TypeDef Led)
 DeInitialize LED GPIO.
void BSP_LED_On (Led_TypeDef Led)
 Turn selected LED On.
void BSP_LED_Off (Led_TypeDef Led)
 Turn selected LED Off.
void BSP_LED_Toggle (Led_TypeDef Led)
 Toggle the selected LED.
void BSP_PB_Init (Button_TypeDef Button, ButtonMode_TypeDef ButtonMode)
 Initialize push button GPIO and EXTI Line.
void BSP_PB_DeInit (Button_TypeDef Button)
 DeInitialize push button.
uint32_t BSP_PB_GetState (Button_TypeDef Button)
 Return the selected button state.
void BSP_COM_Init (COM_TypeDef COM, UART_HandleTypeDef *huart)
 Initialize COM port.
void BSP_COM_DeInit (COM_TypeDef COM, UART_HandleTypeDef *huart)
 DeInitialize COM port.
uint32_t BSP_POTENTIOMETER_Init (void)
 Init the potentioneter RV2 measurement thanks to ADC.
uint32_t BSP_POTENTIOMETER_DeInit (void)
 DeInitialize the potentioneter RV2 measurement thanks to ADC.
uint32_t BSP_POTENTIOMETER_GetLevel (void)
 Get the potentioneter RV2 measurement thanks to ADC.
uint8_t BSP_JOY_Init (JOYMode_TypeDef JoyMode)
 Initialize all buttons of the joystick in GPIO or EXTI modes.
void BSP_JOY_DeInit (void)
 DeInitialize all buttons of the joystick.
JOYState_TypeDef BSP_JOY_GetState (void)
 Return the current joystick status.
__weak void BSP_ErrorHandler (void)
 Error Handler.

Detailed Description

This file contains definitions for STM32L4R9I_EVAL's LEDs, push-buttons and COM ports hardware resources.

Author:
MCD Application Team
Attention:

© COPYRIGHT(c) 2017 STMicroelectronics

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file stm32l4r9i_eval.h.

Generated on Thu Oct 12 2017 10:53:59 for STM32L4R9I_EVAL BSP User Manual by   doxygen 1.7.6.1