STM3210E_EVAL BSP User Manual: stm3210e_eval.h File Reference

STM3210E EVAL BSP Drivers

stm3210e_eval.h File Reference

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

#include "stm32f1xx_hal.h"

Go to the source code of this file.

Defines

#define LEDn   4
#define LED1_PIN   GPIO_PIN_6 /* PF.06*/
#define LED1_GPIO_PORT   GPIOF
#define LED1_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOF_CLK_ENABLE()
#define LED1_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOF_CLK_DISABLE()
#define LED2_PIN   GPIO_PIN_7 /* PF.07*/
#define LED2_GPIO_PORT   GPIOF
#define LED2_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOF_CLK_ENABLE()
#define LED2_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOF_CLK_DISABLE()
#define LED3_PIN   GPIO_PIN_8 /* PF.08*/
#define LED3_GPIO_PORT   GPIOF
#define LED3_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOF_CLK_ENABLE()
#define LED3_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOF_CLK_DISABLE()
#define LED4_PIN   GPIO_PIN_9 /* PF.09*/
#define LED4_GPIO_PORT   GPIOF
#define LED4_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOF_CLK_ENABLE()
#define LED4_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOF_CLK_DISABLE()
#define LEDx_GPIO_CLK_ENABLE(__LED__)
#define LEDx_GPIO_CLK_DISABLE(__LED__)
#define JOYn   5
#define BUTTONn   3 + JOYn
#define TAMPER_BUTTON_PIN   GPIO_PIN_13 /* PC.13*/
 Tamper push-button.
#define TAMPER_BUTTON_GPIO_PORT   GPIOC
#define TAMPER_BUTTON_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOC_CLK_ENABLE()
#define TAMPER_BUTTON_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOC_CLK_DISABLE()
#define TAMPER_BUTTON_EXTI_IRQn   EXTI15_10_IRQn
#define KEY_BUTTON_PIN   GPIO_PIN_8 /* PG.08*/
 Key push-button.
#define KEY_BUTTON_GPIO_PORT   GPIOG
#define KEY_BUTTON_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOG_CLK_ENABLE()
#define KEY_BUTTON_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOG_CLK_DISABLE()
#define KEY_BUTTON_EXTI_IRQn   EXTI9_5_IRQn
#define WAKEUP_BUTTON_PIN   GPIO_PIN_0 /* PA.00*/
 Wake-up push-button.
#define WAKEUP_BUTTON_GPIO_PORT   GPIOA
#define WAKEUP_BUTTON_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOA_CLK_ENABLE()
#define WAKEUP_BUTTON_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOA_CLK_DISABLE()
#define WAKEUP_BUTTON_EXTI_IRQn   EXTI0_IRQn
#define RIGHT_JOY_PIN   GPIO_PIN_13 /* PG.13*/
 Joystick Right push-button.
#define RIGHT_JOY_GPIO_PORT   GPIOG
#define RIGHT_JOY_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOG_CLK_ENABLE()
#define RIGHT_JOY_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOG_CLK_DISABLE()
#define RIGHT_JOY_EXTI_IRQn   EXTI15_10_IRQn
#define LEFT_JOY_PIN   GPIO_PIN_14 /* PG.14*/
 Joystick Left push-button.
#define LEFT_JOY_GPIO_PORT   GPIOG
#define LEFT_JOY_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOG_CLK_ENABLE()
#define LEFT_JOY_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOG_CLK_DISABLE()
#define LEFT_JOY_EXTI_IRQn   EXTI15_10_IRQn
#define UP_JOY_PIN   GPIO_PIN_15 /* PG.15*/
 Joystick Up push-button.
#define UP_JOY_GPIO_PORT   GPIOG
#define UP_JOY_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOG_CLK_ENABLE()
#define UP_JOY_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOG_CLK_DISABLE()
#define UP_JOY_EXTI_IRQn   EXTI15_10_IRQn
#define DOWN_JOY_PIN   GPIO_PIN_3 /* PD.03*/
 Joystick Down push-button.
#define DOWN_JOY_GPIO_PORT   GPIOD
#define DOWN_JOY_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOD_CLK_ENABLE()
#define DOWN_JOY_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOD_CLK_DISABLE()
#define DOWN_JOY_EXTI_IRQn   EXTI3_IRQn
#define SEL_JOY_PIN   GPIO_PIN_7 /* PG.07*/
 Joystick Sel push-button.
#define SEL_JOY_GPIO_PORT   GPIOG
#define SEL_JOY_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOG_CLK_ENABLE()
#define SEL_JOY_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOG_CLK_DISABLE()
#define SEL_JOY_EXTI_IRQn   EXTI9_5_IRQn
#define BUTTONx_GPIO_CLK_ENABLE(__BUTTON__)
#define BUTTONx_GPIO_CLK_DISABLE(__BUTTON__)
#define JOYx_GPIO_CLK_ENABLE(__JOY__)
#define JOYx_GPIO_CLK_DISABLE(__JOY__)
#define COMn   2
#define EVAL_COM1   USART1
 Definition for COM port1, connected to USART1.
