STM32F10x_StdPeriph_Examples/FSMC/NOR_CodeExecute/binary/main.c

Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    FSMC/NOR_CodeExecute/binary/main.c 
00004   * @author  MCD Application Team
00005   * @version V3.4.0
00006   * @date    10/15/2010
00007   * @brief   Main program body.
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 /* Includes ------------------------------------------------------------------*/
00022 #include "stm32f10x.h"
00023 #include "stm32_eval.h"
00024 
00025 /** @addtogroup STM32F10x_StdPeriph_Examples
00026   * @{
00027   */
00028 
00029 /** @addtogroup FSMC_NOR_CodeExecute_binary
00030   * @{
00031   */ 
00032 
00033 /* Private typedef -----------------------------------------------------------*/
00034 /* Private define ------------------------------------------------------------*/
00035 /* Private macro -------------------------------------------------------------*/
00036 /* Private variables ---------------------------------------------------------*/
00037 /* Private function prototypes -----------------------------------------------*/
00038 void Delay(__IO uint32_t nCount);
00039 
00040 /* Private functions ---------------------------------------------------------*/
00041 
00042 /**
00043   * @brief   Main program.
00044   * @param  None
00045   * @retval None
00046   */
00047 int main(void)
00048 {
00049   /*!< At this stage the microcontroller clock setting is already configured, 
00050        this is done through SystemInit() function which is called from startup
00051        file (startup_stm32f10x_xx.s) before to branch to application main.
00052        To reconfigure the default setting of SystemInit() function, refer to
00053        system_stm32f10x.c file
00054      */     
00055        
00056   /* Initialize Leds mounted on STM3210X-EVAL board */
00057   STM_EVAL_LEDInit(LED1);
00058   STM_EVAL_LEDInit(LED2);
00059   STM_EVAL_LEDInit(LED3);
00060   STM_EVAL_LEDInit(LED4);
00061 
00062   while (1)
00063   {
00064     /* Turn on LED1 */
00065     STM_EVAL_LEDOn(LED1);
00066     /* Insert delay */
00067     Delay(0xAFFFF);
00068 
00069     /* Turn on LED2 */
00070     STM_EVAL_LEDOn(LED2);
00071     /* Turn on LED3 */
00072     STM_EVAL_LEDOn(LED3);
00073     /* Turn off LED1 */
00074     STM_EVAL_LEDOff(LED1);
00075     /* Insert delay */
00076     Delay(0xAFFFF);
00077 
00078     /* Turn on LED4 */
00079     STM_EVAL_LEDOn(LED4);
00080     /* Turn off LED2 */
00081     STM_EVAL_LEDOff(LED2);
00082     /* Turn off LED3 */
00083     STM_EVAL_LEDOff(LED3);
00084     /* Insert delay */
00085     Delay(0xAFFFF);
00086 
00087     /* Turn off LED4 */
00088     STM_EVAL_LEDOff(LED4);
00089   }
00090 }
00091 
00092 /**
00093   * @brief  Inserts a delay time.
00094   * @param  nCount: specifies the delay time length.
00095   * @retval None
00096   */
00097 void Delay(__IO uint32_t nCount)
00098 {
00099   for(; nCount != 0; nCount--);
00100 }
00101 
00102 #ifdef  USE_FULL_ASSERT
00103 
00104 /**
00105   * @brief  Reports the name of the source file and the source line number
00106   *         where the assert_param error has occurred.
00107   * @param  file: pointer to the source file name
00108   * @param  line: assert_param error line source number
00109   * @retval None
00110   */
00111 void assert_failed(uint8_t* file, uint32_t line)
00112 { 
00113   /* User can add his own implementation to report the file name and line number,
00114      ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
00115 
00116   /* Infinite loop */
00117   while (1)
00118   {
00119   }
00120 }
00121 #endif
00122 
00123 /**
00124   * @}
00125   */ 
00126 
00127 /**
00128   * @}
00129   */ 
00130 
00131 /******************* (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