The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Committer:
AnnaBridge
Date:
Thu Nov 08 11:45:42 2018 +0000
Revision:
171:3a7713b1edbc
Parent:
TARGET_SAMR21G18A/TARGET_Atmel/TARGET_SAM_CortexM0P/drivers/system/interrupt/TARGET_SAMR21/system_interrupt_features.h@111:4336505e4b1c
mbed library. Release version 164

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 111:4336505e4b1c 1 /**
Kojto 111:4336505e4b1c 2 * \file
Kojto 111:4336505e4b1c 3 *
Kojto 111:4336505e4b1c 4 * \brief SAM R21 System Interrupt Driver
Kojto 111:4336505e4b1c 5 *
Kojto 111:4336505e4b1c 6 * Copyright (C) 2014-2015 Atmel Corporation. All rights reserved.
Kojto 111:4336505e4b1c 7 *
Kojto 111:4336505e4b1c 8 * \asf_license_start
Kojto 111:4336505e4b1c 9 *
Kojto 111:4336505e4b1c 10 * \page License
Kojto 111:4336505e4b1c 11 *
Kojto 111:4336505e4b1c 12 * Redistribution and use in source and binary forms, with or without
Kojto 111:4336505e4b1c 13 * modification, are permitted provided that the following conditions are met:
Kojto 111:4336505e4b1c 14 *
Kojto 111:4336505e4b1c 15 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 111:4336505e4b1c 16 * this list of conditions and the following disclaimer.
Kojto 111:4336505e4b1c 17 *
Kojto 111:4336505e4b1c 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 111:4336505e4b1c 19 * this list of conditions and the following disclaimer in the documentation
Kojto 111:4336505e4b1c 20 * and/or other materials provided with the distribution.
Kojto 111:4336505e4b1c 21 *
Kojto 111:4336505e4b1c 22 * 3. The name of Atmel may not be used to endorse or promote products derived
Kojto 111:4336505e4b1c 23 * from this software without specific prior written permission.
Kojto 111:4336505e4b1c 24 *
Kojto 111:4336505e4b1c 25 * 4. This software may only be redistributed and used in connection with an
Kojto 111:4336505e4b1c 26 * Atmel microcontroller product.
Kojto 111:4336505e4b1c 27 *
Kojto 111:4336505e4b1c 28 * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
Kojto 111:4336505e4b1c 29 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
Kojto 111:4336505e4b1c 30 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
Kojto 111:4336505e4b1c 31 * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
Kojto 111:4336505e4b1c 32 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 111:4336505e4b1c 33 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
Kojto 111:4336505e4b1c 34 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
Kojto 111:4336505e4b1c 35 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
Kojto 111:4336505e4b1c 36 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
Kojto 111:4336505e4b1c 37 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
Kojto 111:4336505e4b1c 38 * POSSIBILITY OF SUCH DAMAGE.
Kojto 111:4336505e4b1c 39 *
Kojto 111:4336505e4b1c 40 * \asf_license_stop
Kojto 111:4336505e4b1c 41 *
Kojto 111:4336505e4b1c 42 */
Kojto 111:4336505e4b1c 43 /*
Kojto 111:4336505e4b1c 44 * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
Kojto 111:4336505e4b1c 45 */
Kojto 111:4336505e4b1c 46
Kojto 111:4336505e4b1c 47 #ifndef SYSTEM_INTERRUPT_FEATURES_H_INCLUDED
Kojto 111:4336505e4b1c 48 #define SYSTEM_INTERRUPT_FEATURES_H_INCLUDED
Kojto 111:4336505e4b1c 49
Kojto 111:4336505e4b1c 50 #if !defined(__DOXYGEN__)
Kojto 111:4336505e4b1c 51
Kojto 111:4336505e4b1c 52 /* Generates a interrupt vector table enum list entry for a given module type
Kojto 111:4336505e4b1c 53 and index (e.g. "SYSTEM_INTERRUPT_MODULE_TC0 = TC0_IRQn,"). */
Kojto 111:4336505e4b1c 54 # define _MODULE_IRQn(n, module) \
Kojto 111:4336505e4b1c 55 SYSTEM_INTERRUPT_MODULE_##module##n = module##n##_IRQn,
Kojto 111:4336505e4b1c 56
Kojto 111:4336505e4b1c 57 /* Generates interrupt vector table enum list entries for all instances of a
Kojto 111:4336505e4b1c 58 given module type on the selected device. */
Kojto 111:4336505e4b1c 59 # define _SYSTEM_INTERRUPT_MODULES(name) \
Kojto 111:4336505e4b1c 60 MREPEAT(name##_INST_NUM, _MODULE_IRQn, name)
Kojto 111:4336505e4b1c 61
Kojto 111:4336505e4b1c 62 # define _SYSTEM_INTERRUPT_IPSR_MASK 0x0000003f
Kojto 111:4336505e4b1c 63 # define _SYSTEM_INTERRUPT_PRIORITY_MASK 0x00000003
Kojto 111:4336505e4b1c 64
Kojto 111:4336505e4b1c 65 # define _SYSTEM_INTERRUPT_EXTERNAL_VECTOR_START 0
Kojto 111:4336505e4b1c 66
Kojto 111:4336505e4b1c 67 # define _SYSTEM_INTERRUPT_SYSTICK_PRI_POS 30
Kojto 111:4336505e4b1c 68 #endif
Kojto 111:4336505e4b1c 69
Kojto 111:4336505e4b1c 70 /**
Kojto 111:4336505e4b1c 71 * \addtogroup asfdoc_sam0_system_interrupt_group
Kojto 111:4336505e4b1c 72 * @{
Kojto 111:4336505e4b1c 73 */
Kojto 111:4336505e4b1c 74
Kojto 111:4336505e4b1c 75 /**
Kojto 111:4336505e4b1c 76 * \brief Table of possible system interrupt/exception vector numbers.
Kojto 111:4336505e4b1c 77 *
Kojto 111:4336505e4b1c 78 * Table of all possible interrupt and exception vector indexes within the
Kojto 111:4336505e4b1c 79 * SAMR21 device.
Kojto 111:4336505e4b1c 80 */
Kojto 111:4336505e4b1c 81 #if defined(__DOXYGEN__)
Kojto 111:4336505e4b1c 82 /** \note The actual enumeration name is "system_interrupt_vector". */
Kojto 111:4336505e4b1c 83 enum system_interrupt_vector_samr21 {
Kojto 111:4336505e4b1c 84 #else
Kojto 111:4336505e4b1c 85 enum system_interrupt_vector {
Kojto 111:4336505e4b1c 86 #endif
Kojto 111:4336505e4b1c 87 /** Interrupt vector index for a NMI interrupt. */
Kojto 111:4336505e4b1c 88 SYSTEM_INTERRUPT_NON_MASKABLE = NonMaskableInt_IRQn,
Kojto 111:4336505e4b1c 89 /** Interrupt vector index for a Hard Fault memory access exception. */
Kojto 111:4336505e4b1c 90 SYSTEM_INTERRUPT_HARD_FAULT = HardFault_IRQn,
Kojto 111:4336505e4b1c 91 /** Interrupt vector index for a Supervisor Call exception. */
Kojto 111:4336505e4b1c 92 SYSTEM_INTERRUPT_SV_CALL = SVCall_IRQn,
Kojto 111:4336505e4b1c 93 /** Interrupt vector index for a Pending Supervisor interrupt. */
Kojto 111:4336505e4b1c 94 SYSTEM_INTERRUPT_PENDING_SV = PendSV_IRQn,
Kojto 111:4336505e4b1c 95 /** Interrupt vector index for a System Tick interrupt. */
Kojto 111:4336505e4b1c 96 SYSTEM_INTERRUPT_SYSTICK = SysTick_IRQn,
Kojto 111:4336505e4b1c 97
Kojto 111:4336505e4b1c 98 /** Interrupt vector index for a Power Manager peripheral interrupt. */
Kojto 111:4336505e4b1c 99 SYSTEM_INTERRUPT_MODULE_PM = PM_IRQn,
Kojto 111:4336505e4b1c 100 /** Interrupt vector index for a System Control peripheral interrupt. */
Kojto 111:4336505e4b1c 101 SYSTEM_INTERRUPT_MODULE_SYSCTRL = SYSCTRL_IRQn,
Kojto 111:4336505e4b1c 102 /** Interrupt vector index for a Watch Dog peripheral interrupt. */
Kojto 111:4336505e4b1c 103 SYSTEM_INTERRUPT_MODULE_WDT = WDT_IRQn,
Kojto 111:4336505e4b1c 104 /** Interrupt vector index for a Real Time Clock peripheral interrupt. */
Kojto 111:4336505e4b1c 105 SYSTEM_INTERRUPT_MODULE_RTC = RTC_IRQn,
Kojto 111:4336505e4b1c 106 /** Interrupt vector index for an External Interrupt peripheral interrupt. */
Kojto 111:4336505e4b1c 107 SYSTEM_INTERRUPT_MODULE_EIC = EIC_IRQn,
Kojto 111:4336505e4b1c 108 /** Interrupt vector index for a Non Volatile Memory Controller interrupt. */
Kojto 111:4336505e4b1c 109 SYSTEM_INTERRUPT_MODULE_NVMCTRL = NVMCTRL_IRQn,
Kojto 111:4336505e4b1c 110 /** Interrupt vector index for a Direct Memory Access interrupt. */
Kojto 111:4336505e4b1c 111 SYSTEM_INTERRUPT_MODULE_DMA = DMAC_IRQn,
Kojto 111:4336505e4b1c 112 /** Interrupt vector index for a Universal Serial Bus interrupt. */
Kojto 111:4336505e4b1c 113 SYSTEM_INTERRUPT_MODULE_USB = USB_IRQn,
Kojto 111:4336505e4b1c 114 /** Interrupt vector index for an Event System interrupt. */
Kojto 111:4336505e4b1c 115 SYSTEM_INTERRUPT_MODULE_EVSYS = EVSYS_IRQn,
Kojto 111:4336505e4b1c 116 #if defined(__DOXYGEN__)
Kojto 111:4336505e4b1c 117 /** Interrupt vector index for a SERCOM peripheral interrupt.
Kojto 111:4336505e4b1c 118 *
Kojto 111:4336505e4b1c 119 * Each specific device may contain several SERCOM peripherals; each module
Kojto 111:4336505e4b1c 120 * instance will have its own entry in the table, with the instance number
Kojto 111:4336505e4b1c 121 * substituted for "n" in the entry name (e.g.
Kojto 111:4336505e4b1c 122 * \c SYSTEM_INTERRUPT_MODULE_SERCOM0).
Kojto 111:4336505e4b1c 123 */
Kojto 111:4336505e4b1c 124 SYSTEM_INTERRUPT_MODULE_SERCOMn = SERCOMn_IRQn,
Kojto 111:4336505e4b1c 125
Kojto 111:4336505e4b1c 126 /** Interrupt vector index for a Timer/Counter Control peripheral interrupt.
Kojto 111:4336505e4b1c 127 *
Kojto 111:4336505e4b1c 128 * Each specific device may contain several TCC peripherals; each module
Kojto 111:4336505e4b1c 129 * instance will have its own entry in the table, with the instance number
Kojto 111:4336505e4b1c 130 * substituted for "n" in the entry name (e.g.
Kojto 111:4336505e4b1c 131 * \c SYSTEM_INTERRUPT_MODULE_TCC0).
Kojto 111:4336505e4b1c 132 */
Kojto 111:4336505e4b1c 133 SYSTEM_INTERRUPT_MODULE_TCCn = TCCn_IRQn,
Kojto 111:4336505e4b1c 134
Kojto 111:4336505e4b1c 135 /** Interrupt vector index for a Timer/Counter peripheral interrupt.
Kojto 111:4336505e4b1c 136 *
Kojto 111:4336505e4b1c 137 * Each specific device may contain several TC peripherals; each module
Kojto 111:4336505e4b1c 138 * instance will have its own entry in the table, with the instance number
Kojto 111:4336505e4b1c 139 * substituted for "n" in the entry name (e.g.
Kojto 111:4336505e4b1c 140 * \c SYSTEM_INTERRUPT_MODULE_TC3).
Kojto 111:4336505e4b1c 141 */
Kojto 111:4336505e4b1c 142 SYSTEM_INTERRUPT_MODULE_TCn = TCn_IRQn,
Kojto 111:4336505e4b1c 143 #else
Kojto 111:4336505e4b1c 144 _SYSTEM_INTERRUPT_MODULES(SERCOM)
Kojto 111:4336505e4b1c 145
Kojto 111:4336505e4b1c 146 _SYSTEM_INTERRUPT_MODULES(TCC)
Kojto 111:4336505e4b1c 147
Kojto 111:4336505e4b1c 148 SYSTEM_INTERRUPT_MODULE_TC3 = TC3_IRQn,
Kojto 111:4336505e4b1c 149 SYSTEM_INTERRUPT_MODULE_TC4 = TC4_IRQn,
Kojto 111:4336505e4b1c 150 SYSTEM_INTERRUPT_MODULE_TC5 = TC5_IRQn,
Kojto 111:4336505e4b1c 151
Kojto 111:4336505e4b1c 152 #endif
Kojto 111:4336505e4b1c 153
Kojto 111:4336505e4b1c 154 /** Interrupt vector index for an Analog Comparator peripheral interrupt. */
Kojto 111:4336505e4b1c 155 SYSTEM_INTERRUPT_MODULE_AC = AC_IRQn,
Kojto 111:4336505e4b1c 156 /** Interrupt vector index for an Analog-to-Digital peripheral interrupt. */
Kojto 111:4336505e4b1c 157 SYSTEM_INTERRUPT_MODULE_ADC = ADC_IRQn,
Kojto 111:4336505e4b1c 158 /** Interrupt vector index for a Peripheral Touch Controller peripheral
Kojto 111:4336505e4b1c 159 * interrupt. */
Kojto 111:4336505e4b1c 160 SYSTEM_INTERRUPT_MODULE_PTC = PTC_IRQn,
Kojto 111:4336505e4b1c 161 };
Kojto 111:4336505e4b1c 162
Kojto 111:4336505e4b1c 163 /** @} */
Kojto 111:4336505e4b1c 164
Kojto 111:4336505e4b1c 165 #endif