#define EVAL_COM1_CLK_ENABLE()   __HAL_RCC_USART1_CLK_ENABLE()
#define EVAL_COM1_CLK_DISABLE()   __HAL_RCC_USART1_CLK_DISABLE()
#define EVAL_COM1_TX_PIN   GPIO_PIN_9 /* PA.09*/
#define EVAL_COM1_TX_GPIO_PORT   GPIOA
#define EVAL_COM1_TX_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOA_CLK_ENABLE()
#define EVAL_COM1_TX_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOA_CLK_DISABLE()
#define EVAL_COM1_RX_PIN   GPIO_PIN_10 /* PA.10*/
#define EVAL_COM1_RX_GPIO_PORT   GPIOA
#define EVAL_COM1_RX_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOA_CLK_ENABLE()
#define EVAL_COM1_RX_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOA_CLK_DISABLE()
#define EVAL_COM1_IRQn   USART1_IRQn
#define EVAL_COM2   USART2
 Definition for COM port2, connected to USART2.
#define EVAL_COM2_CLK_ENABLE()   __HAL_RCC_USART2_CLK_ENABLE()
#define EVAL_COM2_CLK_DISABLE()   __HAL_RCC_USART2_CLK_DISABLE()
#define EVAL_COM2_TX_PIN   GPIO_PIN_2 /* PA.02*/
#define EVAL_COM2_TX_GPIO_PORT   GPIOA
#define EVAL_COM2_TX_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOA_CLK_ENABLE()
#define EVAL_COM2_TX_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOA_CLK_DISABLE()
#define EVAL_COM2_RX_PIN   GPIO_PIN_3 /* PA.03*/
#define EVAL_COM2_RX_GPIO_PORT   GPIOA
#define EVAL_COM2_RX_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOA_CLK_ENABLE()
#define EVAL_COM2_RX_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOA_CLK_DISABLE()
#define EVAL_COM2_IRQn   USART2_IRQn
#define COMx_CLK_ENABLE(__INDEX__)
#define COMx_CLK_DISABLE(__INDEX__)
#define COMx_TX_GPIO_CLK_ENABLE(__INDEX__)
#define COMx_TX_GPIO_CLK_DISABLE(__INDEX__)
#define COMx_RX_GPIO_CLK_ENABLE(__INDEX__)
#define COMx_RX_GPIO_CLK_DISABLE(__INDEX__)
#define EVAL_I2Cx_SCL_PIN   GPIO_PIN_6 /* PB.06*/
#define EVAL_I2Cx_SCL_GPIO_PORT   GPIOB
#define EVAL_I2Cx_SDA_PIN   GPIO_PIN_7 /* PB.07*/
#define EVAL_I2Cx_SDA_GPIO_PORT   GPIOB
#define EVAL_I2Cx   I2C1
#define EVAL_I2Cx_CLK_ENABLE()   __HAL_RCC_I2C1_CLK_ENABLE()
#define EVAL_I2Cx_SDA_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOB_CLK_ENABLE()
#define EVAL_I2Cx_SCL_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOB_CLK_ENABLE()
#define EVAL_I2Cx_FORCE_RESET()   __HAL_RCC_I2C1_FORCE_RESET()
#define EVAL_I2Cx_RELEASE_RESET()   __HAL_RCC_I2C1_RELEASE_RESET()
#define EVAL_I2Cx_EV_IRQn   I2C1_EV_IRQn
#define EVAL_I2Cx_EV_IRQHandler   I2C1_EV_IRQHandler
#define EVAL_I2Cx_ER_IRQn   I2C1_ER_IRQn
#define EVAL_I2Cx_ER_IRQHandler   I2C1_ER_IRQHandler
#define EVAL_I2Cx_TIMEOUT_MAX   3000
#define EVAL_SPIx   SPI1
#define EVAL_SPIx_CLK_ENABLE()   __HAL_RCC_SPI1_CLK_ENABLE()
#define EVAL_SPIx_SCK_GPIO_PORT   GPIOA /* PA.05*/
#define EVAL_SPIx_SCK_PIN   GPIO_PIN_5
#define EVAL_SPIx_SCK_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOA_CLK_ENABLE()
#define EVAL_SPIx_SCK_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOA_CLK_DISABLE()
#define EVAL_SPIx_MISO_MOSI_GPIO_PORT   GPIOA
#define EVAL_SPIx_MISO_MOSI_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOA_CLK_ENABLE()
#define EVAL_SPIx_MISO_MOSI_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOA_CLK_DISABLE()
#define EVAL_SPIx_MISO_PIN   GPIO_PIN_6 /* PA.06*/
#define EVAL_SPIx_MOSI_PIN   GPIO_PIN_7 /* PA.07*/
#define EVAL_SPIx_TIMEOUT_MAX   1000
#define FLASH_SPI_CS_LOW()   HAL_GPIO_WritePin(FLASH_SPI_CS_GPIO_PORT, FLASH_SPI_CS_PIN, GPIO_PIN_RESET)
 M25P FLASH SPI Chip Select macro definition.
