STM32F10x_StdPeriph_Examples/NVIC/DMA_WFIMode/stm32f10x_it.c

Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    NVIC/DMA_WFIMode/stm32f10x_it.c 
00004   * @author  MCD Application Team
00005   * @version V3.4.0
00006   * @date    10/15/2010
00007   * @brief   Main Interrupt Service Routines.
00008   *          This file provides template for all exceptions handler and peripherals
00009   *          interrupt service routine.
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 /* Includes ------------------------------------------------------------------*/
00024 #include "stm32f10x_it.h"
00025 #include "stm32_eval.h"
00026 
00027 /** @addtogroup STM32F10x_StdPeriph_Examples
00028   * @{
00029   */
00030 
00031 /** @addtogroup NVIC_DMA_WFIMode
00032   * @{
00033   */
00034 
00035 /* Private typedef -----------------------------------------------------------*/
00036 /* Private define ------------------------------------------------------------*/
00037 /* Private macro -------------------------------------------------------------*/
00038 /* Private variables ---------------------------------------------------------*/
00039 uint8_t TestStatus = 0;
00040 uint16_t SRC_Buffer[10] = {0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39};
00041 extern uint16_t DST_Buffer[10];
00042 extern __IO uint32_t LowPowerMode;
00043 extern uint8_t Buffercmp16(uint16_t*, uint16_t*, uint16_t);
00044 extern void DMA_Configuration(void);
00045 
00046 /* Private function prototypes -----------------------------------------------*/
00047 /* Private functions ---------------------------------------------------------*/
00048 
00049 /******************************************************************************/
00050 /*            Cortex-M3 Processor Exceptions Handlers                         */
00051 /******************************************************************************/
00052 
00053 /**
00054   * @brief  This function handles NMI exception.
00055   * @param  None
00056   * @retval None
00057   */
00058 void NMI_Handler(void)
00059 {
00060 }
00061 
00062 /**
00063   * @brief  This function handles Hard Fault exception.
00064   * @param  None
00065   * @retval None
00066   */
00067 void HardFault_Handler(void)
00068 {
00069   /* Go to infinite loop when Hard Fault exception occurs */
00070   while (1)
00071   {
00072   }
00073 }
00074 
00075 /**
00076   * @brief  This function handles Memory Manage exception.
00077   * @param  None
00078   * @retval None
00079   */
00080 void MemManage_Handler(void)
00081 {
00082   /* Go to infinite loop when Memory Manage exception occurs */
00083   while (1)
00084   {
00085   }
00086 }
00087 
00088 /**
00089   * @brief  This function handles Bus Fault exception.
00090   * @param  None
00091   * @retval None
00092   */
00093 void BusFault_Handler(void)
00094 {
00095   /* Go to infinite loop when Bus Fault exception occurs */
00096   while (1)
00097   {
00098   }
00099 }
00100 
00101 /**
00102   * @brief  This function handles Usage Fault exception.
00103   * @param  None
00104   * @retval None
00105   */
00106 void UsageFault_Handler(void)
00107 {
00108   /* Go to infinite loop when Usage Fault exception occurs */
00109   while (1)
00110   {
00111   }
00112 }
00113 
00114 /**
00115   * @brief  This function handles SVCall exception.
00116   * @param  None
00117   * @retval None
00118   */
00119 void SVC_Handler(void)
00120 {
00121 }
00122 
00123 /**
00124   * @brief  This function handles Debug Monitor exception.
00125   * @param  None
00126   * @retval None
00127   */
00128 void DebugMon_Handler(void)
00129 {
00130 }
00131 
00132 /**
00133   * @brief  This function handles PendSV_Handler exception.
00134   * @param  None
00135   * @retval None
00136   */
00137 void PendSV_Handler(void)
00138 {
00139 }
00140 
00141 /**
00142   * @brief  This function handles SysTick Handler.
00143   * @param  None
00144   * @retval None
00145   */
00146 void SysTick_Handler(void)
00147 {
00148 }
00149 
00150 /******************************************************************************/
00151 /*            STM32F10x Peripherals Interrupt Handlers                        */
00152 /******************************************************************************/
00153 
00154 /**
00155   * @brief  This function handles DMA1 Channel 5 interrupt request.
00156   * @param  None
00157   * @retval None
00158   */
00159 void DMA1_Channel5_IRQHandler(void)
00160 {
00161   if(DMA_GetITStatus(DMA1_IT_TC5))
00162   {
00163     DMA_ClearITPendingBit(DMA1_IT_GL5);
00164 
00165     /* Check the received buffer */
00166     TestStatus = Buffercmp16(SRC_Buffer, DST_Buffer, 10);
00167 
00168     if(TestStatus == 0)
00169     {
00170       STM_EVAL_LEDToggle(LED2);
00171     }
00172     else
00173     {
00174       STM_EVAL_LEDToggle(LED3);
00175     }
00176   }
00177 }
00178 
00179 /**
00180   * @brief  This function handles DMA1 Channel 6 interrupt request.
00181   * @param  None
00182   * @retval None
00183   */
00184 void DMA1_Channel6_IRQHandler(void)
00185 {
00186   if(DMA_GetITStatus(DMA1_IT_TC6))
00187   {
00188     DMA_ClearITPendingBit(DMA1_IT_GL6);
00189 
00190     /* Check the received buffer */
00191     TestStatus = Buffercmp16(SRC_Buffer, DST_Buffer, 10);
00192 
00193     if(TestStatus == 0)
00194     {
00195       STM_EVAL_LEDToggle(LED2);
00196     }
00197     else
00198     {
00199       STM_EVAL_LEDToggle(LED3);
00200     }
00201   }
00202 }
00203 
00204 /**
00205   * @brief  This function handles External lines 9 to 5 interrupt request.
00206   * @param  None
00207   * @retval None
00208   */
00209 void EXTI9_5_IRQHandler(void)
00210 {
00211   if(EXTI_GetITStatus(KEY_BUTTON_EXTI_LINE) != RESET)
00212   {
00213     EXTI_ClearITPendingBit(KEY_BUTTON_EXTI_LINE);
00214   
00215     LowPowerMode = 1;
00216   }  
00217 }
00218 
00219 /******************************************************************************/
00220 /*                 STM32F10x Peripherals Interrupt Handlers                   */
00221 /*  Add here the Interrupt Handler for the used peripheral(s) (PPP), for the  */
00222 /*  available peripheral interrupt handler's name please refer to the startup */
00223 /*  file (startup_stm32f10x_xx.s).                                            */
00224 /******************************************************************************/
00225 
00226 /**
00227   * @brief  This function handles PPP interrupt request.
00228   * @param  None
00229   * @retval None
00230   */
00231 /*void PPP_IRQHandler(void)
00232 {
00233 }*/
00234 
00235 /**
00236   * @}
00237   */
00238 
00239 /**
00240   * @}
00241   */
00242 
00243 /******************* (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