stm32100e_eval.h

Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32100e_eval.h
00004   * @author  MCD Application Team
00005   * @version V4.3.0
00006   * @date    10/15/2010
00007   * @brief   This file contains definitions for STM32100E_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 __STM32100E_EVAL_H
00025 #define __STM32100E_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 STM32100E_EVAL
00043   * @{
00044   */ 
00045 
00046 /** @addtogroup STM32100E_EVAL_LOW_LEVEL
00047   * @{
00048   */ 
00049   
00050 /** @defgroup STM32100E_EVAL_LOW_LEVEL_Exported_Types
00051   * @{
00052   */
00053 /**
00054   * @}
00055   */ 
00056 
00057 /** @defgroup STM32100E_EVAL_LOW_LEVEL_Exported_Constants
00058   * @{
00059   */ 
00060 /** @addtogroup STM32100E_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 STM32100E_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_11
00154 #define DOWN_BUTTON_GPIO_PORT            GPIOG
00155 #define DOWN_BUTTON_GPIO_CLK             RCC_APB2Periph_GPIOG
00156 #define DOWN_BUTTON_EXTI_LINE            EXTI_Line11
00157 #define DOWN_BUTTON_EXTI_PORT_SOURCE     GPIO_PortSourceGPIOG
00158 #define DOWN_BUTTON_EXTI_PIN_SOURCE      GPIO_PinSource11
00159 #define DOWN_BUTTON_EXTI_IRQn            EXTI15_10_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 STM32100E_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 STM32100E_EVAL_LOW_LEVEL_SD_FLASH
00210   * @{
00211   */
00212 /**
00213   * @brief  SD SPI Interface pins
00214   */
00215 #define SD_SPI                           SPI2
00216 #define SD_SPI_CLK                       RCC_APB1Periph_SPI2
00217 #define SD_SPI_SCK_PIN                   GPIO_Pin_13                 /* PC.13 */
00218 #define SD_SPI_SCK_GPIO_PORT             GPIOB                       /* GPIOB */
00219 #define SD_SPI_SCK_GPIO_CLK              RCC_APB2Periph_GPIOB
00220 #define SD_SPI_MISO_PIN                  GPIO_Pin_14                 /* PC.14 */
00221 #define SD_SPI_MISO_GPIO_PORT            GPIOB                       /* GPIOB */
00222 #define SD_SPI_MISO_GPIO_CLK             RCC_APB2Periph_GPIOB
00223 #define SD_SPI_MOSI_PIN                  GPIO_Pin_15                 /* PB.15 */
00224 #define SD_SPI_MOSI_GPIO_PORT            GPIOB                       /* GPIOB */
00225 #define SD_SPI_MOSI_GPIO_CLK             RCC_APB2Periph_GPIOB
00226 #define SD_CS_PIN                        GPIO_Pin_6                  /* PG.06 */
00227 #define SD_CS_GPIO_PORT                  GPIOG                       /* GPIOG */
00228 #define SD_CS_GPIO_CLK                   RCC_APB2Periph_GPIOG
00229 #define SD_DETECT_PIN                    GPIO_Pin_11                 /* PF.11 */
00230 #define SD_DETECT_GPIO_PORT              GPIOF                       /* GPIOF */
00231 #define SD_DETECT_GPIO_CLK               RCC_APB2Periph_GPIOF
00232 
00233 /**
00234   * @}
00235   */
00236 
00237 /** @addtogroup STM3210C_EVAL_LOW_LEVEL_I2C_EE
00238   * @{
00239   */
00240 /**
00241   * @brief  I2C EEPROM Interface pins
00242   */  
00243 #define sEE_I2C                          I2C2
00244 #define sEE_I2C_CLK                      RCC_APB1Periph_I2C2
00245 #define sEE_I2C_SCL_PIN                  GPIO_Pin_10                 /* PB.10 */
00246 #define sEE_I2C_SCL_GPIO_PORT            GPIOB                       /* GPIOB */
00247 #define sEE_I2C_SCL_GPIO_CLK             RCC_APB2Periph_GPIOB
00248 #define sEE_I2C_SDA_PIN                  GPIO_Pin_11                  /* PB.11 */
00249 #define sEE_I2C_SDA_GPIO_PORT            GPIOB                       /* GPIOB */
00250 #define sEE_I2C_SDA_GPIO_CLK             RCC_APB2Periph_GPIOB
00251 #define sEE_M24C64_32
00252 
00253 #define sEE_I2C_DMA                      DMA1   
00254 #define sEE_I2C_DMA_CHANNEL_TX           DMA1_Channel4
00255 #define sEE_I2C_DMA_CHANNEL_RX           DMA1_Channel5 
00256 #define sEE_I2C_DMA_FLAG_TX_TC           DMA1_IT_TC4   
00257 #define sEE_I2C_DMA_FLAG_TX_GL           DMA1_IT_GL4 
00258 #define sEE_I2C_DMA_FLAG_RX_TC           DMA1_IT_TC5 
00259 #define sEE_I2C_DMA_FLAG_RX_GL           DMA1_IT_GL5    
00260 #define sEE_I2C_DMA_CLK                  RCC_AHBPeriph_DMA1
00261 #define sEE_I2C_DR_Address               ((uint32_t)0x40005810)
00262 #define sEE_USE_DMA
00263    
00264 #define sEE_I2C_DMA_TX_IRQn              DMA1_Channel4_IRQn
00265 #define sEE_I2C_DMA_RX_IRQn              DMA1_Channel5_IRQn
00266 #define sEE_I2C_DMA_TX_IRQHandler        DMA1_Channel4_IRQHandler
00267 #define sEE_I2C_DMA_RX_IRQHandler        DMA1_Channel5_IRQHandler  
00268 #define sEE_I2C_DMA_PREPRIO              0
00269 #define sEE_I2C_DMA_SUBPRIO              0
00270  
00271 #define sEE_DIRECTION_TX                 0
00272 #define sEE_DIRECTION_RX                 1 
00273 
00274 /* Time constant for the delay caclulation allowing to have a millisecond 
00275    incrementing counter. This value should be equal to (System Clock / 1000).
00276    ie. if system clock = 24MHz then sEE_TIME_CONST should be 24. */
00277 #define sEE_TIME_CONST          24 
00278 
00279 /**
00280   * @}
00281   */ 
00282   
00283 /** @addtogroup STM32100E_EVAL_LOW_LEVEL_M25P_FLASH_SPI
00284   * @{
00285   */
00286 /**
00287   * @brief  M25P FLASH SPI Interface pins
00288   */  
00289 #define sFLASH_SPI                       SPI1
00290 #define sFLASH_SPI_CLK                   RCC_APB2Periph_SPI1
00291 #define sFLASH_SPI_SCK_PIN               GPIO_Pin_5                  /* PA.05 */
00292 #define sFLASH_SPI_SCK_GPIO_PORT         GPIOA                       /* GPIOA */
00293 #define sFLASH_SPI_SCK_GPIO_CLK          RCC_APB2Periph_GPIOA
00294 #define sFLASH_SPI_MISO_PIN              GPIO_Pin_6                  /* PA.06 */
00295 #define sFLASH_SPI_MISO_GPIO_PORT        GPIOA                       /* GPIOA */
00296 #define sFLASH_SPI_MISO_GPIO_CLK         RCC_APB2Periph_GPIOA
00297 #define sFLASH_SPI_MOSI_PIN              GPIO_Pin_7                  /* PA.07 */
00298 #define sFLASH_SPI_MOSI_GPIO_PORT        GPIOA                       /* GPIOA */
00299 #define sFLASH_SPI_MOSI_GPIO_CLK         RCC_APB2Periph_GPIOA
00300 #define sFLASH_CS_PIN                    GPIO_Pin_2                  /* PB.02 */
00301 #define sFLASH_CS_GPIO_PORT              GPIOB                       /* GPIOB */
00302 #define sFLASH_CS_GPIO_CLK               RCC_APB2Periph_GPIOB
00303 
00304 /**
00305   * @}
00306   */
00307 
00308 
00309 /** @addtogroup STM32100E_EVAL_LOW_LEVEL_TSENSOR_I2C
00310   * @{
00311   */
00312 /**
00313   * @brief  LM75 Temperature Sensor I2C Interface pins
00314   */  
00315 #define LM75_I2C                         I2C2
00316 #define LM75_I2C_CLK                     RCC_APB1Periph_I2C2
00317 #define LM75_I2C_SCL_PIN                 GPIO_Pin_10                 /* PB.10 */
00318 #define LM75_I2C_SCL_GPIO_PORT           GPIOB                       /* GPIOB */
00319 #define LM75_I2C_SCL_GPIO_CLK            RCC_APB2Periph_GPIOB
00320 #define LM75_I2C_SDA_PIN                 GPIO_Pin_11                 /* PB.11 */
00321 #define LM75_I2C_SDA_GPIO_PORT           GPIOB                       /* GPIOB */
00322 #define LM75_I2C_SDA_GPIO_CLK            RCC_APB2Periph_GPIOB
00323 #define LM75_I2C_SMBUSALERT_PIN          GPIO_Pin_12                 /* PB.12 */
00324 #define LM75_I2C_SMBUSALERT_GPIO_PORT    GPIOB                       /* GPIOB */
00325 #define LM75_I2C_SMBUSALERT_GPIO_CLK     RCC_APB2Periph_GPIOB
00326 #define LM75_I2C_DR                      ((uint32_t)0x40005810)
00327 
00328 #define LM75_DMA_CLK                     RCC_AHBPeriph_DMA1
00329 #define LM75_DMA_TX_CHANNEL              DMA1_Channel4
00330 #define LM75_DMA_RX_CHANNEL              DMA1_Channel5
00331 #define LM75_DMA_TX_TCFLAG               DMA1_FLAG_TC4
00332 #define LM75_DMA_RX_TCFLAG               DMA1_FLAG_TC5   
00333    
00334 /**
00335   * @}
00336   */
00337   
00338 /**
00339   * @}
00340   */
00341   
00342 /** @defgroup STM32100E_EVAL_LOW_LEVEL_Exported_Macros
00343   * @{
00344   */ 
00345 /**
00346   * @}
00347   */ 
00348 
00349 /** @defgroup STM32100E_EVAL_LOW_LEVEL_Exported_Functions
00350   * @{
00351   */ 
00352 void STM_EVAL_LEDInit(Led_TypeDef Led);
00353 void STM_EVAL_LEDOn(Led_TypeDef Led);
00354 void STM_EVAL_LEDOff(Led_TypeDef Led);
00355 void STM_EVAL_LEDToggle(Led_TypeDef Led);
00356 void STM_EVAL_PBInit(Button_TypeDef Button, ButtonMode_TypeDef Button_Mode);
00357 uint32_t STM_EVAL_PBGetState(Button_TypeDef Button);
00358 void STM_EVAL_COMInit(COM_TypeDef COM, USART_InitTypeDef* USART_InitStruct);
00359 void SD_LowLevel_DeInit(void);
00360 void SD_LowLevel_Init(void); 
00361 void sEE_LowLevel_DeInit(void);
00362 void sEE_LowLevel_Init(void);
00363 void sEE_LowLevel_DMAConfig(uint32_t pBuffer, uint32_t BufferSize, uint32_t Direction); 
00364 void sFLASH_LowLevel_DeInit(void);
00365 void sFLASH_LowLevel_Init(void); 
00366 void LM75_LowLevel_DeInit(void);
00367 void LM75_LowLevel_Init(void); 
00368 /**
00369   * @}
00370   */
00371 #ifdef __cplusplus
00372 }
00373 #endif
00374   
00375 #endif /* __STM32100E_EVAL_H */
00376 /**
00377   * @}
00378   */ 
00379 
00380 /**
00381   * @}
00382   */ 
00383 
00384 /**
00385   * @}
00386   */
00387 
00388 /**
00389   * @}
00390   */
00391   
00392 /******************* (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