stm8s_it.c 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514
  1. /**
  2. ******************************************************************************
  3. * @file stm8s_it.c
  4. * @author MCD Application Team
  5. * @version V2.3.0
  6. * @date 16-June-2017
  7. * @brief Main Interrupt Service Routines.
  8. * This file provides template for all peripherals interrupt service
  9. * routine.
  10. ******************************************************************************
  11. * @attention
  12. *
  13. * <h2><center>&copy; COPYRIGHT 2014 STMicroelectronics</center></h2>
  14. *
  15. * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
  16. * You may not use this file except in compliance with the License.
  17. * You may obtain a copy of the License at:
  18. *
  19. * http://www.st.com/software_license_agreement_liberty_v2
  20. *
  21. * Unless required by applicable law or agreed to in writing, software
  22. * distributed under the License is distributed on an "AS IS" BASIS,
  23. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  24. * See the License for the specific language governing permissions and
  25. * limitations under the License.
  26. *
  27. ******************************************************************************
  28. */
  29. /* Includes ------------------------------------------------------------------*/
  30. #include "stm8s_it.h"
  31. /** @addtogroup Template_Project
  32. * @{
  33. */
  34. /* Private typedef -----------------------------------------------------------*/
  35. /* Private define ------------------------------------------------------------*/
  36. /* Private macro -------------------------------------------------------------*/
  37. /* Private variables ---------------------------------------------------------*/
  38. /* Private function prototypes -----------------------------------------------*/
  39. /* Private functions ---------------------------------------------------------*/
  40. /* Public functions ----------------------------------------------------------*/
  41. #ifdef _COSMIC_
  42. /**
  43. * @brief Dummy Interrupt routine
  44. * @par Parameters:
  45. * None
  46. * @retval
  47. * None
  48. */
  49. INTERRUPT_HANDLER(NonHandledInterrupt, 25)
  50. {
  51. /* In order to detect unexpected events during development,
  52. it is recommended to set a breakpoint on the following instruction.
  53. */
  54. }
  55. #endif /*_COSMIC_*/
  56. /**
  57. * @brief TRAP Interrupt routine
  58. * @param None
  59. * @retval None
  60. */
  61. INTERRUPT_HANDLER_TRAP(TRAP_IRQHandler)
  62. {
  63. /* In order to detect unexpected events during development,
  64. it is recommended to set a breakpoint on the following instruction.
  65. */
  66. }
  67. /**
  68. * @brief Top Level Interrupt routine.
  69. * @param None
  70. * @retval None
  71. */
  72. INTERRUPT_HANDLER(TLI_IRQHandler, 0)
  73. {
  74. /* In order to detect unexpected events during development,
  75. it is recommended to set a breakpoint on the following instruction.
  76. */
  77. }
  78. /**
  79. * @brief Auto Wake Up Interrupt routine.
  80. * @param None
  81. * @retval None
  82. */
  83. INTERRUPT_HANDLER(AWU_IRQHandler, 1)
  84. {
  85. /* In order to detect unexpected events during development,
  86. it is recommended to set a breakpoint on the following instruction.
  87. */
  88. }
  89. /**
  90. * @brief Clock Controller Interrupt routine.
  91. * @param None
  92. * @retval None
  93. */
  94. INTERRUPT_HANDLER(CLK_IRQHandler, 2)
  95. {
  96. /* In order to detect unexpected events during development,
  97. it is recommended to set a breakpoint on the following instruction.
  98. */
  99. }
  100. /**
  101. * @brief External Interrupt PORTA Interrupt routine.
  102. * @param None
  103. * @retval None
  104. */
  105. INTERRUPT_HANDLER(EXTI_PORTA_IRQHandler, 3)
  106. {
  107. /* In order to detect unexpected events during development,
  108. it is recommended to set a breakpoint on the following instruction.
  109. */
  110. }
  111. /**
  112. * @brief External Interrupt PORTB Interrupt routine.
  113. * @param None
  114. * @retval None
  115. */
  116. INTERRUPT_HANDLER(EXTI_PORTB_IRQHandler, 4)
  117. {
  118. /* In order to detect unexpected events during development,
  119. it is recommended to set a breakpoint on the following instruction.
  120. */
  121. }
  122. /**
  123. * @brief External Interrupt PORTC Interrupt routine.
  124. * @param None
  125. * @retval None
  126. */
  127. INTERRUPT_HANDLER(EXTI_PORTC_IRQHandler, 5)
  128. {
  129. /* In order to detect unexpected events during development,
  130. it is recommended to set a breakpoint on the following instruction.
  131. */
  132. }
  133. /**
  134. * @brief External Interrupt PORTD Interrupt routine.
  135. * @param None
  136. * @retval None
  137. */
  138. INTERRUPT_HANDLER(EXTI_PORTD_IRQHandler, 6)
  139. {
  140. /* In order to detect unexpected events during development,
  141. it is recommended to set a breakpoint on the following instruction.
  142. */
  143. }
  144. /**
  145. * @brief External Interrupt PORTE Interrupt routine.
  146. * @param None
  147. * @retval None
  148. */
  149. INTERRUPT_HANDLER(EXTI_PORTE_IRQHandler, 7)
  150. {
  151. /* In order to detect unexpected events during development,
  152. it is recommended to set a breakpoint on the following instruction.
  153. */
  154. }
  155. #if defined (STM8S903) || defined (STM8AF622x)
  156. /**
  157. * @brief External Interrupt PORTF Interrupt routine.
  158. * @param None
  159. * @retval None
  160. */
  161. INTERRUPT_HANDLER(EXTI_PORTF_IRQHandler, 8)
  162. {
  163. /* In order to detect unexpected events during development,
  164. it is recommended to set a breakpoint on the following instruction.
  165. */
  166. }
  167. #endif /* (STM8S903) || (STM8AF622x) */
  168. #if defined (STM8S208) || defined (STM8AF52Ax)
  169. /**
  170. * @brief CAN RX Interrupt routine.
  171. * @param None
  172. * @retval None
  173. */
  174. INTERRUPT_HANDLER(CAN_RX_IRQHandler, 8)
  175. {
  176. /* In order to detect unexpected events during development,
  177. it is recommended to set a breakpoint on the following instruction.
  178. */
  179. }
  180. /**
  181. * @brief CAN TX Interrupt routine.
  182. * @param None
  183. * @retval None
  184. */
  185. INTERRUPT_HANDLER(CAN_TX_IRQHandler, 9)
  186. {
  187. /* In order to detect unexpected events during development,
  188. it is recommended to set a breakpoint on the following instruction.
  189. */
  190. }
  191. #endif /* (STM8S208) || (STM8AF52Ax) */
  192. /**
  193. * @brief SPI Interrupt routine.
  194. * @param None
  195. * @retval None
  196. */
  197. INTERRUPT_HANDLER(SPI_IRQHandler, 10)
  198. {
  199. /* In order to detect unexpected events during development,
  200. it is recommended to set a breakpoint on the following instruction.
  201. */
  202. }
  203. /**
  204. * @brief Timer1 Update/Overflow/Trigger/Break Interrupt routine.
  205. * @param None
  206. * @retval None
  207. */
  208. INTERRUPT_HANDLER(TIM1_UPD_OVF_TRG_BRK_IRQHandler, 11)
  209. {
  210. /* In order to detect unexpected events during development,
  211. it is recommended to set a breakpoint on the following instruction.
  212. */
  213. }
  214. /**
  215. * @brief Timer1 Capture/Compare Interrupt routine.
  216. * @param None
  217. * @retval None
  218. */
  219. INTERRUPT_HANDLER(TIM1_CAP_COM_IRQHandler, 12)
  220. {
  221. /* In order to detect unexpected events during development,
  222. it is recommended to set a breakpoint on the following instruction.
  223. */
  224. }
  225. #if defined (STM8S903) || defined (STM8AF622x)
  226. /**
  227. * @brief Timer5 Update/Overflow/Break/Trigger Interrupt routine.
  228. * @param None
  229. * @retval None
  230. */
  231. INTERRUPT_HANDLER(TIM5_UPD_OVF_BRK_TRG_IRQHandler, 13)
  232. {
  233. /* In order to detect unexpected events during development,
  234. it is recommended to set a breakpoint on the following instruction.
  235. */
  236. }
  237. /**
  238. * @brief Timer5 Capture/Compare Interrupt routine.
  239. * @param None
  240. * @retval None
  241. */
  242. INTERRUPT_HANDLER(TIM5_CAP_COM_IRQHandler, 14)
  243. {
  244. /* In order to detect unexpected events during development,
  245. it is recommended to set a breakpoint on the following instruction.
  246. */
  247. }
  248. #else /* (STM8S208) || (STM8S207) || (STM8S105) || (STM8S103) || (STM8AF62Ax) || (STM8AF52Ax) || (STM8AF626x) */
  249. /**
  250. * @brief Timer2 Update/Overflow/Break Interrupt routine.
  251. * @param None
  252. * @retval None
  253. */
  254. INTERRUPT_HANDLER(TIM2_UPD_OVF_BRK_IRQHandler, 13)
  255. {
  256. /* In order to detect unexpected events during development,
  257. it is recommended to set a breakpoint on the following instruction.
  258. */
  259. }
  260. /**
  261. * @brief Timer2 Capture/Compare Interrupt routine.
  262. * @param None
  263. * @retval None
  264. */
  265. INTERRUPT_HANDLER(TIM2_CAP_COM_IRQHandler, 14)
  266. {
  267. /* In order to detect unexpected events during development,
  268. it is recommended to set a breakpoint on the following instruction.
  269. */
  270. }
  271. #endif /* (STM8S903) || (STM8AF622x) */
  272. #if defined (STM8S208) || defined(STM8S207) || defined(STM8S007) || defined(STM8S105) || \
  273. defined(STM8S005) || defined (STM8AF62Ax) || defined (STM8AF52Ax) || defined (STM8AF626x)
  274. /**
  275. * @brief Timer3 Update/Overflow/Break Interrupt routine.
  276. * @param None
  277. * @retval None
  278. */
  279. INTERRUPT_HANDLER(TIM3_UPD_OVF_BRK_IRQHandler, 15)
  280. {
  281. /* In order to detect unexpected events during development,
  282. it is recommended to set a breakpoint on the following instruction.
  283. */
  284. }
  285. /**
  286. * @brief Timer3 Capture/Compare Interrupt routine.
  287. * @param None
  288. * @retval None
  289. */
  290. INTERRUPT_HANDLER(TIM3_CAP_COM_IRQHandler, 16)
  291. {
  292. /* In order to detect unexpected events during development,
  293. it is recommended to set a breakpoint on the following instruction.
  294. */
  295. }
  296. #endif /* (STM8S208) || (STM8S207) || (STM8S105) || (STM8AF62Ax) || (STM8AF52Ax) || (STM8AF626x) */
  297. #if defined (STM8S208) || defined(STM8S207) || defined(STM8S007) || defined(STM8S103) || \
  298. defined (STM8S003) || defined(STM8S001) || defined (STM8AF62Ax) || defined (STM8AF52Ax) || defined (STM8S903)
  299. /**
  300. * @brief UART1 TX Interrupt routine.
  301. * @param None
  302. * @retval None
  303. */
  304. INTERRUPT_HANDLER(UART1_TX_IRQHandler, 17)
  305. {
  306. /* In order to detect unexpected events during development,
  307. it is recommended to set a breakpoint on the following instruction.
  308. */
  309. }
  310. /**
  311. * @brief UART1 RX Interrupt routine.
  312. * @param None
  313. * @retval None
  314. */
  315. INTERRUPT_HANDLER(UART1_RX_IRQHandler, 18)
  316. {
  317. /* In order to detect unexpected events during development,
  318. it is recommended to set a breakpoint on the following instruction.
  319. */
  320. }
  321. #endif /* (STM8S208) || (STM8S207) || (STM8S103) || (STM8S001) || (STM8S903) || (STM8AF62Ax) || (STM8AF52Ax) */
  322. #if defined(STM8AF622x)
  323. /**
  324. * @brief UART4 TX Interrupt routine.
  325. * @param None
  326. * @retval None
  327. */
  328. INTERRUPT_HANDLER(UART4_TX_IRQHandler, 17)
  329. {
  330. /* In order to detect unexpected events during development,
  331. it is recommended to set a breakpoint on the following instruction.
  332. */
  333. }
  334. /**
  335. * @brief UART4 RX Interrupt routine.
  336. * @param None
  337. * @retval None
  338. */
  339. INTERRUPT_HANDLER(UART4_RX_IRQHandler, 18)
  340. {
  341. /* In order to detect unexpected events during development,
  342. it is recommended to set a breakpoint on the following instruction.
  343. */
  344. }
  345. #endif /* (STM8AF622x) */
  346. /**
  347. * @brief I2C Interrupt routine.
  348. * @param None
  349. * @retval None
  350. */
  351. INTERRUPT_HANDLER(I2C_IRQHandler, 19)
  352. {
  353. /* In order to detect unexpected events during development,
  354. it is recommended to set a breakpoint on the following instruction.
  355. */
  356. }
  357. #if defined(STM8S105) || defined(STM8S005) || defined (STM8AF626x)
  358. /**
  359. * @brief UART2 TX interrupt routine.
  360. * @param None
  361. * @retval None
  362. */
  363. INTERRUPT_HANDLER(UART2_TX_IRQHandler, 20)
  364. {
  365. /* In order to detect unexpected events during development,
  366. it is recommended to set a breakpoint on the following instruction.
  367. */
  368. }
  369. /**
  370. * @brief UART2 RX interrupt routine.
  371. * @param None
  372. * @retval None
  373. */
  374. INTERRUPT_HANDLER(UART2_RX_IRQHandler, 21)
  375. {
  376. /* In order to detect unexpected events during development,
  377. it is recommended to set a breakpoint on the following instruction.
  378. */
  379. }
  380. #endif /* (STM8S105) || (STM8AF626x) */
  381. #if defined(STM8S207) || defined(STM8S007) || defined(STM8S208) || defined (STM8AF52Ax) || defined (STM8AF62Ax)
  382. /**
  383. * @brief UART3 TX interrupt routine.
  384. * @param None
  385. * @retval None
  386. */
  387. INTERRUPT_HANDLER(UART3_TX_IRQHandler, 20)
  388. {
  389. /* In order to detect unexpected events during development,
  390. it is recommended to set a breakpoint on the following instruction.
  391. */
  392. }
  393. /**
  394. * @brief UART3 RX interrupt routine.
  395. * @param None
  396. * @retval None
  397. */
  398. INTERRUPT_HANDLER(UART3_RX_IRQHandler, 21)
  399. {
  400. /* In order to detect unexpected events during development,
  401. it is recommended to set a breakpoint on the following instruction.
  402. */
  403. }
  404. #endif /* (STM8S208) || (STM8S207) || (STM8AF52Ax) || (STM8AF62Ax) */
  405. #if defined(STM8S207) || defined(STM8S007) || defined(STM8S208) || defined (STM8AF52Ax) || defined (STM8AF62Ax)
  406. /**
  407. * @brief ADC2 interrupt routine.
  408. * @param None
  409. * @retval None
  410. */
  411. INTERRUPT_HANDLER(ADC2_IRQHandler, 22)
  412. {
  413. /* In order to detect unexpected events during development,
  414. it is recommended to set a breakpoint on the following instruction.
  415. */
  416. }
  417. #else /* STM8S105 or STM8S103 or STM8S903 or STM8AF626x or STM8AF622x */
  418. /**
  419. * @brief ADC1 interrupt routine.
  420. * @par Parameters:
  421. * None
  422. * @retval
  423. * None
  424. */
  425. INTERRUPT_HANDLER(ADC1_IRQHandler, 22)
  426. {
  427. /* In order to detect unexpected events during development,
  428. it is recommended to set a breakpoint on the following instruction.
  429. */
  430. }
  431. #endif /* (STM8S208) || (STM8S207) || (STM8AF52Ax) || (STM8AF62Ax) */
  432. #if defined (STM8S903) || defined (STM8AF622x)
  433. /**
  434. * @brief Timer6 Update/Overflow/Trigger Interrupt routine.
  435. * @param None
  436. * @retval None
  437. */
  438. INTERRUPT_HANDLER(TIM6_UPD_OVF_TRG_IRQHandler, 23)
  439. {
  440. /* In order to detect unexpected events during development,
  441. it is recommended to set a breakpoint on the following instruction.
  442. */
  443. }
  444. #else /* STM8S208 or STM8S207 or STM8S105 or STM8S103 or STM8AF52Ax or STM8AF62Ax or STM8AF626x */
  445. /**
  446. * @brief Timer4 Update/Overflow Interrupt routine.
  447. * @param None
  448. * @retval None
  449. */
  450. #ifndef USE_RTOS
  451. INTERRUPT_HANDLER(TIM4_UPD_OVF_IRQHandler, 23)
  452. {
  453. /* In order to detect unexpected events during development,
  454. it is recommended to set a breakpoint on the following instruction.
  455. */
  456. }
  457. #endif // USE_RTOS
  458. #endif /* (STM8S903) || (STM8AF622x)*/
  459. /**
  460. * @brief Eeprom EEC Interrupt routine.
  461. * @param None
  462. * @retval None
  463. */
  464. INTERRUPT_HANDLER(EEPROM_EEC_IRQHandler, 24)
  465. {
  466. /* In order to detect unexpected events during development,
  467. it is recommended to set a breakpoint on the following instruction.
  468. */
  469. }
  470. /**
  471. * @}
  472. */
  473. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/