Simple mbed library with macros

Dependents:   SimpleTimer SimpleUART SimpleTimer Stoppuhr1

Committer:
Alkorin
Date:
Sat Nov 27 19:08:38 2010 +0000
Revision:
21:ce11d7ff88af
Parent:
18:aa026d9f7fc0
Added some Ethernet/IP structures

Who changed what in which revision?

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