STM32F10x_StdPeriph_Examples/USART/DMA_Interrupt/stm32f10x_it.c

Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    USART/DMA_Interrupt/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 
00026 /** @addtogroup STM32F10x_StdPeriph_Examples
00027   * @{
00028   */
00029 
00030 /** @addtogroup USART_DMA_Interrupt
00031   * @{
00032   */ 
00033 
00034 /* Private typedef -----------------------------------------------------------*/
00035 /* Private define ------------------------------------------------------------*/
00036 /* Private macro -------------------------------------------------------------*/
00037 /* Private variables ---------------------------------------------------------*/
00038 uint8_t RxCounter = 0;
00039 extern uint8_t RxBuffer2[];
00040 extern uint8_t NbrOfDataToRead;
00041 
00042 /* Private function prototypes -----------------------------------------------*/
00043 /* Private functions ---------------------------------------------------------*/
00044 
00045 /******************************************************************************/
00046 /*            Cortex-M3 Processor Exceptions Handlers                         */
00047 /******************************************************************************/
00048 
00049 /**
00050   * @brief  This function handles NMI exception.
00051   * @param  None
00052   * @retval None
00053   */
00054 void NMI_Handler(void)
00055 {
00056 }
00057 
00058 /**
00059   * @brief  This function handles Hard Fault exception.
00060   * @param  None
00061   * @retval None
00062   */
00063 void HardFault_Handler(void)
00064 {
00065   /* Go to infinite loop when Hard Fault exception occurs */
00066   while (1)
00067   {
00068   }
00069 }
00070 
00071 /**
00072   * @brief  This function handles Memory Manage exception.
00073   * @param  None
00074   * @retval None
00075   */
00076 void MemManage_Handler(void)
00077 {
00078   /* Go to infinite loop when Memory Manage exception occurs */
00079   while (1)
00080   {
00081   }
00082 }
00083 
00084 /**
00085   * @brief  This function handles Bus Fault exception.
00086   * @param  None
00087   * @retval None
00088   */
00089 void BusFault_Handler(void)
00090 {
00091   /* Go to infinite loop when Bus Fault exception occurs */
00092   while (1)
00093   {
00094   }
00095 }
00096 
00097 /**
00098   * @brief  This function handles Usage Fault exception.
00099   * @param  None
00100   * @retval None
00101   */
00102 void UsageFault_Handler(void)
00103 {
00104   /* Go to infinite loop when Usage Fault exception occurs */
00105   while (1)
00106   {
00107   }
00108 }
00109 
00110 /**
00111   * @brief  This function handles SVCall exception.
00112   * @param  None
00113   * @retval None
00114   */
00115 void SVC_Handler(void)
00116 {
00117 }
00118 
00119 /**
00120   * @brief  This function handles Debug Monitor exception.
00121   * @param  None
00122   * @retval None
00123   */
00124 void DebugMon_Handler(void)
00125 {
00126 }
00127 
00128 /**
00129   * @brief  This function handles PendSV_Handler exception.
00130   * @param  None
00131   * @retval None
00132   */
00133 void PendSV_Handler(void)
00134 {
00135 }
00136 
00137 /**
00138   * @brief  This function handles SysTick Handler.
00139   * @param  None
00140   * @retval None
00141   */
00142 void SysTick_Handler(void)
00143 {
00144 }
00145 
00146 /******************************************************************************/
00147 /*            STM32F10x Peripherals Interrupt Handlers                        */
00148 /******************************************************************************/
00149 
00150 /**
00151   * @brief  This function handles USART2 global interrupt request.
00152   * @param  None
00153   * @retval None
00154   */
00155 void USART2_IRQHandler(void)
00156 {
00157   if(USART_GetITStatus(USART2, USART_IT_RXNE) != RESET)
00158   {
00159     /* Read one byte from the receive data register */
00160     RxBuffer2[RxCounter++] = USART_ReceiveData(USART2);
00161 
00162     if(RxCounter == NbrOfDataToRead)
00163     {
00164       /* Disable the USART2 Receive interrupt */
00165       USART_ITConfig(USART2, USART_IT_RXNE, DISABLE);
00166     }
00167   }
00168 }
00169 
00170 /**
00171   * @brief  This function handles USART3 global interrupt request.
00172   * @param  None
00173   * @retval None
00174   */
00175 void USART3_IRQHandler(void)
00176 {
00177   if(USART_GetITStatus(USART3, USART_IT_RXNE) != RESET)
00178   {
00179     /* Read one byte from the receive data register */
00180     RxBuffer2[RxCounter++] = USART_ReceiveData(USART3);
00181 
00182     if(RxCounter == NbrOfDataToRead)
00183     {
00184       /* Disable the USART3 Receive interrupt */
00185       USART_ITConfig(USART3, USART_IT_RXNE, DISABLE);
00186     }
00187   }
00188 }
00189 
00190 /******************************************************************************/
00191 /*                 STM32F10x Peripherals Interrupt Handlers                   */
00192 /*  Add here the Interrupt Handler for the used peripheral(s) (PPP), for the  */
00193 /*  available peripheral interrupt handler's name please refer to the startup */
00194 /*  file (startup_stm32f10x_xx.s).                                            */
00195 /******************************************************************************/
00196 
00197 /**
00198   * @brief  This function handles PPP interrupt request.
00199   * @param  None
00200   * @retval None
00201   */
00202 /*void PPP_IRQHandler(void)
00203 {
00204 }*/
00205 
00206 /**
00207   * @}
00208   */ 
00209 
00210 /**
00211   * @}
00212   */ 
00213 
00214 /******************* (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