X-CUBE-SPN11 for X-NUCLEO-IHM11M1: stm32f4xx_it.c Source File

X-CUBE-SPN11 for X-NUCLEO-IHM11M1

stm32f4xx_it.c
Go to the documentation of this file.
1 /**
2  ******************************************************************************
3  * @file stm32f4xx_it.c
4  * @date 10/07/2016
5  * @brief Interrupt Service Routines.
6  ******************************************************************************
7  *
8  * COPYRIGHT(c) 2015 STMicroelectronics
9  *
10  * Redistribution and use in source and binary forms, with or without modification,
11  * are permitted provided that the following conditions are met:
12  * 1. Redistributions of source code must retain the above copyright notice,
13  * this list of conditions and the following disclaimer.
14  * 2. Redistributions in binary form must reproduce the above copyright notice,
15  * this list of conditions and the following disclaimer in the documentation
16  * and/or other materials provided with the distribution.
17  * 3. Neither the name of STMicroelectronics nor the names of its contributors
18  * may be used to endorse or promote products derived from this software
19  * without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  *
32  ******************************************************************************
33  */
34 /* Includes ------------------------------------------------------------------*/
35 #include "stm32f4xx_hal.h"
36 #include "stm32f4xx.h"
37 #include "stm32f4xx_it.h"
38 /* USER CODE BEGIN 0 */
39 #include "6Step_Lib.h"
40 
41 extern SIXSTEP_Base_InitTypeDef SIXSTEP_parameters; /*!< Main SixStep structure*/
42 extern void UART_Set_Value(void);
43 /* USER CODE END 0 */
44 /* External variables --------------------------------------------------------*/
45 
46 extern ADC_HandleTypeDef hadc1;
47 extern TIM_HandleTypeDef htim1;
48 extern TIM_HandleTypeDef htim4;
49 extern UART_HandleTypeDef huart2;
50 
51 
52 /******************************************************************************/
53 /* Cortex-M4 Processor Interruption and Exception Handlers */
54 /******************************************************************************/
55 
56 /**
57 * @brief This function handles ADC1 global interrupt.
58 */
59 void ADC_IRQHandler(void)
60 {
61  /* USER CODE BEGIN ADC_IRQn 0 */
62 
63  /* USER CODE END ADC_IRQn 0 */
64  HAL_ADC_IRQHandler(&hadc1);
65  /* USER CODE BEGIN ADC_IRQn 1 */
66 
67  /* USER CODE END ADC_IRQn 1 */
68 }
69 
70 /**
71 * @brief This function handles System tick timer.
72 */
73 void SysTick_Handler(void)
74 {
75  /* USER CODE BEGIN SysTick_IRQn 0 */
76 
77  /* USER CODE END SysTick_IRQn 0 */
78  HAL_IncTick();
79  HAL_SYSTICK_IRQHandler();
80  /* USER CODE BEGIN SysTick_IRQn 1 */
81 
82  /* USER CODE END SysTick_IRQn 1 */
83 }
84 
85 /**
86 * @brief This function handles USART2 global interrupt.
87 */
89 {
90  /* USER CODE BEGIN USART2_IRQn 0 */
91 
92  /* USER CODE END USART2_IRQn 0 */
93  HAL_UART_IRQHandler(&huart2);
94  /* USER CODE BEGIN USART2_IRQn 1 */
95 #ifdef UART_COMM
97 #endif
98  /* USER CODE END USART2_IRQn 1 */
99 }
100 
101 /**
102 * @brief This function handles TIM4 global interrupt.
103 */
104 void TIM4_IRQHandler(void)
105 {
106  /* USER CODE BEGIN TIM4_IRQn 0 */
107 
108  /* USER CODE END TIM4_IRQn 0 */
109  HAL_TIM_IRQHandler(&htim4);
110  /* USER CODE BEGIN TIM4_IRQn 1 */
111 
112  /* USER CODE END TIM4_IRQn 1 */
113 }
114 
115 /**
116 * @brief This function handles EXTI Line[15:10] interrupts.
117 */
119 {
120  /* USER CODE BEGIN EXTI15_10_IRQn 0 */
121 
122  /* USER CODE END EXTI15_10_IRQn 0 */
123  HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_13);
124  /* USER CODE BEGIN EXTI15_10_IRQn 1 */
125 
126  /* USER CODE END EXTI15_10_IRQn 1 */
127 }
128 
129 /**
130 * @brief This function handles TIM1 Break interrupt and TIM9 global interrupt.
131 */
133 {
134  /* USER CODE BEGIN TIM1_BRK_TIM9_IRQn 0 */
135  if(__HAL_TIM_GET_FLAG(&htim1, TIM_FLAG_BREAK) != RESET)
136  {
137  MC_StopMotor();
138  SIXSTEP_parameters.STATUS = OVERCURRENT;
139  }
140  /* USER CODE END TIM1_BRK_TIM9_IRQn 0 */
141  HAL_TIM_IRQHandler(&htim1);
142  /* USER CODE BEGIN TIM1_BRK_TIM9_IRQn 1 */
143 
144  /* USER CODE END TIM1_BRK_TIM9_IRQn 1 */
145 }
146 
147 /* USER CODE BEGIN 1 */
148 
149 /* USER CODE END 1 */
150 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
void TIM4_IRQHandler(void)
This function handles TIM4 global interrupt.
Definition: stm32f4xx_it.c:104
void MC_StopMotor(void)
Definition: 6Step_Lib.c:1000
TIM_HandleTypeDef htim1
Definition: main_F401.c:48
void USART2_IRQHandler(void)
This function handles USART2 global interrupt.
Definition: stm32f4xx_it.c:88
void TIM1_BRK_TIM9_IRQHandler(void)
This function handles TIM1 Break interrupt and TIM9 global interrupt.
Definition: stm32f4xx_it.c:132
void UART_Set_Value(void)
This file contains the headers of the interrupt handlers.
UART_HandleTypeDef huart2
Definition: main_F401.c:53
void EXTI15_10_IRQHandler(void)
This function handles EXTI Line[15:10] interrupts.
Definition: stm32f4xx_it.c:118
SIXSTEP_Base_SystStatus_t STATUS
Definition: 6Step_Lib.h:102
void SysTick_Handler(void)
This function handles System tick timer.
Definition: stm32f4xx_it.c:73
SIXSTEP_Base_InitTypeDef SIXSTEP_parameters
Definition: 6Step_Lib.c:73
TIM_HandleTypeDef htim4
Definition: main_F401.c:51
Six Step parameters.
Definition: 6Step_Lib.h:94
This header file provides the set of functions for Motor Control library.
ADC_HandleTypeDef hadc1
Definition: main_F401.c:46
void ADC_IRQHandler(void)
This function handles ADC1 global interrupt.
Definition: stm32f4xx_it.c:59
void HAL_IncTick(void)
This function is called to increment a global variable "uwTick" used as application time base...
Definition: 6Step_Lib.c:1607
Generated by   doxygen 1.8.11