mbed library sources

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Fri Jul 17 09:15:10 2015 +0100
Revision:
592:a274ee790e56
Parent:
579:53297373a894
Synchronized with git revision e7144f83a8d75df80c4877936b6ffe552b0be9e6

Full URL: https://github.com/mbedmicro/mbed/commit/e7144f83a8d75df80c4877936b6ffe552b0be9e6/

More API implementation for SAMR21

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 579:53297373a894 1 #ifndef UTILS_INTERRUPT_H
mbed_official 579:53297373a894 2 #define UTILS_INTERRUPT_H
mbed_official 579:53297373a894 3
mbed_official 579:53297373a894 4 #include <parts.h>
mbed_official 579:53297373a894 5
mbed_official 579:53297373a894 6 #if XMEGA || MEGA || TINY
mbed_official 579:53297373a894 7 # include "interrupt/interrupt_avr8.h"
mbed_official 579:53297373a894 8 #elif UC3
mbed_official 579:53297373a894 9 # include "interrupt/interrupt_avr32.h"
mbed_official 579:53297373a894 10 #elif SAM
mbed_official 579:53297373a894 11 # include "interrupt/interrupt_sam_nvic.h"
mbed_official 579:53297373a894 12 #else
mbed_official 579:53297373a894 13 # error Unsupported device.
mbed_official 579:53297373a894 14 #endif
mbed_official 579:53297373a894 15
mbed_official 579:53297373a894 16 /**
mbed_official 579:53297373a894 17 * \defgroup interrupt_group Global interrupt management
mbed_official 579:53297373a894 18 *
mbed_official 579:53297373a894 19 * This is a driver for global enabling and disabling of interrupts.
mbed_official 579:53297373a894 20 *
mbed_official 579:53297373a894 21 * @{
mbed_official 579:53297373a894 22 */
mbed_official 579:53297373a894 23
mbed_official 579:53297373a894 24 #if defined(__DOXYGEN__)
mbed_official 579:53297373a894 25 /**
mbed_official 579:53297373a894 26 * \def CONFIG_INTERRUPT_FORCE_INTC
mbed_official 579:53297373a894 27 * \brief Force usage of the ASF INTC driver
mbed_official 579:53297373a894 28 *
mbed_official 579:53297373a894 29 * Predefine this symbol when preprocessing to force the use of the ASF INTC driver.
mbed_official 579:53297373a894 30 * This is useful to ensure compatibility across compilers and shall be used only when required
mbed_official 579:53297373a894 31 * by the application needs.
mbed_official 579:53297373a894 32 */
mbed_official 579:53297373a894 33 # define CONFIG_INTERRUPT_FORCE_INTC
mbed_official 579:53297373a894 34 #endif
mbed_official 579:53297373a894 35
mbed_official 579:53297373a894 36 //! \name Global interrupt flags
mbed_official 579:53297373a894 37 //@{
mbed_official 579:53297373a894 38 /**
mbed_official 579:53297373a894 39 * \typedef irqflags_t
mbed_official 579:53297373a894 40 * \brief Type used for holding state of interrupt flag
mbed_official 579:53297373a894 41 */
mbed_official 579:53297373a894 42
mbed_official 579:53297373a894 43 /**
mbed_official 579:53297373a894 44 * \def cpu_irq_enable
mbed_official 579:53297373a894 45 * \brief Enable interrupts globally
mbed_official 579:53297373a894 46 */
mbed_official 579:53297373a894 47
mbed_official 579:53297373a894 48 /**
mbed_official 579:53297373a894 49 * \def cpu_irq_disable
mbed_official 579:53297373a894 50 * \brief Disable interrupts globally
mbed_official 579:53297373a894 51 */
mbed_official 579:53297373a894 52
mbed_official 579:53297373a894 53 /**
mbed_official 579:53297373a894 54 * \fn irqflags_t cpu_irq_save(void)
mbed_official 579:53297373a894 55 * \brief Get and clear the global interrupt flags
mbed_official 579:53297373a894 56 *
mbed_official 579:53297373a894 57 * Use in conjunction with \ref cpu_irq_restore.
mbed_official 579:53297373a894 58 *
mbed_official 579:53297373a894 59 * \return Current state of interrupt flags.
mbed_official 579:53297373a894 60 *
mbed_official 579:53297373a894 61 * \note This function leaves interrupts disabled.
mbed_official 579:53297373a894 62 */
mbed_official 579:53297373a894 63
mbed_official 579:53297373a894 64 /**
mbed_official 579:53297373a894 65 * \fn void cpu_irq_restore(irqflags_t flags)
mbed_official 579:53297373a894 66 * \brief Restore global interrupt flags
mbed_official 579:53297373a894 67 *
mbed_official 579:53297373a894 68 * Use in conjunction with \ref cpu_irq_save.
mbed_official 579:53297373a894 69 *
mbed_official 579:53297373a894 70 * \param flags State to set interrupt flag to.
mbed_official 579:53297373a894 71 */
mbed_official 579:53297373a894 72
mbed_official 579:53297373a894 73 /**
mbed_official 579:53297373a894 74 * \fn bool cpu_irq_is_enabled_flags(irqflags_t flags)
mbed_official 579:53297373a894 75 * \brief Check if interrupts are globally enabled in supplied flags
mbed_official 579:53297373a894 76 *
mbed_official 579:53297373a894 77 * \param flags Currents state of interrupt flags.
mbed_official 579:53297373a894 78 *
mbed_official 579:53297373a894 79 * \return True if interrupts are enabled.
mbed_official 579:53297373a894 80 */
mbed_official 579:53297373a894 81
mbed_official 579:53297373a894 82 /**
mbed_official 579:53297373a894 83 * \def cpu_irq_is_enabled
mbed_official 579:53297373a894 84 * \brief Check if interrupts are globally enabled
mbed_official 579:53297373a894 85 *
mbed_official 579:53297373a894 86 * \return True if interrupts are enabled.
mbed_official 579:53297373a894 87 */
mbed_official 579:53297373a894 88 //@}
mbed_official 579:53297373a894 89
mbed_official 579:53297373a894 90 //! @}
mbed_official 579:53297373a894 91
mbed_official 579:53297373a894 92 /**
mbed_official 579:53297373a894 93 * \ingroup interrupt_group
mbed_official 579:53297373a894 94 * \defgroup interrupt_deprecated_group Deprecated interrupt definitions
mbed_official 579:53297373a894 95 */
mbed_official 579:53297373a894 96
mbed_official 579:53297373a894 97 #endif /* UTILS_INTERRUPT_H */