stm3210c_eval.h

Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm3210c_eval.h
00004   * @author  MCD Application Team
00005   * @version V4.3.0
00006   * @date    10/15/2010
00007   * @brief   This file contains definitions for STM3210C_EVAL's Leds, push-buttons
00008   *          COM ports, SD Card on SPI and sEE on I2C hardware resources.
00009   ******************************************************************************
00010   * @copy
00011   *
00012   * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
00013   * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
00014   * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
00015   * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
00016   * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
00017   * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
00018   *
00019   * <h2><center>&copy; COPYRIGHT 210 STMicroelectronics</center></h2>
00020   */ 
00021   
00022 /* Define to prevent recursive inclusion -------------------------------------*/
00023 #ifndef __STM3210C_EVAL_H
00024 #define __STM3210C_EVAL_H
00025 
00026 #ifdef __cplusplus
00027  extern "C" {
00028 #endif
00029 
00030 /* Includes ------------------------------------------------------------------*/
00031 #include "stm32_eval.h"
00032 
00033 /** @addtogroup Utilities
00034   * @{
00035   */
00036 
00037 /** @addtogroup STM32_EVAL
00038   * @{
00039   */
00040     
00041 /** @addtogroup STM3210C_EVAL
00042   * @{
00043   */ 
00044 
00045 /** @addtogroup STM3210C_EVAL_LOW_LEVEL
00046   * @{
00047   */ 
00048   
00049 /** @defgroup STM3210C_EVAL_LOW_LEVEL_Exported_Types
00050   * @{
00051   */
00052 /**
00053   * @}
00054   */ 
00055 
00056 /** @defgroup STM3210C_EVAL_LOW_LEVEL_Exported_Constants
00057   * @{
00058   */ 
00059 
00060 /** @addtogroup STM3210C_EVAL_LOW_LEVEL_LED
00061   * @{
00062   */
00063 #define LEDn                             4
00064 
00065 #define LED1_PIN                         GPIO_Pin_7
00066 #define LED1_GPIO_PORT                   GPIOD
00067 #define LED1_GPIO_CLK                    RCC_APB2Periph_GPIOD  
00068   
00069 #define LED2_PIN                         GPIO_Pin_13
00070 #define LED2_GPIO_PORT                   GPIOD
00071 #define LED2_GPIO_CLK                    RCC_APB2Periph_GPIOD  
00072 
00073 #define LED3_PIN                         GPIO_Pin_3  
00074 #define LED3_GPIO_PORT                   GPIOD
00075 #define LED3_GPIO_CLK                    RCC_APB2Periph_GPIOD  
00076 
00077 #define LED4_PIN                         GPIO_Pin_4  
00078 #define LED4_GPIO_PORT                   GPIOD
00079 #define LED4_GPIO_CLK                    RCC_APB2Periph_GPIOD  
00080 
00081 
00082 /**
00083   * @}
00084   */ 
00085   
00086 /** @addtogroup STM3210C_EVAL_LOW_LEVEL_BUTTON
00087   * @{
00088   */  
00089 #define BUTTONn                          3 /*!< Joystick pins are connected to 
00090                                                 an IO Expander (accessible through 
00091                                                 I2C1 interface) */
00092 
00093 /**
00094  * @brief Wakeup push-button
00095  */
00096 #define WAKEUP_BUTTON_PIN                GPIO_Pin_0
00097 #define WAKEUP_BUTTON_GPIO_PORT          GPIOA
00098 #define WAKEUP_BUTTON_GPIO_CLK           RCC_APB2Periph_GPIOA
00099 #define WAKEUP_BUTTON_EXTI_LINE          EXTI_Line0
00100 #define WAKEUP_BUTTON_EXTI_PORT_SOURCE   GPIO_PortSourceGPIOA
00101 #define WAKEUP_BUTTON_EXTI_PIN_SOURCE    GPIO_PinSource0
00102 #define WAKEUP_BUTTON_EXTI_IRQn          EXTI0_IRQn 
00103 
00104 /**
00105  * @brief Tamper push-button
00106  */
00107 #define TAMPER_BUTTON_PIN                GPIO_Pin_13
00108 #define TAMPER_BUTTON_GPIO_PORT          GPIOC
00109 #define TAMPER_BUTTON_GPIO_CLK           RCC_APB2Periph_GPIOC
00110 #define TAMPER_BUTTON_EXTI_LINE          EXTI_Line13
00111 #define TAMPER_BUTTON_EXTI_PORT_SOURCE   GPIO_PortSourceGPIOC
00112 #define TAMPER_BUTTON_EXTI_PIN_SOURCE    GPIO_PinSource13
00113 #define TAMPER_BUTTON_EXTI_IRQn          EXTI15_10_IRQn 
00114 
00115 /**
00116  * @brief Key push-button
00117  */
00118 #define KEY_BUTTON_PIN                   GPIO_Pin_9
00119 #define KEY_BUTTON_GPIO_PORT             GPIOB
00120 #define KEY_BUTTON_GPIO_CLK              RCC_APB2Periph_GPIOB
00121 #define KEY_BUTTON_EXTI_LINE             EXTI_Line9
00122 #define KEY_BUTTON_EXTI_PORT_SOURCE      GPIO_PortSourceGPIOB
00123 #define KEY_BUTTON_EXTI_PIN_SOURCE       GPIO_PinSource9
00124 #define KEY_BUTTON_EXTI_IRQn             EXTI9_5_IRQn
00125 /**
00126   * @}
00127   */ 
00128 
00129 /** @addtogroup STM3210C_EVAL_LOW_LEVEL_COM
00130   * @{
00131   */
00132 #define COMn                             1
00133 
00134 /**
00135  * @brief Definition for COM port1, connected to USART2 (USART2 pins remapped on GPIOD)
00136  */ 
00137 #define EVAL_COM1                        USART2
00138 #define EVAL_COM1_CLK                    RCC_APB1Periph_USART2
00139 #define EVAL_COM1_TX_PIN                 GPIO_Pin_5
00140 #define EVAL_COM1_TX_GPIO_PORT           GPIOD
00141 #define EVAL_COM1_TX_GPIO_CLK            RCC_APB2Periph_GPIOD
00142 #define EVAL_COM1_RX_PIN                 GPIO_Pin_6
00143 #define EVAL_COM1_RX_GPIO_PORT           GPIOD
00144 #define EVAL_COM1_RX_GPIO_CLK            RCC_APB2Periph_GPIOD
00145 #define EVAL_COM1_IRQn                   USART2_IRQn
00146 
00147 /**
00148   * @}
00149   */ 
00150 
00151 /** @addtogroup STM3210B_EVAL_SD_SPI
00152   * @{
00153   */
00154 /**
00155   * @brief  SD SPI Interface pins
00156   */
00157 #define SD_SPI                           SPI3
00158 #define SD_SPI_CLK                       RCC_APB1Periph_SPI3
00159 #define SD_SPI_SCK_PIN                   GPIO_Pin_10                 /* PC.10 */
00160 #define SD_SPI_SCK_GPIO_PORT             GPIOC                       /* GPIOC */
00161 #define SD_SPI_SCK_GPIO_CLK              RCC_APB2Periph_GPIOC
00162 #define SD_SPI_MISO_PIN                  GPIO_Pin_11                 /* PC.11 */
00163 #define SD_SPI_MISO_GPIO_PORT            GPIOC                       /* GPIOC */
00164 #define SD_SPI_MISO_GPIO_CLK             RCC_APB2Periph_GPIOC
00165 #define SD_SPI_MOSI_PIN                  GPIO_Pin_12                 /* PC.12 */
00166 #define SD_SPI_MOSI_GPIO_PORT            GPIOC                       /* GPIOC */
00167 #define SD_SPI_MOSI_GPIO_CLK             RCC_APB2Periph_GPIOC
00168 #define SD_CS_PIN                        GPIO_Pin_4                  /* PA.04 */
00169 #define SD_CS_GPIO_PORT                  GPIOA                       /* GPIOA */
00170 #define SD_CS_GPIO_CLK                   RCC_APB2Periph_GPIOA
00171 #define SD_DETECT_PIN                    GPIO_Pin_0                  /* PE.00 */
00172 #define SD_DETECT_GPIO_PORT              GPIOE                       /* GPIOE */
00173 #define SD_DETECT_GPIO_CLK               RCC_APB2Periph_GPIOE
00174 
00175 /**
00176   * @}
00177   */
00178 
00179 /** @addtogroup STM3210C_EVAL_LOW_LEVEL_I2C_EE
00180   * @{
00181   */
00182 /**
00183   * @brief  I2C EEPROM Interface pins
00184   */  
00185 #define sEE_I2C                          I2C1
00186 #define sEE_I2C_CLK                      RCC_APB1Periph_I2C1
00187 #define sEE_I2C_SCL_PIN                  GPIO_Pin_6                  /* PB.06 */
00188 #define sEE_I2C_SCL_GPIO_PORT            GPIOB                       /* GPIOB */
00189 #define sEE_I2C_SCL_GPIO_CLK             RCC_APB2Periph_GPIOB
00190 #define sEE_I2C_SDA_PIN                  GPIO_Pin_7                  /* PB.07 */
00191 #define sEE_I2C_SDA_GPIO_PORT            GPIOB                       /* GPIOB */
00192 #define sEE_I2C_SDA_GPIO_CLK             RCC_APB2Periph_GPIOB
00193 #define sEE_M24C64_32
00194 
00195 #define sEE_I2C_DMA                      DMA1   
00196 #define sEE_I2C_DMA_CHANNEL_TX           DMA1_Channel6
00197 #define sEE_I2C_DMA_CHANNEL_RX           DMA1_Channel7 
00198 #define sEE_I2C_DMA_FLAG_TX_TC           DMA1_IT_TC6   
00199 #define sEE_I2C_DMA_FLAG_TX_GL           DMA1_IT_GL6 
00200 #define sEE_I2C_DMA_FLAG_RX_TC           DMA1_IT_TC7 
00201 #define sEE_I2C_DMA_FLAG_RX_GL           DMA1_IT_GL7    
00202 #define sEE_I2C_DMA_CLK                  RCC_AHBPeriph_DMA1
00203 #define sEE_I2C_DR_Address               ((uint32_t)0x40005410)
00204 #define sEE_USE_DMA
00205    
00206 #define sEE_I2C_DMA_TX_IRQn              DMA1_Channel6_IRQn
00207 #define sEE_I2C_DMA_RX_IRQn              DMA1_Channel7_IRQn
00208 #define sEE_I2C_DMA_TX_IRQHandler        DMA1_Channel6_IRQHandler
00209 #define sEE_I2C_DMA_RX_IRQHandler        DMA1_Channel7_IRQHandler   
00210 #define sEE_I2C_DMA_PREPRIO              0
00211 #define sEE_I2C_DMA_SUBPRIO              0   
00212    
00213 #define sEE_DIRECTION_TX                 0
00214 #define sEE_DIRECTION_RX                 1   
00215 
00216 /* Time constant for the delay caclulation allowing to have a millisecond 
00217    incrementing counter. This value should be equal to (System Clock / 1000).
00218    ie. if system clock = 72MHz then sEE_TIME_CONST should be 72. */
00219 #define sEE_TIME_CONST                   72 
00220    
00221 /**
00222   * @}
00223   */
00224    
00225 /**
00226   * @}
00227   */ 
00228   
00229 /** @defgroup STM3210C_EVAL_LOW_LEVEL_Exported_Macros
00230   * @{
00231   */ 
00232 /**
00233   * @}
00234   */ 
00235 
00236 
00237 /** @defgroup STM3210C_EVAL_LOW_LEVEL_Exported_Functions
00238   * @{
00239   */ 
00240 void STM_EVAL_LEDInit(Led_TypeDef Led);
00241 void STM_EVAL_LEDOn(Led_TypeDef Led);
00242 void STM_EVAL_LEDOff(Led_TypeDef Led);
00243 void STM_EVAL_LEDToggle(Led_TypeDef Led);
00244 void STM_EVAL_PBInit(Button_TypeDef Button, ButtonMode_TypeDef Button_Mode);
00245 uint32_t STM_EVAL_PBGetState(Button_TypeDef Button);
00246 void STM_EVAL_COMInit(COM_TypeDef COM, USART_InitTypeDef* USART_InitStruct); 
00247 void SD_LowLevel_DeInit(void);
00248 void SD_LowLevel_Init(void); 
00249 void sEE_LowLevel_DeInit(void);
00250 void sEE_LowLevel_Init(void); 
00251 void sEE_LowLevel_DMAConfig(uint32_t pBuffer, uint32_t BufferSize, uint32_t Direction);
00252 /**
00253   * @}
00254   */
00255   
00256 #ifdef __cplusplus
00257 }
00258 #endif
00259 
00260 #endif /* __STM3210C_EVAL_H */
00261 /**
00262   * @}
00263   */ 
00264 
00265 /**
00266   * @}
00267   */ 
00268 
00269 /**
00270   * @}
00271   */
00272 
00273 /**
00274   * @}
00275   */
00276     
00277 /******************* (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