stm3210e_eval.h

Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm3210e_eval.h
00004   * @author  MCD Application Team
00005   * @version V4.3.0
00006   * @date    10/15/2010
00007   * @brief   This file contains definitions for STM3210E_EVAL's Leds, push-buttons
00008   *          COM ports, sFLASH (on SPI) and Temperature Sensor LM75 (on I2C)
00009   *          hardware resources.  
00010   ******************************************************************************
00011   * @copy
00012   *
00013   * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
00014   * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
00015   * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
00016   * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
00017   * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
00018   * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
00019   *
00020   * <h2><center>&copy; COPYRIGHT 2010 STMicroelectronics</center></h2>
00021   */ 
00022   
00023 /* Define to prevent recursive inclusion -------------------------------------*/
00024 #ifndef __STM3210E_EVAL_H
00025 #define __STM3210E_EVAL_H
00026 
00027 #ifdef __cplusplus
00028  extern "C" {
00029 #endif 
00030 
00031 /* Includes ------------------------------------------------------------------*/
00032 #include "stm32_eval.h"
00033 
00034 /** @addtogroup Utilities
00035   * @{
00036   */ 
00037 
00038 /** @addtogroup STM32_EVAL
00039   * @{
00040   */  
00041   
00042 /** @addtogroup STM3210E_EVAL
00043   * @{
00044   */ 
00045 
00046 /** @addtogroup STM3210E_EVAL_LOW_LEVEL
00047   * @{
00048   */ 
00049   
00050 /** @defgroup STM3210E_EVAL_LOW_LEVEL_Exported_Types
00051   * @{
00052   */
00053 /**
00054   * @}
00055   */ 
00056 
00057 /** @defgroup STM3210E_EVAL_LOW_LEVEL_Exported_Constants
00058   * @{
00059   */ 
00060 /** @addtogroup STM3210E_EVAL_LOW_LEVEL_LED
00061   * @{
00062   */
00063 #define LEDn                             4
00064 
00065 #define LED1_PIN                         GPIO_Pin_6
00066 #define LED1_GPIO_PORT                   GPIOF
00067 #define LED1_GPIO_CLK                    RCC_APB2Periph_GPIOF  
00068   
00069 #define LED2_PIN                         GPIO_Pin_7
00070 #define LED2_GPIO_PORT                   GPIOF
00071 #define LED2_GPIO_CLK                    RCC_APB2Periph_GPIOF  
00072 
00073 #define LED3_PIN                         GPIO_Pin_8  
00074 #define LED3_GPIO_PORT                   GPIOF
00075 #define LED3_GPIO_CLK                    RCC_APB2Periph_GPIOF  
00076 
00077 #define LED4_PIN                         GPIO_Pin_9
00078 #define LED4_GPIO_PORT                   GPIOF
00079 #define LED4_GPIO_CLK                    RCC_APB2Periph_GPIOF
00080 
00081 /**
00082   * @}
00083   */
00084   
00085 /** @addtogroup STM3210E_EVAL_LOW_LEVEL_BUTTON
00086   * @{
00087   */  
00088 #define BUTTONn                          8
00089 
00090 /**
00091  * @brief Wakeup push-button
00092  */
00093 #define WAKEUP_BUTTON_PIN                GPIO_Pin_0
00094 #define WAKEUP_BUTTON_GPIO_PORT          GPIOA
00095 #define WAKEUP_BUTTON_GPIO_CLK           RCC_APB2Periph_GPIOA
00096 #define WAKEUP_BUTTON_EXTI_LINE          EXTI_Line0
00097 #define WAKEUP_BUTTON_EXTI_PORT_SOURCE   GPIO_PortSourceGPIOA
00098 #define WAKEUP_BUTTON_EXTI_PIN_SOURCE    GPIO_PinSource0
00099 #define WAKEUP_BUTTON_EXTI_IRQn          EXTI0_IRQn 
00100 /**
00101  * @brief Tamper push-button
00102  */
00103 #define TAMPER_BUTTON_PIN                GPIO_Pin_13
00104 #define TAMPER_BUTTON_GPIO_PORT          GPIOC
00105 #define TAMPER_BUTTON_GPIO_CLK           RCC_APB2Periph_GPIOC
00106 #define TAMPER_BUTTON_EXTI_LINE          EXTI_Line13
00107 #define TAMPER_BUTTON_EXTI_PORT_SOURCE   GPIO_PortSourceGPIOC
00108 #define TAMPER_BUTTON_EXTI_PIN_SOURCE    GPIO_PinSource13
00109 #define TAMPER_BUTTON_EXTI_IRQn          EXTI15_10_IRQn 
00110 /**
00111  * @brief Key push-button
00112  */
00113 #define KEY_BUTTON_PIN                   GPIO_Pin_8
00114 #define KEY_BUTTON_GPIO_PORT             GPIOG
00115 #define KEY_BUTTON_GPIO_CLK              RCC_APB2Periph_GPIOG
00116 #define KEY_BUTTON_EXTI_LINE             EXTI_Line8
00117 #define KEY_BUTTON_EXTI_PORT_SOURCE      GPIO_PortSourceGPIOG
00118 #define KEY_BUTTON_EXTI_PIN_SOURCE       GPIO_PinSource8
00119 #define KEY_BUTTON_EXTI_IRQn             EXTI9_5_IRQn
00120 /**
00121  * @brief Joystick Right push-button
00122  */
00123 #define RIGHT_BUTTON_PIN                 GPIO_Pin_13
00124 #define RIGHT_BUTTON_GPIO_PORT           GPIOG
00125 #define RIGHT_BUTTON_GPIO_CLK            RCC_APB2Periph_GPIOG
00126 #define RIGHT_BUTTON_EXTI_LINE           EXTI_Line13
00127 #define RIGHT_BUTTON_EXTI_PORT_SOURCE    GPIO_PortSourceGPIOG
00128 #define RIGHT_BUTTON_EXTI_PIN_SOURCE     GPIO_PinSource13
00129 #define RIGHT_BUTTON_EXTI_IRQn           EXTI15_10_IRQn
00130 /**
00131  * @brief Joystick Left push-button
00132  */    
00133 #define LEFT_BUTTON_PIN                  GPIO_Pin_14
00134 #define LEFT_BUTTON_GPIO_PORT            GPIOG
00135 #define LEFT_BUTTON_GPIO_CLK             RCC_APB2Periph_GPIOG
00136 #define LEFT_BUTTON_EXTI_LINE            EXTI_Line14
00137 #define LEFT_BUTTON_EXTI_PORT_SOURCE     GPIO_PortSourceGPIOG
00138 #define LEFT_BUTTON_EXTI_PIN_SOURCE      GPIO_PinSource14
00139 #define LEFT_BUTTON_EXTI_IRQn            EXTI15_10_IRQn  
00140 /**
00141  * @brief Joystick Up push-button
00142  */
00143 #define UP_BUTTON_PIN                    GPIO_Pin_15
00144 #define UP_BUTTON_GPIO_PORT              GPIOG
00145 #define UP_BUTTON_GPIO_CLK               RCC_APB2Periph_GPIOG
00146 #define UP_BUTTON_EXTI_LINE              EXTI_Line15
00147 #define UP_BUTTON_EXTI_PORT_SOURCE       GPIO_PortSourceGPIOG
00148 #define UP_BUTTON_EXTI_PIN_SOURCE        GPIO_PinSource15
00149 #define UP_BUTTON_EXTI_IRQn              EXTI15_10_IRQn  
00150 /**
00151  * @brief Joystick Down push-button
00152  */   
00153 #define DOWN_BUTTON_PIN                  GPIO_Pin_3
00154 #define DOWN_BUTTON_GPIO_PORT            GPIOD
00155 #define DOWN_BUTTON_GPIO_CLK             RCC_APB2Periph_GPIOD
00156 #define DOWN_BUTTON_EXTI_LINE            EXTI_Line3
00157 #define DOWN_BUTTON_EXTI_PORT_SOURCE     GPIO_PortSourceGPIOD
00158 #define DOWN_BUTTON_EXTI_PIN_SOURCE      GPIO_PinSource3
00159 #define DOWN_BUTTON_EXTI_IRQn            EXTI3_IRQn  
00160 /**
00161  * @brief Joystick Sel push-button
00162  */  
00163 #define SEL_BUTTON_PIN                   GPIO_Pin_7
00164 #define SEL_BUTTON_GPIO_PORT             GPIOG
00165 #define SEL_BUTTON_GPIO_CLK              RCC_APB2Periph_GPIOG
00166 #define SEL_BUTTON_EXTI_LINE             EXTI_Line7
00167 #define SEL_BUTTON_EXTI_PORT_SOURCE      GPIO_PortSourceGPIOG
00168 #define SEL_BUTTON_EXTI_PIN_SOURCE       GPIO_PinSource7
00169 #define SEL_BUTTON_EXTI_IRQn             EXTI9_5_IRQn          
00170 /**
00171   * @}
00172   */ 
00173 
00174 /** @addtogroup STM3210E_EVAL_LOW_LEVEL_COM
00175   * @{
00176   */
00177 #define COMn                             2
00178 
00179 /**
00180  * @brief Definition for COM port1, connected to USART1
00181  */ 
00182 #define EVAL_COM1                        USART1
00183 #define EVAL_COM1_CLK                    RCC_APB2Periph_USART1
00184 #define EVAL_COM1_TX_PIN                 GPIO_Pin_9
00185 #define EVAL_COM1_TX_GPIO_PORT           GPIOA
00186 #define EVAL_COM1_TX_GPIO_CLK            RCC_APB2Periph_GPIOA
00187 #define EVAL_COM1_RX_PIN                 GPIO_Pin_10
00188 #define EVAL_COM1_RX_GPIO_PORT           GPIOA
00189 #define EVAL_COM1_RX_GPIO_CLK            RCC_APB2Periph_GPIOA
00190 #define EVAL_COM1_IRQn                   USART1_IRQn
00191 
00192 /**
00193  * @brief Definition for COM port2, connected to USART2
00194  */ 
00195 #define EVAL_COM2                        USART2
00196 #define EVAL_COM2_CLK                    RCC_APB1Periph_USART2
00197 #define EVAL_COM2_TX_PIN                 GPIO_Pin_2
00198 #define EVAL_COM2_TX_GPIO_PORT           GPIOA
00199 #define EVAL_COM2_TX_GPIO_CLK            RCC_APB2Periph_GPIOA
00200 #define EVAL_COM2_RX_PIN                 GPIO_Pin_3
00201 #define EVAL_COM2_RX_GPIO_PORT           GPIOA
00202 #define EVAL_COM2_RX_GPIO_CLK            RCC_APB2Periph_GPIOA
00203 #define EVAL_COM2_IRQn                   USART2_IRQn
00204 
00205 /**
00206   * @}
00207   */ 
00208 
00209 /** @addtogroup STM3210E_EVAL_LOW_LEVEL_SD_FLASH
00210   * @{
00211   */
00212 /**
00213   * @brief  SD FLASH SDIO Interface
00214   */ 
00215 
00216 #define SD_DETECT_PIN                    GPIO_Pin_11                 /* PF.11 */
00217 #define SD_DETECT_GPIO_PORT              GPIOF                       /* GPIOF */
00218 #define SD_DETECT_GPIO_CLK               RCC_APB2Periph_GPIOF
00219 
00220 #define SDIO_FIFO_ADDRESS                ((uint32_t)0x40018080)
00221 /** 
00222   * @brief  SDIO Intialization Frequency (400KHz max)
00223   */
00224 #define SDIO_INIT_CLK_DIV                ((uint8_t)0xB2)
00225 /** 
00226   * @brief  SDIO Data Transfer Frequency (25MHz max) 
00227   */
00228 #define SDIO_TRANSFER_CLK_DIV            ((uint8_t)0x1) 
00229 
00230 /**
00231   * @}
00232   */ 
00233   
00234 /** @addtogroup STM3210E_EVAL_LOW_LEVEL_M25P_FLASH_SPI
00235   * @{
00236   */
00237 /**
00238   * @brief  M25P FLASH SPI Interface pins
00239   */  
00240 #define sFLASH_SPI                       SPI1
00241 #define sFLASH_SPI_CLK                   RCC_APB2Periph_SPI1
00242 #define sFLASH_SPI_SCK_PIN               GPIO_Pin_5                  /* PA.05 */
00243 #define sFLASH_SPI_SCK_GPIO_PORT         GPIOA                       /* GPIOA */
00244 #define sFLASH_SPI_SCK_GPIO_CLK          RCC_APB2Periph_GPIOA
00245 #define sFLASH_SPI_MISO_PIN              GPIO_Pin_6                  /* PA.06 */
00246 #define sFLASH_SPI_MISO_GPIO_PORT        GPIOA                       /* GPIOA */
00247 #define sFLASH_SPI_MISO_GPIO_CLK         RCC_APB2Periph_GPIOA
00248 #define sFLASH_SPI_MOSI_PIN              GPIO_Pin_7                  /* PA.07 */
00249 #define sFLASH_SPI_MOSI_GPIO_PORT        GPIOA                       /* GPIOA */
00250 #define sFLASH_SPI_MOSI_GPIO_CLK         RCC_APB2Periph_GPIOA
00251 #define sFLASH_CS_PIN                    GPIO_Pin_2                  /* PB.02 */
00252 #define sFLASH_CS_GPIO_PORT              GPIOB                       /* GPIOB */
00253 #define sFLASH_CS_GPIO_CLK               RCC_APB2Periph_GPIOB
00254 
00255 /**
00256   * @}
00257   */
00258 
00259 /** @addtogroup STM3210E_EVAL_LOW_LEVEL_TSENSOR_I2C
00260   * @{
00261   */
00262 /**
00263   * @brief  LM75 Temperature Sensor I2C Interface pins
00264   */  
00265 #define LM75_I2C                         I2C1
00266 #define LM75_I2C_CLK                     RCC_APB1Periph_I2C1
00267 #define LM75_I2C_SCL_PIN                 GPIO_Pin_6                  /* PB.06 */
00268 #define LM75_I2C_SCL_GPIO_PORT           GPIOB                       /* GPIOB */
00269 #define LM75_I2C_SCL_GPIO_CLK            RCC_APB2Periph_GPIOB
00270 #define LM75_I2C_SDA_PIN                 GPIO_Pin_7                  /* PB.07 */
00271 #define LM75_I2C_SDA_GPIO_PORT           GPIOB                       /* GPIOB */
00272 #define LM75_I2C_SDA_GPIO_CLK            RCC_APB2Periph_GPIOB
00273 #define LM75_I2C_SMBUSALERT_PIN          GPIO_Pin_5                  /* PB.05 */
00274 #define LM75_I2C_SMBUSALERT_GPIO_PORT    GPIOB                       /* GPIOB */
00275 #define LM75_I2C_SMBUSALERT_GPIO_CLK     RCC_APB2Periph_GPIOB
00276 #define LM75_I2C_DR                      ((uint32_t)0x40005410)
00277 
00278 #define LM75_DMA_CLK                     RCC_AHBPeriph_DMA1
00279 #define LM75_DMA_TX_CHANNEL              DMA1_Channel6
00280 #define LM75_DMA_RX_CHANNEL              DMA1_Channel7
00281 #define LM75_DMA_TX_TCFLAG               DMA1_FLAG_TC6
00282 #define LM75_DMA_RX_TCFLAG               DMA1_FLAG_TC7
00283 /**
00284   * @}
00285   */
00286   
00287 /**
00288   * @}
00289   */
00290   
00291 /** @defgroup STM3210E_EVAL_LOW_LEVEL_Exported_Macros
00292   * @{
00293   */ 
00294 /**
00295   * @}
00296   */ 
00297 
00298 /** @defgroup STM3210E_EVAL_LOW_LEVEL_Exported_Functions
00299   * @{
00300   */ 
00301 void STM_EVAL_LEDInit(Led_TypeDef Led);
00302 void STM_EVAL_LEDOn(Led_TypeDef Led);
00303 void STM_EVAL_LEDOff(Led_TypeDef Led);
00304 void STM_EVAL_LEDToggle(Led_TypeDef Led);
00305 void STM_EVAL_PBInit(Button_TypeDef Button, ButtonMode_TypeDef Button_Mode);
00306 uint32_t STM_EVAL_PBGetState(Button_TypeDef Button);
00307 void STM_EVAL_COMInit(COM_TypeDef COM, USART_InitTypeDef* USART_InitStruct);
00308 void SD_LowLevel_DeInit(void);
00309 void SD_LowLevel_Init(void); 
00310 void SD_LowLevel_DMA_TxConfig(uint32_t *BufferSRC, uint32_t BufferSize);
00311 void SD_LowLevel_DMA_RxConfig(uint32_t *BufferDST, uint32_t BufferSize);
00312 uint32_t SD_DMAEndOfTransferStatus(void);
00313 void sFLASH_LowLevel_DeInit(void);
00314 void sFLASH_LowLevel_Init(void); 
00315 void LM75_LowLevel_DeInit(void);
00316 void LM75_LowLevel_Init(void); 
00317 /**
00318   * @}
00319   */
00320 #ifdef __cplusplus
00321 }
00322 #endif
00323   
00324 #endif /* __STM3210E_EVAL_H */
00325 /**
00326   * @}
00327   */ 
00328 
00329 /**
00330   * @}
00331   */ 
00332 
00333 /**
00334   * @}
00335   */
00336 
00337 /**
00338   * @}
00339   */
00340   
00341 /******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE****/
STM32F10x Standard Peripherals Library: Footer

 

 

 

      For complete documentation on STM32(CORTEX M3) 32-bit Microcontrollers platform visit  www.st.com/STM32