comparison libs/STM32F10x_StdPeriph_Lib_V3.5.0/Project/STM32F10x_StdPeriph_Examples/USART/DMA_Interrupt/stm32f10x_it.c @ 0:c59513fd84fb

Initial commit of STM32 test code.
author Daniel O'Connor <darius@dons.net.au>
date Mon, 03 Oct 2011 21:19:15 +1030
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:c59513fd84fb
1 /**
2 ******************************************************************************
3 * @file USART/DMA_Interrupt/stm32f10x_it.c
4 * @author MCD Application Team
5 * @version V3.5.0
6 * @date 08-April-2011
7 * @brief Main Interrupt Service Routines.
8 * This file provides template for all exceptions handler and peripherals
9 * interrupt service routine.
10 ******************************************************************************
11 * @attention
12 *
13 * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
14 * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
15 * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
16 * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
17 * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
18 * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
19 *
20 * <h2><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h2>
21 ******************************************************************************
22 */
23
24 /* Includes ------------------------------------------------------------------*/
25 #include "stm32f10x_it.h"
26
27 /** @addtogroup STM32F10x_StdPeriph_Examples
28 * @{
29 */
30
31 /** @addtogroup USART_DMA_Interrupt
32 * @{
33 */
34
35 /* Private typedef -----------------------------------------------------------*/
36 /* Private define ------------------------------------------------------------*/
37 /* Private macro -------------------------------------------------------------*/
38 /* Private variables ---------------------------------------------------------*/
39 uint8_t RxCounter = 0;
40 extern uint8_t RxBuffer2[];
41 extern uint8_t NbrOfDataToRead;
42
43 /* Private function prototypes -----------------------------------------------*/
44 /* Private functions ---------------------------------------------------------*/
45
46 /******************************************************************************/
47 /* Cortex-M3 Processor Exceptions Handlers */
48 /******************************************************************************/
49
50 /**
51 * @brief This function handles NMI exception.
52 * @param None
53 * @retval None
54 */
55 void NMI_Handler(void)
56 {
57 }
58
59 /**
60 * @brief This function handles Hard Fault exception.
61 * @param None
62 * @retval None
63 */
64 void HardFault_Handler(void)
65 {
66 /* Go to infinite loop when Hard Fault exception occurs */
67 while (1)
68 {
69 }
70 }
71
72 /**
73 * @brief This function handles Memory Manage exception.
74 * @param None
75 * @retval None
76 */
77 void MemManage_Handler(void)
78 {
79 /* Go to infinite loop when Memory Manage exception occurs */
80 while (1)
81 {
82 }
83 }
84
85 /**
86 * @brief This function handles Bus Fault exception.
87 * @param None
88 * @retval None
89 */
90 void BusFault_Handler(void)
91 {
92 /* Go to infinite loop when Bus Fault exception occurs */
93 while (1)
94 {
95 }
96 }
97
98 /**
99 * @brief This function handles Usage Fault exception.
100 * @param None
101 * @retval None
102 */
103 void UsageFault_Handler(void)
104 {
105 /* Go to infinite loop when Usage Fault exception occurs */
106 while (1)
107 {
108 }
109 }
110
111 /**
112 * @brief This function handles SVCall exception.
113 * @param None
114 * @retval None
115 */
116 void SVC_Handler(void)
117 {
118 }
119
120 /**
121 * @brief This function handles Debug Monitor exception.
122 * @param None
123 * @retval None
124 */
125 void DebugMon_Handler(void)
126 {
127 }
128
129 /**
130 * @brief This function handles PendSV_Handler exception.
131 * @param None
132 * @retval None
133 */
134 void PendSV_Handler(void)
135 {
136 }
137
138 /**
139 * @brief This function handles SysTick Handler.
140 * @param None
141 * @retval None
142 */
143 void SysTick_Handler(void)
144 {
145 }
146
147 /******************************************************************************/
148 /* STM32F10x Peripherals Interrupt Handlers */
149 /******************************************************************************/
150
151 /**
152 * @brief This function handles USART2 global interrupt request.
153 * @param None
154 * @retval None
155 */
156 void USART2_IRQHandler(void)
157 {
158 if(USART_GetITStatus(USART2, USART_IT_RXNE) != RESET)
159 {
160 /* Read one byte from the receive data register */
161 RxBuffer2[RxCounter++] = USART_ReceiveData(USART2);
162
163 if(RxCounter == NbrOfDataToRead)
164 {
165 /* Disable the USART2 Receive interrupt */
166 USART_ITConfig(USART2, USART_IT_RXNE, DISABLE);
167 }
168 }
169 }
170
171 /**
172 * @brief This function handles USART3 global interrupt request.
173 * @param None
174 * @retval None
175 */
176 void USART3_IRQHandler(void)
177 {
178 if(USART_GetITStatus(USART3, USART_IT_RXNE) != RESET)
179 {
180 /* Read one byte from the receive data register */
181 RxBuffer2[RxCounter++] = USART_ReceiveData(USART3);
182
183 if(RxCounter == NbrOfDataToRead)
184 {
185 /* Disable the USART3 Receive interrupt */
186 USART_ITConfig(USART3, USART_IT_RXNE, DISABLE);
187 }
188 }
189 }
190
191 /******************************************************************************/
192 /* STM32F10x Peripherals Interrupt Handlers */
193 /* Add here the Interrupt Handler for the used peripheral(s) (PPP), for the */
194 /* available peripheral interrupt handler's name please refer to the startup */
195 /* file (startup_stm32f10x_xx.s). */
196 /******************************************************************************/
197
198 /**
199 * @brief This function handles PPP interrupt request.
200 * @param None
201 * @retval None
202 */
203 /*void PPP_IRQHandler(void)
204 {
205 }*/
206
207 /**
208 * @}
209 */
210
211 /**
212 * @}
213 */
214
215 /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/