STM32F10x_StdPeriph_Examples/EXTI/main.c

Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    EXTI/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 EXTI_Example
00030   * @{
00031   */ 
00032 
00033 /* Private typedef -----------------------------------------------------------*/
00034 /* Private define ------------------------------------------------------------*/
00035 /* Private macro -------------------------------------------------------------*/
00036 /* Private variables ---------------------------------------------------------*/
00037 /* Private function prototypes -----------------------------------------------*/
00038 /* Private functions ---------------------------------------------------------*/
00039 
00040 /**
00041   * @brief  Main program.
00042   * @param  None
00043   * @retval None
00044   */
00045 int main(void)
00046 {
00047   /*!< At this stage the microcontroller clock setting is already configured, 
00048        this is done through SystemInit() function which is called from startup
00049        file (startup_stm32f10x_xx.s) before to branch to application main.
00050        To reconfigure the default setting of SystemInit() function, refer to
00051        system_stm32f10x.c file
00052      */     
00053          
00054   /* Initialize LED1 and Key Button mounted on STM3210X-EVAL board */       
00055   STM_EVAL_LEDInit(LED1);
00056   STM_EVAL_PBInit(BUTTON_KEY, BUTTON_MODE_EXTI);  
00057 
00058   /* Generate software interrupt: simulate a falling edge applied on Key Button EXTI line */
00059   EXTI_GenerateSWInterrupt(KEY_BUTTON_EXTI_LINE);
00060         
00061   while (1)
00062   {
00063   }
00064 }
00065 
00066 #ifdef  USE_FULL_ASSERT
00067 /**
00068   * @brief  Reports the name of the source file and the source line number
00069   *         where the assert_param error has occurred.
00070   * @param  file: pointer to the source file name
00071   * @param  line: assert_param error line source number
00072   * @retval None
00073   */
00074 void assert_failed(uint8_t* file, uint32_t line)
00075 { 
00076   /* User can add his own implementation to report the file name and line number,
00077      ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
00078 
00079   /* Infinite loop */
00080   while (1)
00081   {
00082   }
00083 }
00084 #endif
00085 
00086 /**
00087   * @}
00088   */ 
00089 
00090 /**
00091   * @}
00092   */ 
00093 
00094 /******************* (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