STM32F0xx Standard Peripherals Firmware Library: stm32f0xx_it.c Source File

STM32F0xx Standard Peripherals Library

STM32F0xx_StdPeriph_Examples/USART/USART_8xUsartsOneBoard/stm32f0xx_it.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    USART/USART_8xUsartsOneBoard/stm32f0xx_it.c 
00004   * @author  MCD Application Team
00005   * @version V1.4.0
00006   * @date    24-July-2014
00007   * @brief   Main Interrupt Service Routines.
00008   *          This file provides template for all exceptions handler and 
00009   *          peripherals interrupt service routine.
00010   ******************************************************************************
00011   * @attention
00012   *
00013   * <h2><center>&copy; COPYRIGHT 2014 STMicroelectronics</center></h2>
00014   *
00015   * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
00016   * You may not use this file except in compliance with the License.
00017   * You may obtain a copy of the License at:
00018   *
00019   *        http://www.st.com/software_license_agreement_liberty_v2
00020   *
00021   * Unless required by applicable law or agreed to in writing, software 
00022   * distributed under the License is distributed on an "AS IS" BASIS, 
00023   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00024   * See the License for the specific language governing permissions and
00025   * limitations under the License.
00026   *
00027   ******************************************************************************
00028   */
00029 
00030 /* Includes ------------------------------------------------------------------*/
00031 #include "stm32f0xx_it.h"
00032 
00033 /** @addtogroup STM32F0xx_StdPeriph_Examples
00034   * @{
00035   */
00036 
00037 /** @addtogroup USART_8xUsartsOneBoard
00038   * @{
00039   */
00040 
00041 /* Private typedef -----------------------------------------------------------*/
00042 /* Private define ------------------------------------------------------------*/
00043 /* Private macro -------------------------------------------------------------*/
00044 /* Private variables ---------------------------------------------------------*/
00045 extern uint8_t aRxBuffer[8][BUFFER_SIZE];
00046 __IO uint8_t RxCounter= 0, ReceiveState = 0;
00047 /* Private function prototypes -----------------------------------------------*/
00048 /* Private functions ---------------------------------------------------------*/
00049 
00050 /******************************************************************************/
00051 /*            Cortex-M0 Processor Exceptions Handlers                         */
00052 /******************************************************************************/
00053 
00054 /**
00055   * @brief  This function handles NMI exception.
00056   * @param  None
00057   * @retval None
00058   */
00059 void NMI_Handler(void)
00060 {
00061 }
00062 
00063 /**
00064   * @brief  This function handles Hard Fault exception.
00065   * @param  None
00066   * @retval None
00067   */
00068 void HardFault_Handler(void)
00069 {
00070   /* Go to infinite loop when Hard Fault exception occurs */
00071   while (1)
00072   {
00073   }
00074 }
00075 
00076 /**
00077   * @brief  This function handles SVCall exception.
00078   * @param  None
00079   * @retval None
00080   */
00081 void SVC_Handler(void)
00082 {
00083 }
00084 
00085 /**
00086   * @brief  This function handles PendSVC exception.
00087   * @param  None
00088   * @retval None
00089   */
00090 void PendSV_Handler(void)
00091 {
00092 }
00093 
00094 /**
00095   * @brief  This function handles SysTick Handler.
00096   * @param  None
00097   * @retval None
00098   */
00099 void SysTick_Handler(void)
00100 {
00101     TimingDelay_Decrement();
00102 }
00103 
00104 /******************************************************************************/
00105 /*                 STM32F0xx Peripherals Interrupt Handlers                   */
00106 /*  Add here the Interrupt Handler for the used peripheral(s) (PPP), for the  */
00107 /*  available peripheral interrupt handler's name please refer to the startup */
00108 /*  file (startup_stm32f0xx.s).                                            */
00109 /******************************************************************************/
00110 /**
00111   * @brief  This function handles USARTy global interrupt request.
00112   * @param  None
00113   * @retval None
00114   */
00115 void USART1_IRQHandler(void)
00116 {
00117   if(USART_GetITStatus(USART1, USART_IT_RXNE) != RESET)
00118   {
00119     /* Read one byte from the receive data register */
00120     aRxBuffer[0][RxCounter++] = USART_ReceiveData(USART1);
00121 
00122     if(RxCounter == BUFFER_SIZE)
00123     {
00124       ReceiveState = 1;
00125       RxCounter = 0;
00126     }
00127   }
00128 }
00129 
00130 /**
00131   * @brief  This function handles USARTy global interrupt request.
00132   * @param  None
00133   * @retval None
00134   */
00135 void USART2_IRQHandler(void)
00136 {
00137   if(USART_GetITStatus(USART2, USART_IT_RXNE) != RESET)
00138   {
00139     /* Read one byte from the receive data register */
00140     aRxBuffer[1][RxCounter++] = USART_ReceiveData(USART2);
00141 
00142     if(RxCounter == BUFFER_SIZE)
00143     {
00144       ReceiveState = 1;
00145       RxCounter=0;
00146     }
00147   }
00148 }
00149 
00150 /**
00151   * @brief  This function handles USARTy global interrupt request.
00152   * @param  None
00153   * @retval None
00154   */
00155 void USART3_8_IRQHandler(void)
00156 {
00157   if(USART_GetITStatus(USART3, USART_IT_RXNE) != RESET)
00158   {
00159     /* Read one byte from the receive data register */
00160     aRxBuffer[2][RxCounter++] = USART_ReceiveData(USART3);
00161     
00162     if(RxCounter == BUFFER_SIZE)
00163     {
00164       ReceiveState = 1;
00165       RxCounter = 0;
00166     }
00167   }
00168   
00169   if(USART_GetITStatus(USART4, USART_IT_RXNE) != RESET)
00170   {
00171     /* Read one byte from the receive data register */
00172     aRxBuffer[3][RxCounter++] = USART_ReceiveData(USART4);
00173     
00174     if(RxCounter == BUFFER_SIZE)
00175     {
00176       ReceiveState = 1;
00177       RxCounter = 0;
00178     }
00179   }
00180   
00181   if(USART_GetITStatus(USART5, USART_IT_RXNE) != RESET)
00182   {
00183       
00184     /* Read one byte from the receive data register */
00185     aRxBuffer[4][RxCounter++] = USART_ReceiveData(USART5);
00186     
00187     if(RxCounter == BUFFER_SIZE)
00188     {  
00189       ReceiveState = 1;
00190       RxCounter = 0;
00191     }
00192   }
00193   
00194   if(USART_GetITStatus(USART6, USART_IT_RXNE) != RESET)
00195   {
00196     /* Read one byte from the receive data register */
00197     aRxBuffer[5][RxCounter++] = USART_ReceiveData(USART6);
00198     
00199     if(RxCounter == BUFFER_SIZE)
00200     {
00201       ReceiveState = 1;      
00202       RxCounter = 0;
00203     }
00204   }
00205   
00206   if(USART_GetITStatus(USART7, USART_IT_RXNE) != RESET)
00207   {
00208     /* Read one byte from the receive data register */
00209     aRxBuffer[6][RxCounter++] = USART_ReceiveData(USART7);
00210     
00211     if(RxCounter == BUFFER_SIZE)
00212     { 
00213       ReceiveState = 1;
00214       RxCounter = 0;
00215     }
00216   }
00217   
00218   if(USART_GetITStatus(USART8, USART_IT_RXNE) != RESET)
00219   {
00220     /* Read one byte from the receive data register */
00221     aRxBuffer[7][RxCounter++] = USART_ReceiveData(USART8);
00222     
00223     if(RxCounter == BUFFER_SIZE)
00224     { 
00225       ReceiveState = 1;
00226       RxCounter = 0;
00227     }
00228   }
00229 }
00230 
00231 /**
00232   * @brief  This function handles PPP interrupt request.
00233   * @param  None
00234   * @retval None
00235   */
00236 /*void PPP_IRQHandler(void)
00237 {
00238 }*/
00239 
00240 /**
00241   * @}
00242   */ 
00243 
00244 /**
00245   * @}
00246   */ 
00247 
00248 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
STM32L1xx Standard Peripherals Library: Footer

 

 

 For complete documentation on STM32 Microcontrollers visit www.st.com/STM32