Simple mbed library with macros

Dependents:   SimpleTimer SimpleUART SimpleTimer Stoppuhr1

Committer:
Alkorin
Date:
Sat Nov 13 23:00:24 2010 +0000
Revision:
11:20e2539b6c2b
Parent:
8:f8b47457fdcf
Child:
14:23c6d41cb377
Added __IRQ #define to be able to compile with gcc

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Alkorin 8:f8b47457fdcf 1 /*
Alkorin 8:f8b47457fdcf 2 * Copyright or © or Copr. 2010, Thomas SOETE
Alkorin 8:f8b47457fdcf 3 *
Alkorin 8:f8b47457fdcf 4 * Author e-mail: thomas@soete.org
Alkorin 8:f8b47457fdcf 5 *
Alkorin 8:f8b47457fdcf 6 * This software is governed by the CeCILL license under French law and
Alkorin 8:f8b47457fdcf 7 * abiding by the rules of distribution of free software. You can use,
Alkorin 8:f8b47457fdcf 8 * modify and/ or redistribute the software under the terms of the CeCILL
Alkorin 8:f8b47457fdcf 9 * license as circulated by CEA, CNRS and INRIA at the following URL
Alkorin 8:f8b47457fdcf 10 * "http://www.cecill.info".
Alkorin 8:f8b47457fdcf 11 *
Alkorin 8:f8b47457fdcf 12 * As a counterpart to the access to the source code and rights to copy,
Alkorin 8:f8b47457fdcf 13 * modify and redistribute granted by the license, users are provided only
Alkorin 8:f8b47457fdcf 14 * with a limited warranty and the software's author, the holder of the
Alkorin 8:f8b47457fdcf 15 * economic rights, and the successive licensors have only limited
Alkorin 8:f8b47457fdcf 16 * liability.
Alkorin 8:f8b47457fdcf 17 *
Alkorin 8:f8b47457fdcf 18 * In this respect, the user's attention is drawn to the risks associated
Alkorin 8:f8b47457fdcf 19 * with loading, using, modifying and/or developing or reproducing the
Alkorin 8:f8b47457fdcf 20 * software by the user in light of its specific status of free software,
Alkorin 8:f8b47457fdcf 21 * that may mean that it is complicated to manipulate, and that also
Alkorin 8:f8b47457fdcf 22 * therefore means that it is reserved for developers and experienced
Alkorin 8:f8b47457fdcf 23 * professionals having in-depth computer knowledge. Users are therefore
Alkorin 8:f8b47457fdcf 24 * encouraged to load and test the software's suitability as regards their
Alkorin 8:f8b47457fdcf 25 * requirements in conditions enabling the security of their systems and/or
Alkorin 8:f8b47457fdcf 26 * data to be ensured and, more generally, to use and operate it in the
Alkorin 8:f8b47457fdcf 27 * same conditions as regards security.
Alkorin 8:f8b47457fdcf 28 *
Alkorin 8:f8b47457fdcf 29 * The fact that you are presently reading this means that you have had
Alkorin 8:f8b47457fdcf 30 * knowledge of the CeCILL license and that you accept its terms.
Alkorin 8:f8b47457fdcf 31 */
Alkorin 8:f8b47457fdcf 32
Alkorin 5:b3aa0a49e21f 33 #ifndef __INTERRUPTS_H__
Alkorin 5:b3aa0a49e21f 34 #define __INTERRUPTS_H__
Alkorin 5:b3aa0a49e21f 35
Alkorin 5:b3aa0a49e21f 36 /** Interrupt Managment **/
Alkorin 5:b3aa0a49e21f 37 #define ENABLE_INTERRUPT(intr) NVIC_EnableIRQ(intr)
Alkorin 5:b3aa0a49e21f 38 #define DISABLE_INTERRUPT(intr) NVIC_DisableIRQ(intr)
Alkorin 5:b3aa0a49e21f 39
Alkorin 11:20e2539b6c2b 40 #if defined ( __CC_ARM )
Alkorin 11:20e2539b6c2b 41 #define __IRQ __irq
Alkorin 11:20e2539b6c2b 42 #elif defined ( __GNUC__ )
Alkorin 11:20e2539b6c2b 43 #define __IRQ __attribute__((interrupt("IRQ")))
Alkorin 11:20e2539b6c2b 44 #endif
Alkorin 11:20e2539b6c2b 45
Alkorin 5:b3aa0a49e21f 46 /* Interrupts names
Alkorin 5:b3aa0a49e21f 47 * WDT_IRQn Watchdog Timer Interrupt
Alkorin 5:b3aa0a49e21f 48 * TIMER0_IRQn Timer0 Interrupt
Alkorin 5:b3aa0a49e21f 49 * TIMER1_IRQn Timer1 Interrupt
Alkorin 5:b3aa0a49e21f 50 * TIMER2_IRQn Timer2 Interrupt
Alkorin 5:b3aa0a49e21f 51 * TIMER3_IRQn Timer3 Interrupt
Alkorin 5:b3aa0a49e21f 52 * UART0_IRQn UART0 Interrupt
Alkorin 5:b3aa0a49e21f 53 * UART1_IRQn UART1 Interrupt
Alkorin 5:b3aa0a49e21f 54 * UART2_IRQn UART2 Interrupt
Alkorin 5:b3aa0a49e21f 55 * UART3_IRQn UART3 Interrupt
Alkorin 5:b3aa0a49e21f 56 * PWM1_IRQn PWM1 Interrupt
Alkorin 5:b3aa0a49e21f 57 * I2C0_IRQn I2C0 Interrupt
Alkorin 5:b3aa0a49e21f 58 * I2C1_IRQn I2C1 Interrupt
Alkorin 5:b3aa0a49e21f 59 * I2C2_IRQn I2C2 Interrupt
Alkorin 5:b3aa0a49e21f 60 * SPI_IRQn SPI Interrupt
Alkorin 5:b3aa0a49e21f 61 * SSP0_IRQn SSP0 Interrupt
Alkorin 5:b3aa0a49e21f 62 * SSP1_IRQn SSP1 Interrupt
Alkorin 5:b3aa0a49e21f 63 * PLL0_IRQn PLL0 Lock (Main PLL) Interrupt
Alkorin 5:b3aa0a49e21f 64 * RTC_IRQn Real Time Clock Interrupt
Alkorin 5:b3aa0a49e21f 65 * EINT0_IRQn External Interrupt 0 Interrupt
Alkorin 5:b3aa0a49e21f 66 * EINT1_IRQn External Interrupt 1 Interrupt
Alkorin 5:b3aa0a49e21f 67 * EINT2_IRQn External Interrupt 2 Interrupt
Alkorin 5:b3aa0a49e21f 68 * EINT3_IRQn External Interrupt 3 Interrupt
Alkorin 5:b3aa0a49e21f 69 * ADC_IRQn A/D Converter Interrupt
Alkorin 5:b3aa0a49e21f 70 * BOD_IRQn Brown-Out Detect Interrupt
Alkorin 5:b3aa0a49e21f 71 * USB_IRQn USB Interrupt
Alkorin 5:b3aa0a49e21f 72 * CAN_IRQn CAN Interrupt
Alkorin 5:b3aa0a49e21f 73 * DMA_IRQn General Purpose DMA Interrupt
Alkorin 5:b3aa0a49e21f 74 * I2S_IRQn I2S Interrupt
Alkorin 5:b3aa0a49e21f 75 * ENET_IRQn Ethernet Interrupt
Alkorin 5:b3aa0a49e21f 76 * RIT_IRQn Repetitive Interrupt Timer Interrupt
Alkorin 5:b3aa0a49e21f 77 * MCPWM_IRQn Motor Control PWM Interrupt
Alkorin 5:b3aa0a49e21f 78 * QEI_IRQn Quadrature Encoder Interface Interrupt
Alkorin 5:b3aa0a49e21f 79 * PLL1_IRQn PLL1 Lock (USB PLL) Interrupt
Alkorin 5:b3aa0a49e21f 80 */
Alkorin 5:b3aa0a49e21f 81
Alkorin 5:b3aa0a49e21f 82 /* Default interrupt handlers
Alkorin 5:b3aa0a49e21f 83 * WDT_IRQHandler
Alkorin 5:b3aa0a49e21f 84 * TIMER0_IRQHandler
Alkorin 5:b3aa0a49e21f 85 * TIMER1_IRQHandler
Alkorin 5:b3aa0a49e21f 86 * TIMER2_IRQHandler
Alkorin 5:b3aa0a49e21f 87 * TIMER3_IRQHandler
Alkorin 5:b3aa0a49e21f 88 * UART0_IRQHandler
Alkorin 5:b3aa0a49e21f 89 * UART1_IRQHandler
Alkorin 5:b3aa0a49e21f 90 * UART2_IRQHandler
Alkorin 5:b3aa0a49e21f 91 * UART3_IRQHandler
Alkorin 5:b3aa0a49e21f 92 * PWM1_IRQHandler
Alkorin 5:b3aa0a49e21f 93 * I2C0_IRQHandler
Alkorin 5:b3aa0a49e21f 94 * I2C1_IRQHandler
Alkorin 5:b3aa0a49e21f 95 * I2C2_IRQHandler
Alkorin 5:b3aa0a49e21f 96 * SPI_IRQHandler
Alkorin 5:b3aa0a49e21f 97 * SSP0_IRQHandler
Alkorin 5:b3aa0a49e21f 98 * SSP1_IRQHandler
Alkorin 5:b3aa0a49e21f 99 * PLL0_IRQHandler
Alkorin 5:b3aa0a49e21f 100 * RTC_IRQHandler
Alkorin 5:b3aa0a49e21f 101 * EINT0_IRQHandler
Alkorin 5:b3aa0a49e21f 102 * EINT1_IRQHandler
Alkorin 5:b3aa0a49e21f 103 * EINT2_IRQHandler
Alkorin 5:b3aa0a49e21f 104 * EINT3_IRQHandler
Alkorin 5:b3aa0a49e21f 105 * ADC_IRQHandler
Alkorin 5:b3aa0a49e21f 106 * BOD_IRQHandler
Alkorin 5:b3aa0a49e21f 107 * USB_IRQHandler
Alkorin 5:b3aa0a49e21f 108 * CAN_IRQHandler
Alkorin 5:b3aa0a49e21f 109 * DMA_IRQHandler
Alkorin 5:b3aa0a49e21f 110 * I2S_IRQHandler
Alkorin 5:b3aa0a49e21f 111 * ENET_IRQHandler
Alkorin 5:b3aa0a49e21f 112 * RIT_IRQHandler
Alkorin 5:b3aa0a49e21f 113 * MCPWM_IRQHandler
Alkorin 5:b3aa0a49e21f 114 * QEI_IRQHandler
Alkorin 5:b3aa0a49e21f 115 * PLL1_IRQHandler
Alkorin 5:b3aa0a49e21f 116 */
Alkorin 5:b3aa0a49e21f 117
Alkorin 5:b3aa0a49e21f 118 #endif