mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

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

Committer:
mbed_official
Date:
Wed Jul 01 09:45:11 2015 +0100
Revision:
579:53297373a894
Child:
592:a274ee790e56
Synchronized with git revision d5b4d2ab9c47edb4dc5776e7177b0c2263459081

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

Initial version of drivers for SAMR21

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 579:53297373a894 1 /**
mbed_official 579:53297373a894 2 * \file
mbed_official 579:53297373a894 3 *
mbed_official 579:53297373a894 4 * \brief Instance description for EVSYS
mbed_official 579:53297373a894 5 *
mbed_official 579:53297373a894 6 * Copyright (c) 2014 Atmel Corporation. All rights reserved.
mbed_official 579:53297373a894 7 *
mbed_official 579:53297373a894 8 * \asf_license_start
mbed_official 579:53297373a894 9 *
mbed_official 579:53297373a894 10 * \page License
mbed_official 579:53297373a894 11 *
mbed_official 579:53297373a894 12 * Redistribution and use in source and binary forms, with or without
mbed_official 579:53297373a894 13 * modification, are permitted provided that the following conditions are met:
mbed_official 579:53297373a894 14 *
mbed_official 579:53297373a894 15 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 579:53297373a894 16 * this list of conditions and the following disclaimer.
mbed_official 579:53297373a894 17 *
mbed_official 579:53297373a894 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 579:53297373a894 19 * this list of conditions and the following disclaimer in the documentation
mbed_official 579:53297373a894 20 * and/or other materials provided with the distribution.
mbed_official 579:53297373a894 21 *
mbed_official 579:53297373a894 22 * 3. The name of Atmel may not be used to endorse or promote products derived
mbed_official 579:53297373a894 23 * from this software without specific prior written permission.
mbed_official 579:53297373a894 24 *
mbed_official 579:53297373a894 25 * 4. This software may only be redistributed and used in connection with an
mbed_official 579:53297373a894 26 * Atmel microcontroller product.
mbed_official 579:53297373a894 27 *
mbed_official 579:53297373a894 28 * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
mbed_official 579:53297373a894 29 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
mbed_official 579:53297373a894 30 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
mbed_official 579:53297373a894 31 * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
mbed_official 579:53297373a894 32 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 579:53297373a894 33 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
mbed_official 579:53297373a894 34 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
mbed_official 579:53297373a894 35 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
mbed_official 579:53297373a894 36 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
mbed_official 579:53297373a894 37 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
mbed_official 579:53297373a894 38 * POSSIBILITY OF SUCH DAMAGE.
mbed_official 579:53297373a894 39 *
mbed_official 579:53297373a894 40 * \asf_license_stop
mbed_official 579:53297373a894 41 *
mbed_official 579:53297373a894 42 */
mbed_official 579:53297373a894 43 /**
mbed_official 579:53297373a894 44 * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
mbed_official 579:53297373a894 45 */
mbed_official 579:53297373a894 46
mbed_official 579:53297373a894 47 #ifndef _SAMD21_EVSYS_INSTANCE_
mbed_official 579:53297373a894 48 #define _SAMD21_EVSYS_INSTANCE_
mbed_official 579:53297373a894 49
mbed_official 579:53297373a894 50 /* ========== Register definition for EVSYS peripheral ========== */
mbed_official 579:53297373a894 51 #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
mbed_official 579:53297373a894 52 #define REG_EVSYS_CTRL (0x42000400U) /**< \brief (EVSYS) Control */
mbed_official 579:53297373a894 53 #define REG_EVSYS_CHANNEL (0x42000404U) /**< \brief (EVSYS) Channel */
mbed_official 579:53297373a894 54 #define REG_EVSYS_USER (0x42000408U) /**< \brief (EVSYS) User Multiplexer */
mbed_official 579:53297373a894 55 #define REG_EVSYS_CHSTATUS (0x4200040CU) /**< \brief (EVSYS) Channel Status */
mbed_official 579:53297373a894 56 #define REG_EVSYS_INTENCLR (0x42000410U) /**< \brief (EVSYS) Interrupt Enable Clear */
mbed_official 579:53297373a894 57 #define REG_EVSYS_INTENSET (0x42000414U) /**< \brief (EVSYS) Interrupt Enable Set */
mbed_official 579:53297373a894 58 #define REG_EVSYS_INTFLAG (0x42000418U) /**< \brief (EVSYS) Interrupt Flag Status and Clear */
mbed_official 579:53297373a894 59 #else
mbed_official 579:53297373a894 60 #define REG_EVSYS_CTRL (*(WoReg8 *)0x42000400U) /**< \brief (EVSYS) Control */
mbed_official 579:53297373a894 61 #define REG_EVSYS_CHANNEL (*(RwReg *)0x42000404U) /**< \brief (EVSYS) Channel */
mbed_official 579:53297373a894 62 #define REG_EVSYS_USER (*(RwReg16*)0x42000408U) /**< \brief (EVSYS) User Multiplexer */
mbed_official 579:53297373a894 63 #define REG_EVSYS_CHSTATUS (*(RoReg *)0x4200040CU) /**< \brief (EVSYS) Channel Status */
mbed_official 579:53297373a894 64 #define REG_EVSYS_INTENCLR (*(RwReg *)0x42000410U) /**< \brief (EVSYS) Interrupt Enable Clear */
mbed_official 579:53297373a894 65 #define REG_EVSYS_INTENSET (*(RwReg *)0x42000414U) /**< \brief (EVSYS) Interrupt Enable Set */
mbed_official 579:53297373a894 66 #define REG_EVSYS_INTFLAG (*(RwReg *)0x42000418U) /**< \brief (EVSYS) Interrupt Flag Status and Clear */
mbed_official 579:53297373a894 67 #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
mbed_official 579:53297373a894 68
mbed_official 579:53297373a894 69 /* ========== Instance parameters for EVSYS peripheral ========== */
mbed_official 579:53297373a894 70 #define EVSYS_CHANNELS 12 // Number of Channels
mbed_official 579:53297373a894 71 #define EVSYS_CHANNELS_BITS 4 // Number of bits to select Channel
mbed_official 579:53297373a894 72 #define EVSYS_CHANNELS_MSB 11 // Number of Channels - 1
mbed_official 579:53297373a894 73 #define EVSYS_EXTEVT_NUM 0 // Number of External Event Generators
mbed_official 579:53297373a894 74 #define EVSYS_GCLK_ID_0 7
mbed_official 579:53297373a894 75 #define EVSYS_GCLK_ID_1 8
mbed_official 579:53297373a894 76 #define EVSYS_GCLK_ID_2 9
mbed_official 579:53297373a894 77 #define EVSYS_GCLK_ID_3 10
mbed_official 579:53297373a894 78 #define EVSYS_GCLK_ID_4 11
mbed_official 579:53297373a894 79 #define EVSYS_GCLK_ID_5 12
mbed_official 579:53297373a894 80 #define EVSYS_GCLK_ID_6 13
mbed_official 579:53297373a894 81 #define EVSYS_GCLK_ID_7 14
mbed_official 579:53297373a894 82 #define EVSYS_GCLK_ID_8 15
mbed_official 579:53297373a894 83 #define EVSYS_GCLK_ID_9 16
mbed_official 579:53297373a894 84 #define EVSYS_GCLK_ID_10 17
mbed_official 579:53297373a894 85 #define EVSYS_GCLK_ID_11 18
mbed_official 579:53297373a894 86 #define EVSYS_GCLK_ID_LSB 7
mbed_official 579:53297373a894 87 #define EVSYS_GCLK_ID_MSB 18
mbed_official 579:53297373a894 88 #define EVSYS_GCLK_ID_SIZE 12
mbed_official 579:53297373a894 89 #define EVSYS_GENERATORS 73 // Total Number of Event Generators
mbed_official 579:53297373a894 90 #define EVSYS_GENERATORS_BITS 7 // Number of bits to select Event Generator
mbed_official 579:53297373a894 91 #define EVSYS_USERS 29 // Total Number of Event Users
mbed_official 579:53297373a894 92 #define EVSYS_USERS_BITS 5 // Number of bits to select Event User
mbed_official 579:53297373a894 93
mbed_official 579:53297373a894 94 // GENERATORS
mbed_official 579:53297373a894 95 #define EVSYS_ID_GEN_RTC_CMP_0 1
mbed_official 579:53297373a894 96 #define EVSYS_ID_GEN_RTC_CMP_1 2
mbed_official 579:53297373a894 97 #define EVSYS_ID_GEN_RTC_OVF 3
mbed_official 579:53297373a894 98 #define EVSYS_ID_GEN_RTC_PER_0 4
mbed_official 579:53297373a894 99 #define EVSYS_ID_GEN_RTC_PER_1 5
mbed_official 579:53297373a894 100 #define EVSYS_ID_GEN_RTC_PER_2 6
mbed_official 579:53297373a894 101 #define EVSYS_ID_GEN_RTC_PER_3 7
mbed_official 579:53297373a894 102 #define EVSYS_ID_GEN_RTC_PER_4 8
mbed_official 579:53297373a894 103 #define EVSYS_ID_GEN_RTC_PER_5 9
mbed_official 579:53297373a894 104 #define EVSYS_ID_GEN_RTC_PER_6 10
mbed_official 579:53297373a894 105 #define EVSYS_ID_GEN_RTC_PER_7 11
mbed_official 579:53297373a894 106 #define EVSYS_ID_GEN_EIC_EXTINT_0 12
mbed_official 579:53297373a894 107 #define EVSYS_ID_GEN_EIC_EXTINT_1 13
mbed_official 579:53297373a894 108 #define EVSYS_ID_GEN_EIC_EXTINT_2 14
mbed_official 579:53297373a894 109 #define EVSYS_ID_GEN_EIC_EXTINT_3 15
mbed_official 579:53297373a894 110 #define EVSYS_ID_GEN_EIC_EXTINT_4 16
mbed_official 579:53297373a894 111 #define EVSYS_ID_GEN_EIC_EXTINT_5 17
mbed_official 579:53297373a894 112 #define EVSYS_ID_GEN_EIC_EXTINT_6 18
mbed_official 579:53297373a894 113 #define EVSYS_ID_GEN_EIC_EXTINT_7 19
mbed_official 579:53297373a894 114 #define EVSYS_ID_GEN_EIC_EXTINT_8 20
mbed_official 579:53297373a894 115 #define EVSYS_ID_GEN_EIC_EXTINT_9 21
mbed_official 579:53297373a894 116 #define EVSYS_ID_GEN_EIC_EXTINT_10 22
mbed_official 579:53297373a894 117 #define EVSYS_ID_GEN_EIC_EXTINT_11 23
mbed_official 579:53297373a894 118 #define EVSYS_ID_GEN_EIC_EXTINT_12 24
mbed_official 579:53297373a894 119 #define EVSYS_ID_GEN_EIC_EXTINT_13 25
mbed_official 579:53297373a894 120 #define EVSYS_ID_GEN_EIC_EXTINT_14 26
mbed_official 579:53297373a894 121 #define EVSYS_ID_GEN_EIC_EXTINT_15 27
mbed_official 579:53297373a894 122 #define EVSYS_ID_GEN_EIC_EXTINT_16 28
mbed_official 579:53297373a894 123 #define EVSYS_ID_GEN_EIC_EXTINT_17 29
mbed_official 579:53297373a894 124 #define EVSYS_ID_GEN_DMAC_CH_0 30
mbed_official 579:53297373a894 125 #define EVSYS_ID_GEN_DMAC_CH_1 31
mbed_official 579:53297373a894 126 #define EVSYS_ID_GEN_DMAC_CH_2 32
mbed_official 579:53297373a894 127 #define EVSYS_ID_GEN_DMAC_CH_3 33
mbed_official 579:53297373a894 128 #define EVSYS_ID_GEN_TCC0_OVF 34
mbed_official 579:53297373a894 129 #define EVSYS_ID_GEN_TCC0_TRG 35
mbed_official 579:53297373a894 130 #define EVSYS_ID_GEN_TCC0_CNT 36
mbed_official 579:53297373a894 131 #define EVSYS_ID_GEN_TCC0_MCX_0 37
mbed_official 579:53297373a894 132 #define EVSYS_ID_GEN_TCC0_MCX_1 38
mbed_official 579:53297373a894 133 #define EVSYS_ID_GEN_TCC0_MCX_2 39
mbed_official 579:53297373a894 134 #define EVSYS_ID_GEN_TCC0_MCX_3 40
mbed_official 579:53297373a894 135 #define EVSYS_ID_GEN_TCC1_OVF 41
mbed_official 579:53297373a894 136 #define EVSYS_ID_GEN_TCC1_TRG 42
mbed_official 579:53297373a894 137 #define EVSYS_ID_GEN_TCC1_CNT 43
mbed_official 579:53297373a894 138 #define EVSYS_ID_GEN_TCC1_MCX_0 44
mbed_official 579:53297373a894 139 #define EVSYS_ID_GEN_TCC1_MCX_1 45
mbed_official 579:53297373a894 140 #define EVSYS_ID_GEN_TCC2_OVF 46
mbed_official 579:53297373a894 141 #define EVSYS_ID_GEN_TCC2_TRG 47
mbed_official 579:53297373a894 142 #define EVSYS_ID_GEN_TCC2_CNT 48
mbed_official 579:53297373a894 143 #define EVSYS_ID_GEN_TCC2_MCX_0 49
mbed_official 579:53297373a894 144 #define EVSYS_ID_GEN_TCC2_MCX_1 50
mbed_official 579:53297373a894 145 #define EVSYS_ID_GEN_TC3_OVF 51
mbed_official 579:53297373a894 146 #define EVSYS_ID_GEN_TC3_MCX_0 52
mbed_official 579:53297373a894 147 #define EVSYS_ID_GEN_TC3_MCX_1 53
mbed_official 579:53297373a894 148 #define EVSYS_ID_GEN_TC4_OVF 54
mbed_official 579:53297373a894 149 #define EVSYS_ID_GEN_TC4_MCX_0 55
mbed_official 579:53297373a894 150 #define EVSYS_ID_GEN_TC4_MCX_1 56
mbed_official 579:53297373a894 151 #define EVSYS_ID_GEN_TC5_OVF 57
mbed_official 579:53297373a894 152 #define EVSYS_ID_GEN_TC5_MCX_0 58
mbed_official 579:53297373a894 153 #define EVSYS_ID_GEN_TC5_MCX_1 59
mbed_official 579:53297373a894 154 #define EVSYS_ID_GEN_TC6_OVF 60
mbed_official 579:53297373a894 155 #define EVSYS_ID_GEN_TC6_MCX_0 61
mbed_official 579:53297373a894 156 #define EVSYS_ID_GEN_TC6_MCX_1 62
mbed_official 579:53297373a894 157 #define EVSYS_ID_GEN_TC7_OVF 63
mbed_official 579:53297373a894 158 #define EVSYS_ID_GEN_TC7_MCX_0 64
mbed_official 579:53297373a894 159 #define EVSYS_ID_GEN_TC7_MCX_1 65
mbed_official 579:53297373a894 160 #define EVSYS_ID_GEN_ADC_RESRDY 66
mbed_official 579:53297373a894 161 #define EVSYS_ID_GEN_ADC_WINMON 67
mbed_official 579:53297373a894 162 #define EVSYS_ID_GEN_AC_COMP_0 68
mbed_official 579:53297373a894 163 #define EVSYS_ID_GEN_AC_COMP_1 69
mbed_official 579:53297373a894 164 #define EVSYS_ID_GEN_AC_WIN_0 70
mbed_official 579:53297373a894 165 #define EVSYS_ID_GEN_DAC_EMPTY 71
mbed_official 579:53297373a894 166 #define EVSYS_ID_GEN_PTC_EOC 72
mbed_official 579:53297373a894 167 #define EVSYS_ID_GEN_PTC_WCOMP 73
mbed_official 579:53297373a894 168
mbed_official 579:53297373a894 169 // USERS
mbed_official 579:53297373a894 170 #define EVSYS_ID_USER_DMAC_CH_0 0
mbed_official 579:53297373a894 171 #define EVSYS_ID_USER_DMAC_CH_1 1
mbed_official 579:53297373a894 172 #define EVSYS_ID_USER_DMAC_CH_2 2
mbed_official 579:53297373a894 173 #define EVSYS_ID_USER_DMAC_CH_3 3
mbed_official 579:53297373a894 174 #define EVSYS_ID_USER_TCC0_EV_0 4
mbed_official 579:53297373a894 175 #define EVSYS_ID_USER_TCC0_EV_1 5
mbed_official 579:53297373a894 176 #define EVSYS_ID_USER_TCC0_MC_0 6
mbed_official 579:53297373a894 177 #define EVSYS_ID_USER_TCC0_MC_1 7
mbed_official 579:53297373a894 178 #define EVSYS_ID_USER_TCC0_MC_2 8
mbed_official 579:53297373a894 179 #define EVSYS_ID_USER_TCC0_MC_3 9
mbed_official 579:53297373a894 180 #define EVSYS_ID_USER_TCC1_EV_0 10
mbed_official 579:53297373a894 181 #define EVSYS_ID_USER_TCC1_EV_1 11
mbed_official 579:53297373a894 182 #define EVSYS_ID_USER_TCC1_MC_0 12
mbed_official 579:53297373a894 183 #define EVSYS_ID_USER_TCC1_MC_1 13
mbed_official 579:53297373a894 184 #define EVSYS_ID_USER_TCC2_EV_0 14
mbed_official 579:53297373a894 185 #define EVSYS_ID_USER_TCC2_EV_1 15
mbed_official 579:53297373a894 186 #define EVSYS_ID_USER_TCC2_MC_0 16
mbed_official 579:53297373a894 187 #define EVSYS_ID_USER_TCC2_MC_1 17
mbed_official 579:53297373a894 188 #define EVSYS_ID_USER_TC3_EVU 18
mbed_official 579:53297373a894 189 #define EVSYS_ID_USER_TC4_EVU 19
mbed_official 579:53297373a894 190 #define EVSYS_ID_USER_TC5_EVU 20
mbed_official 579:53297373a894 191 #define EVSYS_ID_USER_TC6_EVU 21
mbed_official 579:53297373a894 192 #define EVSYS_ID_USER_TC7_EVU 22
mbed_official 579:53297373a894 193 #define EVSYS_ID_USER_ADC_START 23
mbed_official 579:53297373a894 194 #define EVSYS_ID_USER_ADC_SYNC 24
mbed_official 579:53297373a894 195 #define EVSYS_ID_USER_AC_SOC_0 25
mbed_official 579:53297373a894 196 #define EVSYS_ID_USER_AC_SOC_1 26
mbed_official 579:53297373a894 197 #define EVSYS_ID_USER_DAC_START 27
mbed_official 579:53297373a894 198 #define EVSYS_ID_USER_PTC_STCONV 28
mbed_official 579:53297373a894 199
mbed_official 579:53297373a894 200 #endif /* _SAMD21_EVSYS_INSTANCE_ */