#define FLASH_SPI_CS_HIGH()   HAL_GPIO_WritePin(FLASH_SPI_CS_GPIO_PORT, FLASH_SPI_CS_PIN, GPIO_PIN_SET)
#define FLASH_SPI_CS_PIN   GPIO_PIN_2 /* PB.02*/
 M25P FLASH SPI Control Interface pins.
#define FLASH_SPI_CS_GPIO_PORT   GPIOB
#define FLASH_SPI_CS_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOB_CLK_ENABLE()
#define FLASH_SPI_CS_GPIO_CLK_DISABLE()   __HAL_RCC_GPIOB_CLK_DISABLE()
#define FLASH_SPI_CMD_WRITE   0x02
 M25P FLASH SPI supported commands.
#define FLASH_SPI_CMD_WRSR   0x01
#define FLASH_SPI_CMD_WREN   0x06
#define FLASH_SPI_CMD_READ   0x03
#define FLASH_SPI_CMD_RDSR   0x05
#define FLASH_SPI_CMD_RDID   0x9F
#define FLASH_SPI_CMD_SE   0xD8
#define FLASH_SPI_CMD_BE   0xC7
#define FLASH_SPI_WIP_FLAG   0x01
#define FLASH_SPI_DUMMY_BYTE   0xA5
#define FLASH_SPI_PAGESIZE   0x100
#define FLASH_SPI_M25P128_ID   0x202018
#define FLASH_SPI_M25P64_ID   0x202017
#define AUDIO_I2C_ADDRESS   0x27
 AUDIO I2C Interface pins.
#define AUDIO_RESET_GPIO_CLK_ENABLE()   __HAL_RCC_GPIOG_CLK_ENABLE()
#define AUDIO_RESET_PIN   GPIO_PIN_11
#define AUDIO_RESET_GPIO   GPIOG

Enumerations

enum  Led_TypeDef {
  LED1 = 0, LED2 = 1, LED3 = 2, LED4 = 3,
  LED_GREEN = LED1, LED_ORANGE = LED2, LED_RED = LED3, LED_BLUE = LED4
}
 LED Types Definition. More...
enum  Button_TypeDef {
  BUTTON_WAKEUP = 0, BUTTON_TAMPER = 1, BUTTON_KEY = 2, BUTTON_SEL = 3,
  BUTTON_LEFT = 4, BUTTON_RIGHT = 5, BUTTON_DOWN = 6, BUTTON_UP = 7
}
 BUTTON Types Definition. More...
enum  ButtonMode_TypeDef { BUTTON_MODE_GPIO = 0, BUTTON_MODE_EXTI = 1, BUTTON_MODE_EVT = 2 }
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, COM2 = 1 }
 COM Types Definition. More...

Functions

uint32_t BSP_GetVersion (void)
 This method returns the STM3210E EVAL BSP Driver revision.
void BSP_LED_Init (Led_TypeDef Led)
 Configures LED GPIO.
void BSP_LED_On (Led_TypeDef Led)
 Turns selected LED On.
void BSP_LED_Off (Led_TypeDef Led)
 Turns selected LED Off.
void BSP_LED_Toggle (Led_TypeDef Led)
 Toggles the selected LED.
void BSP_PB_Init (Button_TypeDef Button, ButtonMode_TypeDef Button_Mode)
 Configures push button GPIO and EXTI Line.
uint32_t BSP_PB_GetState (Button_TypeDef Button)
 Returns the selected button state.
void BSP_COM_Init (COM_TypeDef COM, UART_HandleTypeDef *huart)
 Configures COM port.
uint8_t BSP_JOY_Init (JOYMode_TypeDef Joy_Mode)
 Configures all button of the joystick in GPIO or EXTI modes.
JOYState_TypeDef BSP_JOY_GetState (void)
 Returns the current joystick status.

Detailed Description

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

Author:
MCD Application Team
Version:
V6.0.1
Date:
18-December-2015
Attention:

© COPYRIGHT(c) 2015 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 stm3210e_eval.h.

Generated on Thu Dec 10 2015 17:39:43 for STM3210E_EVAL BSP User Manual by   doxygen 1.7.6.1