DMA/SPI_RAM/platform_config.h

Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    DMA/SPI_RAM/platform_config.h 
00004   * @author  MCD Application Team
00005   * @version V3.4.0
00006   * @date    10/15/2010
00007   * @brief   Evaluation board specific configuration file.
00008   ******************************************************************************
00009   * @copy
00010   *
00011   * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
00012   * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
00013   * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
00014   * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
00015   * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
00016   * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
00017   *
00018   * <h2><center>&copy; COPYRIGHT 2010 STMicroelectronics</center></h2>
00019   */ 
00020 
00021 /* Define to prevent recursive inclusion -------------------------------------*/
00022 #ifndef __PLATFORM_CONFIG_H
00023 #define __PLATFORM_CONFIG_H
00024 
00025 /* Includes ------------------------------------------------------------------*/
00026 
00027 /* Exported types ------------------------------------------------------------*/
00028 /* Exported constants --------------------------------------------------------*/
00029 /* Uncomment the line corresponding to the STMicroelectronics evaluation board
00030    used to run the example */
00031 #if !defined (USE_STM32100E_EVAL) && !defined (USE_STM32100B_EVAL) && !defined (USE_STM3210B_EVAL) &&  !defined (USE_STM3210E_EVAL) &&  !defined (USE_STM3210C_EVAL)
00032  //#define USE_STM32100B_EVAL
00033  //#define USE_STM3210B_EVAL
00034  //#define USE_STM3210E_EVAL
00035  //#define USE_STM32100E_EVAL
00036  #define USE_STM3210C_EVAL
00037 #endif
00038 
00039 /* Define the STM32F10x hardware depending on the used evaluation board */
00040 #if defined (USE_STM3210B_EVAL) || defined (USE_STM3210E_EVAL) || defined(USE_STM32100B_EVAL) || defined (USE_STM32100E_EVAL)
00041   #define SPI_MASTER                   SPI1
00042   #define SPI_MASTER_CLK               RCC_APB2Periph_SPI1
00043   #define SPI_MASTER_GPIO              GPIOA
00044   #define SPI_MASTER_GPIO_CLK          RCC_APB2Periph_GPIOA  
00045   #define SPI_MASTER_PIN_SCK           GPIO_Pin_5
00046   #define SPI_MASTER_PIN_MISO          GPIO_Pin_6
00047   #define SPI_MASTER_PIN_MOSI          GPIO_Pin_7
00048   #define SPI_MASTER_DMA               DMA1
00049   #define SPI_MASTER_DMA_CLK           RCC_AHBPeriph_DMA1  
00050   #define SPI_MASTER_Rx_DMA_Channel    DMA1_Channel2
00051   #define SPI_MASTER_Rx_DMA_FLAG       DMA1_FLAG_TC2
00052   #define SPI_MASTER_Tx_DMA_Channel    DMA1_Channel3
00053   #define SPI_MASTER_Tx_DMA_FLAG       DMA1_FLAG_TC3  
00054   #define SPI_MASTER_DR_Base           0x4001300C
00055   
00056   #define SPI_SLAVE                    SPI2
00057   #define SPI_SLAVE_CLK                RCC_APB1Periph_SPI2
00058   #define SPI_SLAVE_GPIO               GPIOB
00059   #define SPI_SLAVE_GPIO_CLK           RCC_APB2Periph_GPIOB 
00060   #define SPI_SLAVE_PIN_SCK            GPIO_Pin_13
00061   #define SPI_SLAVE_PIN_MISO           GPIO_Pin_14
00062   #define SPI_SLAVE_PIN_MOSI           GPIO_Pin_15 
00063   #define SPI_SLAVE_DMA                DMA1
00064   #define SPI_SLAVE_DMA_CLK            RCC_AHBPeriph_DMA1  
00065   #define SPI_SLAVE_Rx_DMA_Channel     DMA1_Channel4
00066   #define SPI_SLAVE_Rx_DMA_FLAG        DMA1_FLAG_TC4
00067   #define SPI_SLAVE_Tx_DMA_Channel     DMA1_Channel5
00068   #define SPI_SLAVE_Tx_DMA_FLAG        DMA1_FLAG_TC5  
00069   #define SPI_SLAVE_DR_Base            0x4000380C
00070           
00071 #elif defined (USE_STM3210C_EVAL)
00072   #define SPI_MASTER                   SPI3   /* SPI pins are remapped by software */
00073   #define SPI_MASTER_CLK               RCC_APB1Periph_SPI3
00074   #define SPI_MASTER_GPIO              GPIOC
00075   #define SPI_MASTER_GPIO_CLK          RCC_APB2Periph_GPIOC  
00076   #define SPI_MASTER_PIN_SCK           GPIO_Pin_10
00077   #define SPI_MASTER_PIN_MISO          GPIO_Pin_11
00078   #define SPI_MASTER_PIN_MOSI          GPIO_Pin_12
00079   #define SPI_MASTER_DMA               DMA2
00080   #define SPI_MASTER_DMA_CLK           RCC_AHBPeriph_DMA2  
00081   #define SPI_MASTER_Rx_DMA_Channel    DMA2_Channel1
00082   #define SPI_MASTER_Rx_DMA_FLAG       DMA2_FLAG_TC1
00083   #define SPI_MASTER_Tx_DMA_Channel    DMA2_Channel2
00084   #define SPI_MASTER_Tx_DMA_FLAG       DMA2_FLAG_TC2  
00085   #define SPI_MASTER_DR_Base           0x40003C0C
00086   
00087   #define SPI_SLAVE                    SPI2
00088   #define SPI_SLAVE_CLK                RCC_APB1Periph_SPI2
00089   #define SPI_SLAVE_GPIO               GPIOB
00090   #define SPI_SLAVE_GPIO_CLK           RCC_APB2Periph_GPIOB
00091   #define SPI_SLAVE_PIN_SCK            GPIO_Pin_13
00092   #define SPI_SLAVE_PIN_MISO           GPIO_Pin_14
00093   #define SPI_SLAVE_PIN_MOSI           GPIO_Pin_15
00094   #define SPI_SLAVE_DMA                DMA1
00095   #define SPI_SLAVE_DMA_CLK            RCC_AHBPeriph_DMA1
00096   #define SPI_SLAVE_Rx_DMA_Channel     DMA1_Channel4
00097   #define SPI_SLAVE_Rx_DMA_FLAG        DMA1_FLAG_TC4
00098   #define SPI_SLAVE_Tx_DMA_Channel     DMA1_Channel5
00099   #define SPI_SLAVE_Tx_DMA_FLAG        DMA1_FLAG_TC5  
00100   #define SPI_SLAVE_DR_Base            0x4000380C 
00101 
00102 #endif
00103 
00104 /* Exported macro ------------------------------------------------------------*/
00105 /* Exported functions ------------------------------------------------------- */
00106 
00107 #endif /* __PLATFORM_CONFIG_H */
00108 
00109 /******************* (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