Audio Demo with DISCO Board, takes control samples, waits for user input, samples regularly.
Dependencies: CMSIS_DSP_401 STM32L4xx_HAL_Driver mbed-src_DISO_AUDIO_DEMO
stm32l4xx_it.cpp@0:3eee9435dd17, 2015-12-13 (annotated)
- Committer:
- EricLew
- Date:
- Sun Dec 13 19:12:11 2015 +0000
- Revision:
- 0:3eee9435dd17
Audio Demo using DISCO Board
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
EricLew | 0:3eee9435dd17 | 1 | /** |
EricLew | 0:3eee9435dd17 | 2 | ****************************************************************************** |
EricLew | 0:3eee9435dd17 | 3 | * @file DFSDM/DFSDM_AudioRecord/Src/stm32l4xx_it.c |
EricLew | 0:3eee9435dd17 | 4 | * @author MCD Application Team |
EricLew | 0:3eee9435dd17 | 5 | * @version V1.1.0 |
EricLew | 0:3eee9435dd17 | 6 | * @date 16-September-2015 |
EricLew | 0:3eee9435dd17 | 7 | * @brief Main Interrupt Service Routines. |
EricLew | 0:3eee9435dd17 | 8 | * This file provides template for all exceptions handler and |
EricLew | 0:3eee9435dd17 | 9 | * peripherals interrupt service routine. |
EricLew | 0:3eee9435dd17 | 10 | ****************************************************************************** |
EricLew | 0:3eee9435dd17 | 11 | * @attention |
EricLew | 0:3eee9435dd17 | 12 | * |
EricLew | 0:3eee9435dd17 | 13 | * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> |
EricLew | 0:3eee9435dd17 | 14 | * |
EricLew | 0:3eee9435dd17 | 15 | * Redistribution and use in source and binary forms, with or without modification, |
EricLew | 0:3eee9435dd17 | 16 | * are permitted provided that the following conditions are met: |
EricLew | 0:3eee9435dd17 | 17 | * 1. Redistributions of source code must retain the above copyright notice, |
EricLew | 0:3eee9435dd17 | 18 | * this list of conditions and the following disclaimer. |
EricLew | 0:3eee9435dd17 | 19 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
EricLew | 0:3eee9435dd17 | 20 | * this list of conditions and the following disclaimer in the documentation |
EricLew | 0:3eee9435dd17 | 21 | * and/or other materials provided with the distribution. |
EricLew | 0:3eee9435dd17 | 22 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
EricLew | 0:3eee9435dd17 | 23 | * may be used to endorse or promote products derived from this software |
EricLew | 0:3eee9435dd17 | 24 | * without specific prior written permission. |
EricLew | 0:3eee9435dd17 | 25 | * |
EricLew | 0:3eee9435dd17 | 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
EricLew | 0:3eee9435dd17 | 27 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
EricLew | 0:3eee9435dd17 | 28 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
EricLew | 0:3eee9435dd17 | 29 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
EricLew | 0:3eee9435dd17 | 30 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
EricLew | 0:3eee9435dd17 | 31 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
EricLew | 0:3eee9435dd17 | 32 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
EricLew | 0:3eee9435dd17 | 33 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
EricLew | 0:3eee9435dd17 | 34 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
EricLew | 0:3eee9435dd17 | 35 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
EricLew | 0:3eee9435dd17 | 36 | * |
EricLew | 0:3eee9435dd17 | 37 | ****************************************************************************** |
EricLew | 0:3eee9435dd17 | 38 | */ |
EricLew | 0:3eee9435dd17 | 39 | |
EricLew | 0:3eee9435dd17 | 40 | /* Includes ------------------------------------------------------------------*/ |
EricLew | 0:3eee9435dd17 | 41 | #include "main.h" |
EricLew | 0:3eee9435dd17 | 42 | #include "stm32l4xx_it.h" |
EricLew | 0:3eee9435dd17 | 43 | |
EricLew | 0:3eee9435dd17 | 44 | /** @addtogroup STM32L4xx_HAL_Examples |
EricLew | 0:3eee9435dd17 | 45 | * @{ |
EricLew | 0:3eee9435dd17 | 46 | */ |
EricLew | 0:3eee9435dd17 | 47 | |
EricLew | 0:3eee9435dd17 | 48 | /** @addtogroup DFSDM_AudioRecord |
EricLew | 0:3eee9435dd17 | 49 | * @{ |
EricLew | 0:3eee9435dd17 | 50 | */ |
EricLew | 0:3eee9435dd17 | 51 | |
EricLew | 0:3eee9435dd17 | 52 | /* Private typedef -----------------------------------------------------------*/ |
EricLew | 0:3eee9435dd17 | 53 | /* Private define ------------------------------------------------------------*/ |
EricLew | 0:3eee9435dd17 | 54 | /* Private macro -------------------------------------------------------------*/ |
EricLew | 0:3eee9435dd17 | 55 | /* Private variables ---------------------------------------------------------*/ |
EricLew | 0:3eee9435dd17 | 56 | //hAudioIn.hDmaDfsdmLeft |
EricLew | 0:3eee9435dd17 | 57 | extern DMA_HandleTypeDef hDmaSai; |
EricLew | 0:3eee9435dd17 | 58 | extern SAI_HandleTypeDef BSP_AUDIO_hSai; |
EricLew | 0:3eee9435dd17 | 59 | /* Private function prototypes -----------------------------------------------*/ |
EricLew | 0:3eee9435dd17 | 60 | /* Private functions ---------------------------------------------------------*/ |
EricLew | 0:3eee9435dd17 | 61 | |
EricLew | 0:3eee9435dd17 | 62 | /******************************************************************************/ |
EricLew | 0:3eee9435dd17 | 63 | /* Cortex-M4 Processor Exceptions Handlers */ |
EricLew | 0:3eee9435dd17 | 64 | /******************************************************************************/ |
EricLew | 0:3eee9435dd17 | 65 | |
EricLew | 0:3eee9435dd17 | 66 | /** |
EricLew | 0:3eee9435dd17 | 67 | * @brief This function handles NMI exception. |
EricLew | 0:3eee9435dd17 | 68 | * @param None |
EricLew | 0:3eee9435dd17 | 69 | * @retval None |
EricLew | 0:3eee9435dd17 | 70 | */ |
EricLew | 0:3eee9435dd17 | 71 | void NMI_Handler(void) |
EricLew | 0:3eee9435dd17 | 72 | { |
EricLew | 0:3eee9435dd17 | 73 | } |
EricLew | 0:3eee9435dd17 | 74 | |
EricLew | 0:3eee9435dd17 | 75 | /** |
EricLew | 0:3eee9435dd17 | 76 | * @brief This function handles Hard Fault exception. |
EricLew | 0:3eee9435dd17 | 77 | * @param None |
EricLew | 0:3eee9435dd17 | 78 | * @retval None |
EricLew | 0:3eee9435dd17 | 79 | */ |
EricLew | 0:3eee9435dd17 | 80 | void HardFault_Handler(void) |
EricLew | 0:3eee9435dd17 | 81 | { |
EricLew | 0:3eee9435dd17 | 82 | /* Go to infinite loop when Hard Fault exception occurs */ |
EricLew | 0:3eee9435dd17 | 83 | while (1) |
EricLew | 0:3eee9435dd17 | 84 | { |
EricLew | 0:3eee9435dd17 | 85 | } |
EricLew | 0:3eee9435dd17 | 86 | } |
EricLew | 0:3eee9435dd17 | 87 | |
EricLew | 0:3eee9435dd17 | 88 | /** |
EricLew | 0:3eee9435dd17 | 89 | * @brief This function handles Memory Manage exception. |
EricLew | 0:3eee9435dd17 | 90 | * @param None |
EricLew | 0:3eee9435dd17 | 91 | * @retval None |
EricLew | 0:3eee9435dd17 | 92 | */ |
EricLew | 0:3eee9435dd17 | 93 | void MemManage_Handler(void) |
EricLew | 0:3eee9435dd17 | 94 | { |
EricLew | 0:3eee9435dd17 | 95 | /* Go to infinite loop when Memory Manage exception occurs */ |
EricLew | 0:3eee9435dd17 | 96 | while (1) |
EricLew | 0:3eee9435dd17 | 97 | { |
EricLew | 0:3eee9435dd17 | 98 | } |
EricLew | 0:3eee9435dd17 | 99 | } |
EricLew | 0:3eee9435dd17 | 100 | |
EricLew | 0:3eee9435dd17 | 101 | /** |
EricLew | 0:3eee9435dd17 | 102 | * @brief This function handles Bus Fault exception. |
EricLew | 0:3eee9435dd17 | 103 | * @param None |
EricLew | 0:3eee9435dd17 | 104 | * @retval None |
EricLew | 0:3eee9435dd17 | 105 | */ |
EricLew | 0:3eee9435dd17 | 106 | void BusFault_Handler(void) |
EricLew | 0:3eee9435dd17 | 107 | { |
EricLew | 0:3eee9435dd17 | 108 | /* Go to infinite loop when Bus Fault exception occurs */ |
EricLew | 0:3eee9435dd17 | 109 | while (1) |
EricLew | 0:3eee9435dd17 | 110 | { |
EricLew | 0:3eee9435dd17 | 111 | } |
EricLew | 0:3eee9435dd17 | 112 | } |
EricLew | 0:3eee9435dd17 | 113 | |
EricLew | 0:3eee9435dd17 | 114 | /** |
EricLew | 0:3eee9435dd17 | 115 | * @brief This function handles Usage Fault exception. |
EricLew | 0:3eee9435dd17 | 116 | * @param None |
EricLew | 0:3eee9435dd17 | 117 | * @retval None |
EricLew | 0:3eee9435dd17 | 118 | */ |
EricLew | 0:3eee9435dd17 | 119 | void UsageFault_Handler(void) |
EricLew | 0:3eee9435dd17 | 120 | { |
EricLew | 0:3eee9435dd17 | 121 | /* Go to infinite loop when Usage Fault exception occurs */ |
EricLew | 0:3eee9435dd17 | 122 | while (1) |
EricLew | 0:3eee9435dd17 | 123 | { |
EricLew | 0:3eee9435dd17 | 124 | } |
EricLew | 0:3eee9435dd17 | 125 | } |
EricLew | 0:3eee9435dd17 | 126 | |
EricLew | 0:3eee9435dd17 | 127 | /** |
EricLew | 0:3eee9435dd17 | 128 | * @brief This function handles SVCall exception. |
EricLew | 0:3eee9435dd17 | 129 | * @param None |
EricLew | 0:3eee9435dd17 | 130 | * @retval None |
EricLew | 0:3eee9435dd17 | 131 | */ |
EricLew | 0:3eee9435dd17 | 132 | void SVC_Handler(void) |
EricLew | 0:3eee9435dd17 | 133 | { |
EricLew | 0:3eee9435dd17 | 134 | } |
EricLew | 0:3eee9435dd17 | 135 | |
EricLew | 0:3eee9435dd17 | 136 | /** |
EricLew | 0:3eee9435dd17 | 137 | * @brief This function handles Debug Monitor exception. |
EricLew | 0:3eee9435dd17 | 138 | * @param None |
EricLew | 0:3eee9435dd17 | 139 | * @retval None |
EricLew | 0:3eee9435dd17 | 140 | */ |
EricLew | 0:3eee9435dd17 | 141 | void DebugMon_Handler(void) |
EricLew | 0:3eee9435dd17 | 142 | { |
EricLew | 0:3eee9435dd17 | 143 | } |
EricLew | 0:3eee9435dd17 | 144 | |
EricLew | 0:3eee9435dd17 | 145 | /** |
EricLew | 0:3eee9435dd17 | 146 | * @brief This function handles PendSVC exception. |
EricLew | 0:3eee9435dd17 | 147 | * @param None |
EricLew | 0:3eee9435dd17 | 148 | * @retval None |
EricLew | 0:3eee9435dd17 | 149 | */ |
EricLew | 0:3eee9435dd17 | 150 | void PendSV_Handler(void) |
EricLew | 0:3eee9435dd17 | 151 | { |
EricLew | 0:3eee9435dd17 | 152 | } |
EricLew | 0:3eee9435dd17 | 153 | |
EricLew | 0:3eee9435dd17 | 154 | /** |
EricLew | 0:3eee9435dd17 | 155 | * @brief This function handles SysTick Handler. |
EricLew | 0:3eee9435dd17 | 156 | * @param None |
EricLew | 0:3eee9435dd17 | 157 | * @retval None |
EricLew | 0:3eee9435dd17 | 158 | */ |
EricLew | 0:3eee9435dd17 | 159 | void SysTick_Handler(void) |
EricLew | 0:3eee9435dd17 | 160 | { |
EricLew | 0:3eee9435dd17 | 161 | HAL_IncTick(); |
EricLew | 0:3eee9435dd17 | 162 | } |
EricLew | 0:3eee9435dd17 | 163 | |
EricLew | 0:3eee9435dd17 | 164 | /******************************************************************************/ |
EricLew | 0:3eee9435dd17 | 165 | /* STM32L4xx Peripherals Interrupt Handlers */ |
EricLew | 0:3eee9435dd17 | 166 | /* Add here the Interrupt Handler for the used peripheral(s) (PPP), for the */ |
EricLew | 0:3eee9435dd17 | 167 | /* available peripheral interrupt handler's name please refer to the startup */ |
EricLew | 0:3eee9435dd17 | 168 | /* file (startup_stm32l4xx.s). */ |
EricLew | 0:3eee9435dd17 | 169 | /******************************************************************************/ |
EricLew | 0:3eee9435dd17 | 170 | |
EricLew | 0:3eee9435dd17 | 171 | /** |
EricLew | 0:3eee9435dd17 | 172 | * @brief This function handles DMA1_Channel4 interrupt request. |
EricLew | 0:3eee9435dd17 | 173 | * @param None |
EricLew | 0:3eee9435dd17 | 174 | * @retval None |
EricLew | 0:3eee9435dd17 | 175 | */ |
EricLew | 0:3eee9435dd17 | 176 | void DMA1_Channel4_IRQHandler(void) |
EricLew | 0:3eee9435dd17 | 177 | { |
EricLew | 0:3eee9435dd17 | 178 | pc.printf("wat"); |
EricLew | 0:3eee9435dd17 | 179 | HAL_DMA_IRQHandler(&hDmaSai); |
EricLew | 0:3eee9435dd17 | 180 | |
EricLew | 0:3eee9435dd17 | 181 | } |
EricLew | 0:3eee9435dd17 | 182 | |
EricLew | 0:3eee9435dd17 | 183 | /** |
EricLew | 0:3eee9435dd17 | 184 | * @brief This function handles SAI DMA interrupt request. |
EricLew | 0:3eee9435dd17 | 185 | * @param None |
EricLew | 0:3eee9435dd17 | 186 | * @retval None |
EricLew | 0:3eee9435dd17 | 187 | */ |
EricLew | 0:3eee9435dd17 | 188 | void DMA2_Channel1_IRQHandler(void) |
EricLew | 0:3eee9435dd17 | 189 | { |
EricLew | 0:3eee9435dd17 | 190 | HAL_DMA_IRQHandler(BSP_AUDIO_hSai.hdmatx); |
EricLew | 0:3eee9435dd17 | 191 | } |
EricLew | 0:3eee9435dd17 | 192 | |
EricLew | 0:3eee9435dd17 | 193 | /** |
EricLew | 0:3eee9435dd17 | 194 | * @} |
EricLew | 0:3eee9435dd17 | 195 | */ |
EricLew | 0:3eee9435dd17 | 196 | |
EricLew | 0:3eee9435dd17 | 197 | /** |
EricLew | 0:3eee9435dd17 | 198 | * @} |
EricLew | 0:3eee9435dd17 | 199 | */ |
EricLew | 0:3eee9435dd17 | 200 | |
EricLew | 0:3eee9435dd17 | 201 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
EricLew | 0:3eee9435dd17 | 202 |