stm32100b_eval.h

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