STM32F10x_StdPeriph_Examples/I2S/Interrupt/stm32f10x_it.c

Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    I2S/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 I2S_Interrupt
00031   * @{
00032   */ 
00033 
00034 /* Private typedef -----------------------------------------------------------*/
00035 /* Private define ------------------------------------------------------------*/
00036 /* Private macro -------------------------------------------------------------*/
00037 /* Private variables ---------------------------------------------------------*/
00038 extern const uint16_t I2S3_Buffer_Tx[32];
00039 extern uint16_t I2S2_Buffer_Rx[32];
00040 extern  __IO uint32_t TxIdx, RxIdx;
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   * @brief  This function handles Memory Manage exception.
00072   * @param  None
00073   * @retval None
00074   */
00075 void MemManage_Handler(void)
00076 {
00077   /* Go to infinite loop when Memory Manage exception occurs */
00078   while (1)
00079   {}
00080 }
00081 
00082 /**
00083   * @brief  This function handles Bus Fault exception.
00084   * @param  None
00085   * @retval None
00086   */
00087 void BusFault_Handler(void)
00088 {
00089   /* Go to infinite loop when Bus Fault exception occurs */
00090   while (1)
00091   {}
00092 }
00093 
00094 /**
00095   * @brief  This function handles Usage Fault exception.
00096   * @param  None
00097   * @retval None
00098   */
00099 void UsageFault_Handler(void)
00100 {
00101   /* Go to infinite loop when Usage Fault exception occurs */
00102   while (1)
00103   {}
00104 }
00105 
00106 /**
00107   * @brief  This function handles Debug Monitor exception.
00108   * @param  None
00109   * @retval None
00110   */
00111 void DebugMon_Handler(void)
00112 {
00113 }
00114 
00115 /**
00116   * @brief  This function handles SVCall exception.
00117   * @param  None
00118   * @retval None
00119   */
00120 void SVC_Handler(void)
00121 {
00122 }
00123 
00124 /**
00125   * @brief  This function handles PendSV_Handler exception.
00126   * @param  None
00127   * @retval None
00128   */
00129 void PendSV_Handler(void)
00130 {
00131 }
00132 
00133 /**
00134   * @brief  This function handles SysTick Handler.
00135   * @param  None
00136   * @retval None
00137   */
00138 void SysTick_Handler(void)
00139 {
00140 }
00141 
00142 /******************************************************************************/
00143 /*            STM32F10x Peripherals Interrupt Handlers                        */
00144 /******************************************************************************/
00145 
00146 /**
00147   * @brief  This function handles SPI3 global interrupt request.
00148   * @param  None
00149   * @retval None
00150   */
00151 void SPI3_IRQHandler(void)
00152 {
00153   /* Check the interrupt source */
00154   if (SPI_I2S_GetITStatus(SPI3, SPI_I2S_IT_TXE) == SET)
00155   {
00156     /* Send a data from I2S3 */
00157     SPI_I2S_SendData(SPI3, I2S3_Buffer_Tx[TxIdx++]);
00158   }
00159 
00160   /* Check the end of buffer transfer */
00161   if (RxIdx == 32)
00162   {
00163     /* Disable the I2S3 TXE interrupt to end the communication */
00164     SPI_I2S_ITConfig(SPI3, SPI_I2S_IT_TXE, DISABLE);
00165   }
00166 }
00167 
00168 /**
00169   * @brief  This function handles SPI2 global interrupt request.
00170   * @param  None
00171   * @retval None
00172   */
00173 void SPI2_IRQHandler(void)
00174 {
00175   /* Check the interrupt source */
00176   if (SPI_I2S_GetITStatus(SPI2, SPI_I2S_IT_RXNE) == SET)
00177   {
00178     /* Store the I2S2 received data in the relative data table */
00179     I2S2_Buffer_Rx[RxIdx++] = SPI_I2S_ReceiveData(SPI2);
00180   }
00181 }
00182 
00183 /******************************************************************************/
00184 /*                 STM32F10x Peripherals Interrupt Handlers                   */
00185 /*  Add here the Interrupt Handler for the used peripheral(s) (PPP), for the  */
00186 /*  available peripheral interrupt handler's name please refer to the startup */
00187 /*  file (startup_stm32f10x_xx.s).                                            */
00188 /******************************************************************************/
00189 
00190 /**
00191   * @brief  This function handles PPP interrupt request.
00192   * @param  None
00193   * @retval None
00194   */
00195 /*void PPP_IRQHandler(void)
00196 {
00197 }*/
00198 
00199 /**
00200   * @}
00201   */
00202 
00203 /**
00204   * @}
00205   */
00206 
00207 /******************* (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