stm3210b_eval.h

Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm3210b_eval.h
00004   * @author  MCD Application Team
00005   * @version V4.3.0
00006   * @date    10/15/2010
00007   * @brief   This file contains definitions for STM3210B_EVAL's Leds, push-buttons
00008   *          COM ports, SD Card (on SPI), sFLASH (on SPI) and Temperature sensor 
00009   *          LM75 (on I2C) 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 __STM3210B_EVAL_H
00025 #define __STM3210B_EVAL_H
00026 
00027 #ifdef __cplusplus
00028  extern "C" {
00029 #endif
00030 
00031 /* Includes ------------------------------------------------------------------*/
00032 #include "stm32_eval.h"
00033 #include "stm32f10x_spi.h"
00034 #include "stm32f10x_i2c.h"
00035 
00036 /** @addtogroup Utilities
00037   * @{
00038   */
00039 
00040 /** @addtogroup STM32_EVAL
00041   * @{
00042   */
00043     
00044 /** @addtogroup STM3210B_EVAL
00045   * @{
00046   */ 
00047 
00048 /** @addtogroup STM3210B_EVAL_LOW_LEVEL
00049   * @{
00050   */
00051   
00052 /** @defgroup STM3210B_EVAL_LOW_LEVEL_Exported_Types
00053   * @{
00054   */
00055 /**
00056   * @}
00057   */
00058 
00059 
00060 /** @defgroup STM3210B_EVAL_LOW_LEVEL_Exported_Constants
00061   * @{
00062   */ 
00063 /** @addtogroup STM3210B_EVAL_LOW_LEVEL_LED
00064   * @{
00065   */
00066 #define LEDn                             4
00067 #define LED1_PIN                         GPIO_Pin_6
00068 #define LED1_GPIO_PORT                   GPIOC
00069 #define LED1_GPIO_CLK                    RCC_APB2Periph_GPIOC  
00070   
00071 #define LED2_PIN                         GPIO_Pin_7
00072 #define LED2_GPIO_PORT                   GPIOC
00073 #define LED2_GPIO_CLK                    RCC_APB2Periph_GPIOC  
00074 
00075 #define LED3_PIN                         GPIO_Pin_8  
00076 #define LED3_GPIO_PORT                   GPIOC
00077 #define LED3_GPIO_CLK                    RCC_APB2Periph_GPIOC  
00078   
00079 #define LED4_PIN                         GPIO_Pin_9
00080 #define LED4_GPIO_PORT                   GPIOC
00081 #define LED4_GPIO_CLK                    RCC_APB2Periph_GPIOC  
00082 
00083 /**
00084   * @}
00085   */ 
00086   
00087 /** @addtogroup STM3210B_EVAL_LOW_LEVEL_BUTTON
00088   * @{
00089   */  
00090 #define BUTTONn                          8
00091 
00092 /**
00093  * @brief Wakeup push-button
00094  */
00095 #define WAKEUP_BUTTON_PIN                GPIO_Pin_0
00096 #define WAKEUP_BUTTON_GPIO_PORT          GPIOA
00097 #define WAKEUP_BUTTON_GPIO_CLK           RCC_APB2Periph_GPIOA
00098 #define WAKEUP_BUTTON_EXTI_LINE          EXTI_Line0
00099 #define WAKEUP_BUTTON_EXTI_PORT_SOURCE   GPIO_PortSourceGPIOA
00100 #define WAKEUP_BUTTON_EXTI_PIN_SOURCE    GPIO_PinSource0
00101 #define WAKEUP_BUTTON_EXTI_IRQn          EXTI0_IRQn 
00102 /**
00103  * @brief Tamper push-button
00104  */
00105 #define TAMPER_BUTTON_PIN                GPIO_Pin_13
00106 #define TAMPER_BUTTON_GPIO_PORT          GPIOC
00107 #define TAMPER_BUTTON_GPIO_CLK           RCC_APB2Periph_GPIOC
00108 #define TAMPER_BUTTON_EXTI_LINE          EXTI_Line13
00109 #define TAMPER_BUTTON_EXTI_PORT_SOURCE   GPIO_PortSourceGPIOC
00110 #define TAMPER_BUTTON_EXTI_PIN_SOURCE    GPIO_PinSource13
00111 #define TAMPER_BUTTON_EXTI_IRQn          EXTI15_10_IRQn 
00112 /**
00113  * @brief Key push-button
00114  */
00115 #define KEY_BUTTON_PIN                   GPIO_Pin_9
00116 #define KEY_BUTTON_GPIO_PORT             GPIOB
00117 #define KEY_BUTTON_GPIO_CLK              RCC_APB2Periph_GPIOB
00118 #define KEY_BUTTON_EXTI_LINE             EXTI_Line9
00119 #define KEY_BUTTON_EXTI_PORT_SOURCE      GPIO_PortSourceGPIOB
00120 #define KEY_BUTTON_EXTI_PIN_SOURCE       GPIO_PinSource9
00121 #define KEY_BUTTON_EXTI_IRQn             EXTI9_5_IRQn
00122 /**
00123  * @brief Joystick Right push-button
00124  */
00125 #define RIGHT_BUTTON_PIN                 GPIO_Pin_0
00126 #define RIGHT_BUTTON_GPIO_PORT           GPIOE
00127 #define RIGHT_BUTTON_GPIO_CLK            RCC_APB2Periph_GPIOE
00128 #define RIGHT_BUTTON_EXTI_LINE           EXTI_Line0
00129 #define RIGHT_BUTTON_EXTI_PORT_SOURCE    GPIO_PortSourceGPIOE
00130 #define RIGHT_BUTTON_EXTI_PIN_SOURCE     GPIO_PinSource0
00131 #define RIGHT_BUTTON_EXTI_IRQn           EXTI0_IRQn
00132 /**
00133  * @brief Joystick Left push-button
00134  */
00135 #define LEFT_BUTTON_PIN                  GPIO_Pin_1
00136 #define LEFT_BUTTON_GPIO_PORT            GPIOE
00137 #define LEFT_BUTTON_GPIO_CLK             RCC_APB2Periph_GPIOE
00138 #define LEFT_BUTTON_EXTI_LINE            EXTI_Line1
00139 #define LEFT_BUTTON_EXTI_PORT_SOURCE     GPIO_PortSourceGPIOE
00140 #define LEFT_BUTTON_EXTI_PIN_SOURCE      GPIO_PinSource1
00141 #define LEFT_BUTTON_EXTI_IRQn            EXTI1_IRQn  
00142 /**
00143  * @brief Joystick Up push-button
00144  */
00145 #define UP_BUTTON_PIN                    GPIO_Pin_8
00146 #define UP_BUTTON_GPIO_PORT              GPIOD
00147 #define UP_BUTTON_GPIO_CLK               RCC_APB2Periph_GPIOD
00148 #define UP_BUTTON_EXTI_LINE              EXTI_Line8
00149 #define UP_BUTTON_EXTI_PORT_SOURCE       GPIO_PortSourceGPIOD
00150 #define UP_BUTTON_EXTI_PIN_SOURCE        GPIO_PinSource8
00151 #define UP_BUTTON_EXTI_IRQn              EXTI9_5_IRQn  
00152 /**
00153  * @brief Joystick Down push-button
00154  */  
00155 #define DOWN_BUTTON_PIN                  GPIO_Pin_14
00156 #define DOWN_BUTTON_GPIO_PORT            GPIOD
00157 #define DOWN_BUTTON_GPIO_CLK             RCC_APB2Periph_GPIOD
00158 #define DOWN_BUTTON_EXTI_LINE            EXTI_Line14
00159 #define DOWN_BUTTON_EXTI_PORT_SOURCE     GPIO_PortSourceGPIOD
00160 #define DOWN_BUTTON_EXTI_PIN_SOURCE      GPIO_PinSource14
00161 #define DOWN_BUTTON_EXTI_IRQn            EXTI15_10_IRQn  
00162 /**
00163  * @brief Joystick Sel push-button
00164  */
00165 #define SEL_BUTTON_PIN                   GPIO_Pin_12
00166 #define SEL_BUTTON_GPIO_PORT             GPIOD
00167 #define SEL_BUTTON_GPIO_CLK              RCC_APB2Periph_GPIOD
00168 #define SEL_BUTTON_EXTI_LINE             EXTI_Line12
00169 #define SEL_BUTTON_EXTI_PORT_SOURCE      GPIO_PortSourceGPIOD
00170 #define SEL_BUTTON_EXTI_PIN_SOURCE       GPIO_PinSource12
00171 #define SEL_BUTTON_EXTI_IRQn             EXTI15_10_IRQn   
00172 /**
00173   * @}
00174   */ 
00175 
00176 /** @addtogroup STM3210B_EVAL_LOW_LEVEL_COM
00177   * @{
00178   */
00179 #define COMn                             2
00180 
00181 /**
00182  * @brief Definition for COM port1, connected to USART1
00183  */ 
00184 #define EVAL_COM1                        USART1
00185 #define EVAL_COM1_CLK                    RCC_APB2Periph_USART1
00186 #define EVAL_COM1_TX_PIN                 GPIO_Pin_9
00187 #define EVAL_COM1_TX_GPIO_PORT           GPIOA
00188 #define EVAL_COM1_TX_GPIO_CLK            RCC_APB2Periph_GPIOA
00189 #define EVAL_COM1_RX_PIN                 GPIO_Pin_10
00190 #define EVAL_COM1_RX_GPIO_PORT           GPIOA
00191 #define EVAL_COM1_RX_GPIO_CLK            RCC_APB2Periph_GPIOA
00192 #define EVAL_COM1_IRQn                   USART1_IRQn
00193 
00194 /**
00195  * @brief Definition for COM port2, connected to USART2 (USART2 pins remapped on GPIOD)
00196  */ 
00197 #define EVAL_COM2                        USART2
00198 #define EVAL_COM2_CLK                    RCC_APB1Periph_USART2
00199 #define EVAL_COM2_TX_PIN                 GPIO_Pin_5
00200 #define EVAL_COM2_TX_GPIO_PORT           GPIOD
00201 #define EVAL_COM2_TX_GPIO_CLK            RCC_APB2Periph_GPIOD
00202 #define EVAL_COM2_RX_PIN                 GPIO_Pin_6
00203 #define EVAL_COM2_RX_GPIO_PORT           GPIOD
00204 #define EVAL_COM2_RX_GPIO_CLK            RCC_APB2Periph_GPIOD
00205 #define EVAL_COM2_IRQn                   USART2_IRQn
00206 
00207 /**
00208   * @}
00209   */ 
00210 
00211 /** @addtogroup STM3210B_EVAL_LOW_LEVEL_SD_SPI
00212   * @{
00213   */
00214 /**
00215   * @brief  SD SPI Interface pins
00216   */
00217 #define SD_SPI                           SPI1
00218 #define SD_SPI_CLK                       RCC_APB2Periph_SPI1
00219 #define SD_SPI_SCK_PIN                   GPIO_Pin_5                  /* PA.05 */
00220 #define SD_SPI_SCK_GPIO_PORT             GPIOA                       /* GPIOA */
00221 #define SD_SPI_SCK_GPIO_CLK              RCC_APB2Periph_GPIOA
00222 #define SD_SPI_MISO_PIN                  GPIO_Pin_6                  /* PA.06 */
00223 #define SD_SPI_MISO_GPIO_PORT            GPIOA                       /* GPIOA */
00224 #define SD_SPI_MISO_GPIO_CLK             RCC_APB2Periph_GPIOA
00225 #define SD_SPI_MOSI_PIN                  GPIO_Pin_7                  /* PA.07 */
00226 #define SD_SPI_MOSI_GPIO_PORT            GPIOA                       /* GPIOA */
00227 #define SD_SPI_MOSI_GPIO_CLK             RCC_APB2Periph_GPIOA
00228 #define SD_CS_PIN                        GPIO_Pin_12                 /* PC.12 */
00229 #define SD_CS_GPIO_PORT                  GPIOC                       /* GPIOC */
00230 #define SD_CS_GPIO_CLK                   RCC_APB2Periph_GPIOC
00231 #define SD_DETECT_PIN                    GPIO_Pin_7                  /* PE.07 */
00232 #define SD_DETECT_GPIO_PORT              GPIOE                       /* GPIOE */
00233 #define SD_DETECT_GPIO_CLK               RCC_APB2Periph_GPIOE
00234 
00235 /**
00236   * @}
00237   */
00238 
00239 /** @addtogroup STM3210B_EVAL_LOW_LEVEL_M25P_FLASH_SPI
00240   * @{
00241   */
00242 /**
00243   * @brief  M25P FLASH SPI Interface pins
00244   */  
00245 #define sFLASH_SPI                       SPI1
00246 #define sFLASH_SPI_CLK                   RCC_APB2Periph_SPI1
00247 #define sFLASH_SPI_SCK_PIN               GPIO_Pin_5                  /* PA.05 */
00248 #define sFLASH_SPI_SCK_GPIO_PORT         GPIOA                       /* GPIOA */
00249 #define sFLASH_SPI_SCK_GPIO_CLK          RCC_APB2Periph_GPIOA
00250 #define sFLASH_SPI_MISO_PIN              GPIO_Pin_6                  /* PA.06 */
00251 #define sFLASH_SPI_MISO_GPIO_PORT        GPIOA                       /* GPIOA */
00252 #define sFLASH_SPI_MISO_GPIO_CLK         RCC_APB2Periph_GPIOA
00253 #define sFLASH_SPI_MOSI_PIN              GPIO_Pin_7                  /* PA.07 */
00254 #define sFLASH_SPI_MOSI_GPIO_PORT        GPIOA                       /* GPIOA */
00255 #define sFLASH_SPI_MOSI_GPIO_CLK         RCC_APB2Periph_GPIOA
00256 #define sFLASH_CS_PIN                    GPIO_Pin_4                  /* PA.04 */
00257 #define sFLASH_CS_GPIO_PORT              GPIOA                       /* GPIOA */
00258 #define sFLASH_CS_GPIO_CLK               RCC_APB2Periph_GPIOA 
00259 
00260 /**
00261   * @}
00262   */
00263 
00264 /** @addtogroup STM3210B_EVAL_LOW_LEVEL_TSENSOR_I2C
00265   * @{
00266   */
00267 /**
00268   * @brief  LM75 Temperature Sensor I2C Interface pins
00269   */  
00270 #define LM75_I2C                         I2C1
00271 #define LM75_I2C_CLK                     RCC_APB1Periph_I2C1
00272 #define LM75_I2C_SCL_PIN                 GPIO_Pin_6                  /* PB.06 */
00273 #define LM75_I2C_SCL_GPIO_PORT           GPIOB                       /* GPIOB */
00274 #define LM75_I2C_SCL_GPIO_CLK            RCC_APB2Periph_GPIOB
00275 #define LM75_I2C_SDA_PIN                 GPIO_Pin_7                  /* PB.07 */
00276 #define LM75_I2C_SDA_GPIO_PORT           GPIOB                       /* GPIOB */
00277 #define LM75_I2C_SDA_GPIO_CLK            RCC_APB2Periph_GPIOB
00278 #define LM75_I2C_SMBUSALERT_PIN          GPIO_Pin_5                  /* PB.05 */
00279 #define LM75_I2C_SMBUSALERT_GPIO_PORT    GPIOB                       /* GPIOB */
00280 #define LM75_I2C_SMBUSALERT_GPIO_CLK     RCC_APB2Periph_GPIOB
00281 #define LM75_I2C_DR                      ((uint32_t)0x40005410)
00282 
00283 #define LM75_DMA_CLK                     RCC_AHBPeriph_DMA1
00284 #define LM75_DMA_TX_CHANNEL              DMA1_Channel6
00285 #define LM75_DMA_RX_CHANNEL              DMA1_Channel7
00286 #define LM75_DMA_TX_TCFLAG               DMA1_FLAG_TC6
00287 #define LM75_DMA_RX_TCFLAG               DMA1_FLAG_TC7 
00288 
00289 /**
00290   * @}
00291   */
00292     
00293 /**
00294   * @}
00295   */ 
00296   
00297 /** @defgroup STM3210B_EVAL_LOW_LEVEL_Exported_Macros
00298   * @{
00299   */ 
00300 /**
00301   * @}
00302   */ 
00303 
00304 /** @defgroup STM3210B_EVAL_LOW_LEVEL_Exported_Functions
00305   * @{
00306   */ 
00307 void STM_EVAL_LEDInit(Led_TypeDef Led);
00308 void STM_EVAL_LEDOn(Led_TypeDef Led);
00309 void STM_EVAL_LEDOff(Led_TypeDef Led);
00310 void STM_EVAL_LEDToggle(Led_TypeDef Led);
00311 void STM_EVAL_PBInit(Button_TypeDef Button, ButtonMode_TypeDef Button_Mode);
00312 uint32_t STM_EVAL_PBGetState(Button_TypeDef Button);
00313 void STM_EVAL_COMInit(COM_TypeDef COM, USART_InitTypeDef* USART_InitStruct);
00314 void SD_LowLevel_DeInit(void);
00315 void SD_LowLevel_Init(void); 
00316 void sFLASH_LowLevel_DeInit(void);
00317 void sFLASH_LowLevel_Init(void); 
00318 void LM75_LowLevel_DeInit(void);
00319 void LM75_LowLevel_Init(void); 
00320  
00321 /**
00322   * @}
00323   */ 
00324     
00325 #ifdef __cplusplus
00326 }
00327 #endif
00328   
00329 #endif /* __STM3210B_EVAL_H */
00330 /**
00331   * @}
00332   */ 
00333 
00334 /**
00335   * @}
00336   */ 
00337 
00338 /**
00339   * @}
00340   */  
00341 
00342 /**
00343   * @}
00344   */    
00345 
00346 /******************* (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