Mercurial > ~darius > hgwebdir.cgi > stm32temp
comparison libs/STM32F10x_StdPeriph_Lib_V3.5.0/Project/STM32F10x_StdPeriph_Examples/I2C/I2C_TSENSOR/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 I2C/I2C_TSENSOR/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>© COPYRIGHT 2011 STMicroelectronics</center></h2> | |
21 ****************************************************************************** | |
22 */ | |
23 | |
24 /* Includes ------------------------------------------------------------------*/ | |
25 #include "stm32f10x_it.h" | |
26 #include "stm32_eval_i2c_tsensor.h" | |
27 | |
28 /** @addtogroup STM32F10x_StdPeriph_Examples | |
29 * @{ | |
30 */ | |
31 | |
32 /** @addtogroup I2C_TSENSOR | |
33 * @{ | |
34 */ | |
35 | |
36 /* Private typedef -----------------------------------------------------------*/ | |
37 /* Private define ------------------------------------------------------------*/ | |
38 /* Private macro -------------------------------------------------------------*/ | |
39 /* Private variables ---------------------------------------------------------*/ | |
40 extern __IO uint8_t SMbusAlertOccurred; | |
41 | |
42 /* Private function prototypes -----------------------------------------------*/ | |
43 /* Private functions ---------------------------------------------------------*/ | |
44 | |
45 /******************************************************************************/ | |
46 /* Cortex-M3 Processor Exceptions Handlers */ | |
47 /******************************************************************************/ | |
48 | |
49 /** | |
50 * @brief This function handles NMI exception. | |
51 * @param None | |
52 * @retval None | |
53 */ | |
54 void NMI_Handler(void) | |
55 { | |
56 } | |
57 | |
58 /** | |
59 * @brief This function handles Hard Fault exception. | |
60 * @param None | |
61 * @retval None | |
62 */ | |
63 void HardFault_Handler(void) | |
64 { | |
65 /* Go to infinite loop when Hard Fault exception occurs */ | |
66 while (1) | |
67 { | |
68 } | |
69 } | |
70 | |
71 /** | |
72 * @brief This function handles Memory Manage exception. | |
73 * @param None | |
74 * @retval None | |
75 */ | |
76 void MemManage_Handler(void) | |
77 { | |
78 /* Go to infinite loop when Memory Manage exception occurs */ | |
79 while (1) | |
80 { | |
81 } | |
82 } | |
83 | |
84 /** | |
85 * @brief This function handles Bus Fault exception. | |
86 * @param None | |
87 * @retval None | |
88 */ | |
89 void BusFault_Handler(void) | |
90 { | |
91 /* Go to infinite loop when Bus Fault exception occurs */ | |
92 while (1) | |
93 { | |
94 } | |
95 } | |
96 | |
97 /** | |
98 * @brief This function handles Usage Fault exception. | |
99 * @param None | |
100 * @retval None | |
101 */ | |
102 void UsageFault_Handler(void) | |
103 { | |
104 /* Go to infinite loop when Usage Fault exception occurs */ | |
105 while (1) | |
106 { | |
107 } | |
108 } | |
109 | |
110 /** | |
111 * @brief This function handles SVCall exception. | |
112 * @param None | |
113 * @retval None | |
114 */ | |
115 void SVC_Handler(void) | |
116 { | |
117 } | |
118 | |
119 /** | |
120 * @brief This function handles Debug Monitor exception. | |
121 * @param None | |
122 * @retval None | |
123 */ | |
124 void DebugMon_Handler(void) | |
125 { | |
126 } | |
127 | |
128 /** | |
129 * @brief This function handles PendSV_Handler exception. | |
130 * @param None | |
131 * @retval None | |
132 */ | |
133 void PendSV_Handler(void) | |
134 { | |
135 } | |
136 | |
137 /** | |
138 * @brief This function handles SysTick Handler. | |
139 * @param None | |
140 * @retval None | |
141 */ | |
142 void SysTick_Handler(void) | |
143 { | |
144 } | |
145 | |
146 /******************************************************************************/ | |
147 /* STM32F10x Peripherals Interrupt Handlers */ | |
148 /******************************************************************************/ | |
149 /** | |
150 * @brief This function handles I2C2 Error interrupt request. | |
151 * @param None | |
152 * @retval None | |
153 */ | |
154 #ifdef USE_STM32100E_EVAL | |
155 void I2C2_ER_IRQHandler(void) | |
156 #else | |
157 void I2C1_ER_IRQHandler(void) | |
158 #endif /* STM32100E-EVAL */ | |
159 { | |
160 /* Check on I2C2 SMBALERT flag and clear it */ | |
161 if (I2C_GetITStatus(LM75_I2C, I2C_IT_SMBALERT)) | |
162 { | |
163 I2C_ClearITPendingBit(LM75_I2C, I2C_IT_SMBALERT); | |
164 SMbusAlertOccurred++; | |
165 } | |
166 /* Check on I2C2 Time out flag and clear it */ | |
167 if (I2C_GetITStatus(LM75_I2C, I2C_IT_TIMEOUT)) | |
168 { | |
169 I2C_ClearITPendingBit(LM75_I2C, I2C_IT_TIMEOUT); | |
170 } | |
171 /* Check on I2C2 Arbitration Lost flag and clear it */ | |
172 if (I2C_GetITStatus(LM75_I2C, I2C_IT_ARLO)) | |
173 { | |
174 I2C_ClearITPendingBit(LM75_I2C, I2C_IT_ARLO); | |
175 } | |
176 | |
177 /* Check on I2C2 PEC error flag and clear it */ | |
178 if (I2C_GetITStatus(LM75_I2C, I2C_IT_PECERR)) | |
179 { | |
180 I2C_ClearITPendingBit(LM75_I2C, I2C_IT_PECERR); | |
181 } | |
182 /* Check on I2C2 Overrun/Underrun error flag and clear it */ | |
183 if (I2C_GetITStatus(LM75_I2C, I2C_IT_OVR)) | |
184 { | |
185 I2C_ClearITPendingBit(LM75_I2C, I2C_IT_OVR); | |
186 } | |
187 /* Check on I2C2 Acknowledge failure error flag and clear it */ | |
188 if (I2C_GetITStatus(LM75_I2C, I2C_IT_AF)) | |
189 { | |
190 I2C_ClearITPendingBit(LM75_I2C, I2C_IT_AF); | |
191 } | |
192 /* Check on I2C2 Bus error flag and clear it */ | |
193 if (I2C_GetITStatus(LM75_I2C, I2C_IT_BERR)) | |
194 { | |
195 I2C_ClearITPendingBit(LM75_I2C, I2C_IT_BERR); | |
196 } | |
197 } | |
198 | |
199 /******************************************************************************/ | |
200 /* STM32F10x Peripherals Interrupt Handlers */ | |
201 /* Add here the Interrupt Handler for the used peripheral(s) (PPP), for the */ | |
202 /* available peripheral interrupt handler's name please refer to the startup */ | |
203 /* file (startup_stm32f10x_xx.s). */ | |
204 /******************************************************************************/ | |
205 | |
206 /** | |
207 * @brief This function handles PPP interrupt request. | |
208 * @param None | |
209 * @retval None | |
210 */ | |
211 /*void PPP_IRQHandler(void) | |
212 { | |
213 }*/ | |
214 | |
215 /** | |
216 * @} | |
217 */ | |
218 | |
219 /** | |
220 * @} | |
221 */ | |
222 | |
223 /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ |