Senior Design: Sound Monitor / OneHopeOnePrayer

Dependencies:   STM32L4xx_HAL_Driver CMSIS_DSP_401

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers stm32l4xx_it.c Source File

stm32l4xx_it.c

00001 /**
00002   ******************************************************************************
00003   * @file    BSP/Src/stm32l4xx_it.c 
00004   * @author  MCD Application Team
00005   * @version V1.1.0
00006   * @date    16-September-2015
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(c) 2015 STMicroelectronics</center></h2>
00014   *
00015   * Redistribution and use in source and binary forms, with or without modification,
00016   * are permitted provided that the following conditions are met:
00017   *   1. Redistributions of source code must retain the above copyright notice,
00018   *      this list of conditions and the following disclaimer.
00019   *   2. Redistributions in binary form must reproduce the above copyright notice,
00020   *      this list of conditions and the following disclaimer in the documentation
00021   *      and/or other materials provided with the distribution.
00022   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00023   *      may be used to endorse or promote products derived from this software
00024   *      without specific prior written permission.
00025   *
00026   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00027   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00028   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00029   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00030   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00031   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00032   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00033   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00034   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00035   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00036   *
00037   ******************************************************************************
00038   */
00039 
00040 /* Includes ------------------------------------------------------------------*/
00041 #include "stm32l4xx_it.h"
00042 #include "main.h"
00043 
00044 /** @addtogroup STM32L4xx_HAL_Examples
00045   * @{
00046   */
00047 
00048 /** @addtogroup Templates
00049   * @{
00050   */
00051 
00052 extern SAI_HandleTypeDef          BSP_AUDIO_hSai;
00053 extern DFSDM_Filter_HandleTypeDef BSP_AUDIO_hDfsdmLeftFilter;
00054 
00055 /* DBG */
00056 typedef struct {
00057   uint32_t IrqCpt_EXTI0;
00058   uint32_t IrqCpt_EXTI1;
00059   uint32_t IrqCpt_EXTI2;
00060   uint32_t IrqCpt_EXTI3;
00061   uint32_t IrqCpt_EXTI9_5;
00062   uint32_t IrqCpt_EXTI15_10;
00063   uint32_t IrqCpt_SAI;
00064   uint32_t IrqCpt_DFSDM;
00065 } IrqCpt_t;
00066 IrqCpt_t IrqCpt = {0};
00067 /* DBG */
00068 
00069 /* Private typedef -----------------------------------------------------------*/
00070 /* Private define ------------------------------------------------------------*/
00071 /* Private macro -------------------------------------------------------------*/
00072 /* Private variables ---------------------------------------------------------*/
00073 /* Private function prototypes -----------------------------------------------*/
00074 /* Private functions ---------------------------------------------------------*/
00075 
00076 /******************************************************************************/
00077 /*            Cortex-M4 Processor Exceptions Handlers                         */
00078 /******************************************************************************/
00079 
00080 /**
00081   * @brief   This function handles NMI exception.
00082   * @param  None
00083   * @retval None
00084   */
00085 void NMI_Handler(void)
00086 {
00087 }
00088 
00089 /**
00090   * @brief  This function handles Hard Fault exception.
00091   * @param  None
00092   * @retval None
00093   */
00094 void HardFault_Handler(void)
00095 {
00096   /* Go to infinite loop when Hard Fault exception occurs */
00097   while (1)
00098   {
00099   }
00100 }
00101 
00102 /**
00103   * @brief  This function handles Memory Manage exception.
00104   * @param  None
00105   * @retval None
00106   */
00107 void MemManage_Handler(void)
00108 {
00109   /* Go to infinite loop when Memory Manage exception occurs */
00110   while (1)
00111   {
00112   }
00113 }
00114 
00115 /**
00116   * @brief  This function handles Bus Fault exception.
00117   * @param  None
00118   * @retval None
00119   */
00120 void BusFault_Handler(void)
00121 {
00122   /* Go to infinite loop when Bus Fault exception occurs */
00123   while (1)
00124   {
00125   }
00126 }
00127 
00128 /**
00129   * @brief  This function handles Usage Fault exception.
00130   * @param  None
00131   * @retval None
00132   */
00133 void UsageFault_Handler(void)
00134 {
00135   /* Go to infinite loop when Usage Fault exception occurs */
00136   while (1)
00137   {
00138   }
00139 }
00140 
00141 /**
00142   * @brief  This function handles SVCall exception.
00143   * @param  None
00144   * @retval None
00145   */
00146 void SVC_Handler(void)
00147 {
00148 }
00149 
00150 /**
00151   * @brief  This function handles Debug Monitor exception.
00152   * @param  None
00153   * @retval None
00154   */
00155 void DebugMon_Handler(void)
00156 {
00157 }
00158 
00159 /**
00160   * @brief  This function handles PendSVC exception.
00161   * @param  None
00162   * @retval None
00163   */
00164 void PendSV_Handler(void)
00165 {
00166 }
00167 
00168 /**
00169   * @brief  This function handles SysTick Handler.
00170   * @param  None
00171   * @retval None
00172   */
00173 void SysTick_Handler(void)
00174 {
00175   HAL_IncTick();
00176 }
00177   
00178 
00179 /******************************************************************************/
00180 /*                 STM32L4xx Peripherals Interrupt Handlers                   */
00181 /*  Add here the Interrupt Handler for the used peripheral(s) (PPP), for the  */
00182 /*  available peripheral interrupt handler's name please refer to the startup */
00183 /*  file (startup_stm32l4xx.s).                                               */
00184 /******************************************************************************/
00185 
00186 /**
00187   * @brief  This function handles EXTI0 interrupt request.
00188   * @param  None
00189   * @retval None
00190   */
00191 void EXTI0_IRQHandler (void)
00192 {
00193   IrqCpt.IrqCpt_EXTI0++;
00194   HAL_GPIO_EXTI_IRQHandler(SEL_JOY_PIN);
00195 }
00196 
00197 /**
00198   * @brief  This function handles EXTI1 interrupt request.
00199   * @param  None
00200   * @retval None
00201   */
00202 void EXTI1_IRQHandler (void)
00203 {
00204   IrqCpt.IrqCpt_EXTI1++;
00205   HAL_GPIO_EXTI_IRQHandler(LEFT_JOY_PIN);
00206 }
00207 
00208 /**
00209   * @brief  This function handles EXTI2 interrupt request.
00210   * @param  None
00211   * @retval None
00212   */
00213 void EXTI2_IRQHandler (void)
00214 {
00215   IrqCpt.IrqCpt_EXTI2++;
00216   HAL_GPIO_EXTI_IRQHandler(RIGHT_JOY_PIN);
00217 }
00218 
00219 /**
00220   * @brief  This function handles EXTI3 interrupt request.
00221   * @param  None
00222   * @retval None
00223   */
00224 void EXTI3_IRQHandler (void)
00225 {
00226   IrqCpt.IrqCpt_EXTI3++;
00227   HAL_GPIO_TogglePin(LED4_GPIO_PORT, LED4_PIN);
00228   HAL_GPIO_EXTI_IRQHandler(UP_JOY_PIN);
00229   HAL_GPIO_TogglePin(LED4_GPIO_PORT, LED4_PIN);
00230 }
00231 
00232 /**
00233   * @brief  This function handles EXTI9_5 interrupt request.
00234   * @param  None
00235   * @retval None
00236   */
00237 void EXTI9_5_IRQHandler (void)
00238 {
00239   IrqCpt.IrqCpt_EXTI9_5++;
00240   HAL_GPIO_EXTI_IRQHandler(DOWN_JOY_PIN);
00241 }
00242 
00243 /**
00244   * @brief  This function handles EXTI15_10 interrupt request.
00245   * @param  None
00246   * @retval None
00247   */
00248 void EXTI15_10_IRQHandler (void)
00249 {
00250   IrqCpt.IrqCpt_EXTI15_10++;
00251   HAL_GPIO_EXTI_IRQHandler(IDD_INT_PIN);
00252 }
00253 
00254 /**
00255   * @brief  This function handles SAI DMA interrupt request.
00256   * @param  None
00257   * @retval None
00258   */
00259 void AUDIO_SAIx_DMAx_IRQHandler(void)
00260 { 
00261   IrqCpt.IrqCpt_SAI++;
00262   HAL_DMA_IRQHandler(BSP_AUDIO_hSai.hdmatx);
00263 }
00264 
00265 /**
00266   * @brief  This function handles DFSDM Left DMAinterrupt request.
00267   * @param  None
00268   * @retval None
00269   */
00270 void AUDIO_DFSDM_DMAx_LEFT_IRQHandler(void)
00271 { 
00272   IrqCpt.IrqCpt_DFSDM++;
00273   HAL_DMA_IRQHandler(BSP_AUDIO_hDfsdmLeftFilter.hdmaReg);
00274 }
00275 
00276 /**
00277   * @}
00278   */ 
00279 
00280 /**
00281   * @}
00282   */
00283 
00284 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
00285