Mouse code for the MacroRat
mbed-dev/targets/TARGET_Atmel/TARGET_SAM_CortexM0P/TARGET_SAMR21G18A/PeripheralPins.c@46:b156ef445742, 2017-06-03 (annotated)
- Committer:
- sahilmgandhi
- Date:
- Sat Jun 03 00:22:44 2017 +0000
- Revision:
- 46:b156ef445742
- Parent:
- 18:6a4db94011d3
Final code for internal battlebot competition.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sahilmgandhi | 18:6a4db94011d3 | 1 | /* mbed Microcontroller Library |
sahilmgandhi | 18:6a4db94011d3 | 2 | * Copyright (c) 2006-2015 ARM Limited |
sahilmgandhi | 18:6a4db94011d3 | 3 | * |
sahilmgandhi | 18:6a4db94011d3 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
sahilmgandhi | 18:6a4db94011d3 | 5 | * you may not use this file except in compliance with the License. |
sahilmgandhi | 18:6a4db94011d3 | 6 | * You may obtain a copy of the License at |
sahilmgandhi | 18:6a4db94011d3 | 7 | * |
sahilmgandhi | 18:6a4db94011d3 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
sahilmgandhi | 18:6a4db94011d3 | 9 | * |
sahilmgandhi | 18:6a4db94011d3 | 10 | * Unless required by applicable law or agreed to in writing, software |
sahilmgandhi | 18:6a4db94011d3 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
sahilmgandhi | 18:6a4db94011d3 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
sahilmgandhi | 18:6a4db94011d3 | 13 | * See the License for the specific language governing permissions and |
sahilmgandhi | 18:6a4db94011d3 | 14 | * limitations under the License. |
sahilmgandhi | 18:6a4db94011d3 | 15 | */ |
sahilmgandhi | 18:6a4db94011d3 | 16 | |
sahilmgandhi | 18:6a4db94011d3 | 17 | #include "PeripheralPins.h" |
sahilmgandhi | 18:6a4db94011d3 | 18 | |
sahilmgandhi | 18:6a4db94011d3 | 19 | /************ADC***************/ |
sahilmgandhi | 18:6a4db94011d3 | 20 | const PinMap PinMap_ADC[] = { |
sahilmgandhi | 18:6a4db94011d3 | 21 | {PB08, ADC_2, 1}, |
sahilmgandhi | 18:6a4db94011d3 | 22 | {PB09, ADC_3, 1}, |
sahilmgandhi | 18:6a4db94011d3 | 23 | {PA04, ADC_4, 1}, |
sahilmgandhi | 18:6a4db94011d3 | 24 | {PA05, ADC_5, 1}, |
sahilmgandhi | 18:6a4db94011d3 | 25 | {PA06, ADC_6, 1}, |
sahilmgandhi | 18:6a4db94011d3 | 26 | {PA07, ADC_7, 1}, |
sahilmgandhi | 18:6a4db94011d3 | 27 | {PB00, ADC_8, 1}, |
sahilmgandhi | 18:6a4db94011d3 | 28 | {PB02, ADC_10, 1}, |
sahilmgandhi | 18:6a4db94011d3 | 29 | {PB03, ADC_11, 1}, |
sahilmgandhi | 18:6a4db94011d3 | 30 | {PA08, ADC_16, 1}, |
sahilmgandhi | 18:6a4db94011d3 | 31 | {PA09, ADC_17, 1}, |
sahilmgandhi | 18:6a4db94011d3 | 32 | {PA10, ADC_18, 1}, |
sahilmgandhi | 18:6a4db94011d3 | 33 | {PA11, ADC_19, 1}, |
sahilmgandhi | 18:6a4db94011d3 | 34 | |
sahilmgandhi | 18:6a4db94011d3 | 35 | /* Not connected */ |
sahilmgandhi | 18:6a4db94011d3 | 36 | {NC , NC , NC} |
sahilmgandhi | 18:6a4db94011d3 | 37 | }; |
sahilmgandhi | 18:6a4db94011d3 | 38 | |
sahilmgandhi | 18:6a4db94011d3 | 39 | /************SERCOM Pins***********/ |
sahilmgandhi | 18:6a4db94011d3 | 40 | const PinMap PinMap_SERCOM_PAD[] = { |
sahilmgandhi | 18:6a4db94011d3 | 41 | {PA00, SERCOM1_PAD0, 3}, |
sahilmgandhi | 18:6a4db94011d3 | 42 | {PA01, SERCOM1_PAD1, 3}, |
sahilmgandhi | 18:6a4db94011d3 | 43 | {PA04, SERCOM0_PAD0, 3}, |
sahilmgandhi | 18:6a4db94011d3 | 44 | {PA05, SERCOM0_PAD1, 3}, |
sahilmgandhi | 18:6a4db94011d3 | 45 | {PA06, SERCOM0_PAD2, 3}, |
sahilmgandhi | 18:6a4db94011d3 | 46 | {PA07, SERCOM0_PAD3, 3}, |
sahilmgandhi | 18:6a4db94011d3 | 47 | {PA08, SERCOM0_PAD0, 2}, |
sahilmgandhi | 18:6a4db94011d3 | 48 | {PA09, SERCOM0_PAD1, 2}, |
sahilmgandhi | 18:6a4db94011d3 | 49 | {PA12, SERCOM2_PAD0, 2}, |
sahilmgandhi | 18:6a4db94011d3 | 50 | {PA13, SERCOM2_PAD1, 2}, |
sahilmgandhi | 18:6a4db94011d3 | 51 | {PA14, SERCOM2_PAD2, 2}, |
sahilmgandhi | 18:6a4db94011d3 | 52 | {PA15, SERCOM2_PAD3, 2}, |
sahilmgandhi | 18:6a4db94011d3 | 53 | {PA16, SERCOM1_PAD0, 2}, |
sahilmgandhi | 18:6a4db94011d3 | 54 | {PA17, SERCOM1_PAD1, 2}, |
sahilmgandhi | 18:6a4db94011d3 | 55 | {PA18, SERCOM1_PAD2, 2}, |
sahilmgandhi | 18:6a4db94011d3 | 56 | {PA19, SERCOM1_PAD3, 2}, |
sahilmgandhi | 18:6a4db94011d3 | 57 | {PA22, SERCOM3_PAD0, 2}, |
sahilmgandhi | 18:6a4db94011d3 | 58 | {PA23, SERCOM3_PAD1, 2}, |
sahilmgandhi | 18:6a4db94011d3 | 59 | {PA24, SERCOM3_PAD2, 2}, |
sahilmgandhi | 18:6a4db94011d3 | 60 | {PA25, SERCOM3_PAD3, 2}, |
sahilmgandhi | 18:6a4db94011d3 | 61 | {PA27, SERCOM3_PAD0, 5}, |
sahilmgandhi | 18:6a4db94011d3 | 62 | {PA28, SERCOM3_PAD1, 5}, |
sahilmgandhi | 18:6a4db94011d3 | 63 | {PA30, SERCOM1_PAD2, 3}, |
sahilmgandhi | 18:6a4db94011d3 | 64 | {PA31, SERCOM1_PAD3, 3}, |
sahilmgandhi | 18:6a4db94011d3 | 65 | {PB02, SERCOM5_PAD0, 3}, |
sahilmgandhi | 18:6a4db94011d3 | 66 | {PB03, SERCOM5_PAD1, 3}, |
sahilmgandhi | 18:6a4db94011d3 | 67 | {PB22, SERCOM5_PAD2, 3}, |
sahilmgandhi | 18:6a4db94011d3 | 68 | {PB23, SERCOM5_PAD3, 3}, |
sahilmgandhi | 18:6a4db94011d3 | 69 | {PB30, SERCOM4_PAD2, 5}, |
sahilmgandhi | 18:6a4db94011d3 | 70 | {PB31, SERCOM4_PAD1, 5}, |
sahilmgandhi | 18:6a4db94011d3 | 71 | {PC18, SERCOM4_PAD3, 5}, |
sahilmgandhi | 18:6a4db94011d3 | 72 | {PC19, SERCOM4_PAD0, 5}, |
sahilmgandhi | 18:6a4db94011d3 | 73 | |
sahilmgandhi | 18:6a4db94011d3 | 74 | /* Not connected */ |
sahilmgandhi | 18:6a4db94011d3 | 75 | {NC , NC , NC} |
sahilmgandhi | 18:6a4db94011d3 | 76 | }; |
sahilmgandhi | 18:6a4db94011d3 | 77 | |
sahilmgandhi | 18:6a4db94011d3 | 78 | /*******SERCOM Pins extended*******/ |
sahilmgandhi | 18:6a4db94011d3 | 79 | const PinMap PinMap_SERCOM_PADEx[] = { |
sahilmgandhi | 18:6a4db94011d3 | 80 | {PA08, SERCOM2_PAD0, 3}, |
sahilmgandhi | 18:6a4db94011d3 | 81 | {PA09, SERCOM2_PAD1, 3}, |
sahilmgandhi | 18:6a4db94011d3 | 82 | {PA16, SERCOM3_PAD0, 3}, |
sahilmgandhi | 18:6a4db94011d3 | 83 | {PA17, SERCOM3_PAD1, 3}, |
sahilmgandhi | 18:6a4db94011d3 | 84 | {PA18, SERCOM3_PAD2, 3}, |
sahilmgandhi | 18:6a4db94011d3 | 85 | {PA19, SERCOM3_PAD3, 3}, |
sahilmgandhi | 18:6a4db94011d3 | 86 | {PA22, SERCOM5_PAD0, 3}, |
sahilmgandhi | 18:6a4db94011d3 | 87 | {PA23, SERCOM5_PAD1, 3}, |
sahilmgandhi | 18:6a4db94011d3 | 88 | {PA24, SERCOM5_PAD2, 3}, |
sahilmgandhi | 18:6a4db94011d3 | 89 | {PA25, SERCOM5_PAD3, 3}, |
sahilmgandhi | 18:6a4db94011d3 | 90 | |
sahilmgandhi | 18:6a4db94011d3 | 91 | /* Not connected */ |
sahilmgandhi | 18:6a4db94011d3 | 92 | {NC , NC , NC} |
sahilmgandhi | 18:6a4db94011d3 | 93 | }; |
sahilmgandhi | 18:6a4db94011d3 | 94 | |
sahilmgandhi | 18:6a4db94011d3 | 95 | |
sahilmgandhi | 18:6a4db94011d3 | 96 | /************PWM***************/ |
sahilmgandhi | 18:6a4db94011d3 | 97 | const PinMap PinMap_PWM[] = { |
sahilmgandhi | 18:6a4db94011d3 | 98 | {PA00, PWM_2, 4}, |
sahilmgandhi | 18:6a4db94011d3 | 99 | {PA01, PWM_2, 4}, |
sahilmgandhi | 18:6a4db94011d3 | 100 | {PA04, PWM_0, 4}, |
sahilmgandhi | 18:6a4db94011d3 | 101 | {PA05, PWM_0, 4}, |
sahilmgandhi | 18:6a4db94011d3 | 102 | {PA06, PWM_1, 4}, |
sahilmgandhi | 18:6a4db94011d3 | 103 | {PA07, PWM_1, 4}, |
sahilmgandhi | 18:6a4db94011d3 | 104 | {PA08, PWM_0, 4}, |
sahilmgandhi | 18:6a4db94011d3 | 105 | {PA09, PWM_0, 4}, |
sahilmgandhi | 18:6a4db94011d3 | 106 | {PA10, PWM_1, 4}, |
sahilmgandhi | 18:6a4db94011d3 | 107 | {PA11, PWM_1, 4}, |
sahilmgandhi | 18:6a4db94011d3 | 108 | {PA12, PWM_2, 4}, |
sahilmgandhi | 18:6a4db94011d3 | 109 | {PA13, PWM_2, 4}, |
sahilmgandhi | 18:6a4db94011d3 | 110 | {PA16, PWM_2, 4}, |
sahilmgandhi | 18:6a4db94011d3 | 111 | {PA17, PWM_2, 4}, |
sahilmgandhi | 18:6a4db94011d3 | 112 | {PA18, PWM_0, 5}, |
sahilmgandhi | 18:6a4db94011d3 | 113 | {PA19, PWM_0, 5}, |
sahilmgandhi | 18:6a4db94011d3 | 114 | {PA20, PWM_0, 5}, |
sahilmgandhi | 18:6a4db94011d3 | 115 | {PA22, PWM_0, 5}, |
sahilmgandhi | 18:6a4db94011d3 | 116 | {PA23, PWM_0, 5}, |
sahilmgandhi | 18:6a4db94011d3 | 117 | {PA24, PWM_1, 5}, |
sahilmgandhi | 18:6a4db94011d3 | 118 | {PA25, PWM_1, 5}, |
sahilmgandhi | 18:6a4db94011d3 | 119 | {PA30, PWM_1, 4}, |
sahilmgandhi | 18:6a4db94011d3 | 120 | {PA31, PWM_1, 4}, |
sahilmgandhi | 18:6a4db94011d3 | 121 | {PB16, PWM_0, 5}, |
sahilmgandhi | 18:6a4db94011d3 | 122 | {PB17, PWM_0, 5}, |
sahilmgandhi | 18:6a4db94011d3 | 123 | {PB30, PWM_0, 4}, |
sahilmgandhi | 18:6a4db94011d3 | 124 | {PB31, PWM_0, 4}, |
sahilmgandhi | 18:6a4db94011d3 | 125 | |
sahilmgandhi | 18:6a4db94011d3 | 126 | /* Not connected */ |
sahilmgandhi | 18:6a4db94011d3 | 127 | {NC , NC , NC} |
sahilmgandhi | 18:6a4db94011d3 | 128 | }; |
sahilmgandhi | 18:6a4db94011d3 | 129 | |
sahilmgandhi | 18:6a4db94011d3 | 130 | /**********EXTINT*************/ |
sahilmgandhi | 18:6a4db94011d3 | 131 | const PinMap PinMap_EXTINT[] = { |
sahilmgandhi | 18:6a4db94011d3 | 132 | {PA16, EXTINT_0, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 133 | {PB00, EXTINT_0, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 134 | {PB16, EXTINT_0, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 135 | {PA00, EXTINT_0, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 136 | |
sahilmgandhi | 18:6a4db94011d3 | 137 | {PA17, EXTINT_1, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 138 | {PB17, EXTINT_1, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 139 | {PA01, EXTINT_1, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 140 | |
sahilmgandhi | 18:6a4db94011d3 | 141 | {PA18, EXTINT_2, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 142 | {PB02, EXTINT_2, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 143 | |
sahilmgandhi | 18:6a4db94011d3 | 144 | {PA19, EXTINT_3, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 145 | {PB03, EXTINT_3, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 146 | |
sahilmgandhi | 18:6a4db94011d3 | 147 | {PA04, EXTINT_4, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 148 | {PA20, EXTINT_4, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 149 | |
sahilmgandhi | 18:6a4db94011d3 | 150 | {PA05, EXTINT_5, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 151 | |
sahilmgandhi | 18:6a4db94011d3 | 152 | {PA06, EXTINT_6, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 153 | {PA22, EXTINT_6, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 154 | {PB22, EXTINT_6, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 155 | |
sahilmgandhi | 18:6a4db94011d3 | 156 | {PA07, EXTINT_7, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 157 | {PA23, EXTINT_7, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 158 | {PB23, EXTINT_7, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 159 | |
sahilmgandhi | 18:6a4db94011d3 | 160 | {PA28, EXTINT_8, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 161 | {PB08, EXTINT_8, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 162 | |
sahilmgandhi | 18:6a4db94011d3 | 163 | {PA09, EXTINT_9, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 164 | {PB09, EXTINT_9, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 165 | |
sahilmgandhi | 18:6a4db94011d3 | 166 | {PA30, EXTINT_10, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 167 | {PA10, EXTINT_10, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 168 | |
sahilmgandhi | 18:6a4db94011d3 | 169 | {PA31, EXTINT_11, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 170 | {PA11, EXTINT_11, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 171 | |
sahilmgandhi | 18:6a4db94011d3 | 172 | {PA12, EXTINT_12, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 173 | {PA24, EXTINT_12, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 174 | |
sahilmgandhi | 18:6a4db94011d3 | 175 | {PA13, EXTINT_13, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 176 | {PA25, EXTINT_13, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 177 | |
sahilmgandhi | 18:6a4db94011d3 | 178 | {PB14, EXTINT_14, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 179 | {PB30, EXTINT_14, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 180 | {PA14, EXTINT_14, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 181 | |
sahilmgandhi | 18:6a4db94011d3 | 182 | {PA15, EXTINT_15, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 183 | {PA27, EXTINT_15, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 184 | {PB15, EXTINT_15, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 185 | {PB31, EXTINT_15, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 186 | |
sahilmgandhi | 18:6a4db94011d3 | 187 | /* Not connected */ |
sahilmgandhi | 18:6a4db94011d3 | 188 | {NC , NC , NC} |
sahilmgandhi | 18:6a4db94011d3 | 189 | }; |
sahilmgandhi | 18:6a4db94011d3 | 190 | |
sahilmgandhi | 18:6a4db94011d3 | 191 | const struct pwm_pin_channel pwn_pins[] = { |
sahilmgandhi | 18:6a4db94011d3 | 192 | {PA00, PWM_2, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 193 | {PA01, PWM_2, 1}, |
sahilmgandhi | 18:6a4db94011d3 | 194 | {PA04, PWM_0, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 195 | {PA05, PWM_0, 1}, |
sahilmgandhi | 18:6a4db94011d3 | 196 | {PA06, PWM_1, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 197 | {PA07, PWM_1, 1}, |
sahilmgandhi | 18:6a4db94011d3 | 198 | {PA08, PWM_0, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 199 | {PA09, PWM_0, 1}, |
sahilmgandhi | 18:6a4db94011d3 | 200 | {PA10, PWM_1, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 201 | {PA11, PWM_1, 1}, |
sahilmgandhi | 18:6a4db94011d3 | 202 | {PA12, PWM_2, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 203 | {PA13, PWM_2, 1}, |
sahilmgandhi | 18:6a4db94011d3 | 204 | {PA16, PWM_2, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 205 | {PA17, PWM_2, 1}, |
sahilmgandhi | 18:6a4db94011d3 | 206 | {PA18, PWM_0, 2}, |
sahilmgandhi | 18:6a4db94011d3 | 207 | {PA19, PWM_0, 3}, |
sahilmgandhi | 18:6a4db94011d3 | 208 | {PA20, PWM_0, 6}, |
sahilmgandhi | 18:6a4db94011d3 | 209 | {PA22, PWM_0, 4}, |
sahilmgandhi | 18:6a4db94011d3 | 210 | {PA23, PWM_0, 5}, |
sahilmgandhi | 18:6a4db94011d3 | 211 | {PA24, PWM_1, 2}, |
sahilmgandhi | 18:6a4db94011d3 | 212 | {PA25, PWM_1, 3}, |
sahilmgandhi | 18:6a4db94011d3 | 213 | {PA30, PWM_1, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 214 | {PA31, PWM_1, 1}, |
sahilmgandhi | 18:6a4db94011d3 | 215 | {PB16, PWM_0, 4}, |
sahilmgandhi | 18:6a4db94011d3 | 216 | {PB17, PWM_0, 5}, |
sahilmgandhi | 18:6a4db94011d3 | 217 | {PB30, PWM_0, 0}, |
sahilmgandhi | 18:6a4db94011d3 | 218 | {PB31, PWM_0, 1}, |
sahilmgandhi | 18:6a4db94011d3 | 219 | |
sahilmgandhi | 18:6a4db94011d3 | 220 | /* Not connected */ |
sahilmgandhi | 18:6a4db94011d3 | 221 | {(PinName) NC ,(PWMName) NC ,(uint8_t) NC} |
sahilmgandhi | 18:6a4db94011d3 | 222 | }; |
sahilmgandhi | 18:6a4db94011d3 | 223 | |
sahilmgandhi | 18:6a4db94011d3 | 224 | |
sahilmgandhi | 18:6a4db94011d3 | 225 |