mbed os with nrf51 internal bandgap enabled to read battery level

Dependents:   BLE_file_test BLE_Blink ExternalEncoder

Committer:
elessair
Date:
Sun Oct 23 15:10:02 2016 +0000
Revision:
0:f269e3021894
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
elessair 0:f269e3021894 1 /* mbed Microcontroller Library
elessair 0:f269e3021894 2 * Copyright (c) 2006-2013 ARM Limited
elessair 0:f269e3021894 3 *
elessair 0:f269e3021894 4 * Licensed under the Apache License, Version 2.0 (the "License");
elessair 0:f269e3021894 5 * you may not use this file except in compliance with the License.
elessair 0:f269e3021894 6 * You may obtain a copy of the License at
elessair 0:f269e3021894 7 *
elessair 0:f269e3021894 8 * http://www.apache.org/licenses/LICENSE-2.0
elessair 0:f269e3021894 9 *
elessair 0:f269e3021894 10 * Unless required by applicable law or agreed to in writing, software
elessair 0:f269e3021894 11 * distributed under the License is distributed on an "AS IS" BASIS,
elessair 0:f269e3021894 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
elessair 0:f269e3021894 13 * See the License for the specific language governing permissions and
elessair 0:f269e3021894 14 * limitations under the License.
elessair 0:f269e3021894 15 */
elessair 0:f269e3021894 16 #ifndef MBED_PINNAMES_H
elessair 0:f269e3021894 17 #define MBED_PINNAMES_H
elessair 0:f269e3021894 18
elessair 0:f269e3021894 19 #include "cmsis.h"
elessair 0:f269e3021894 20
elessair 0:f269e3021894 21 #ifdef __cplusplus
elessair 0:f269e3021894 22 extern "C" {
elessair 0:f269e3021894 23 #endif
elessair 0:f269e3021894 24
elessair 0:f269e3021894 25 typedef enum {
elessair 0:f269e3021894 26 PIN_INPUT,
elessair 0:f269e3021894 27 PIN_OUTPUT
elessair 0:f269e3021894 28 } PinDirection;
elessair 0:f269e3021894 29
elessair 0:f269e3021894 30 #define PORT_SHIFT 5
elessair 0:f269e3021894 31
elessair 0:f269e3021894 32 typedef enum {
elessair 0:f269e3021894 33 // MPS2 EXP Pin Names
elessair 0:f269e3021894 34 EXP0 = 0 ,
elessair 0:f269e3021894 35 EXP1 = 4 ,
elessair 0:f269e3021894 36 EXP2 = 2 ,
elessair 0:f269e3021894 37 EXP3 = 3 ,
elessair 0:f269e3021894 38 EXP4 = 1 ,
elessair 0:f269e3021894 39 EXP5 = 15,
elessair 0:f269e3021894 40 EXP6 = 5 ,
elessair 0:f269e3021894 41 EXP7 = 6 ,
elessair 0:f269e3021894 42 EXP8 = 7 ,
elessair 0:f269e3021894 43 EXP9 = 8 ,
elessair 0:f269e3021894 44 EXP10 =9 ,
elessair 0:f269e3021894 45 EXP11 =13,
elessair 0:f269e3021894 46 EXP12 =10,
elessair 0:f269e3021894 47 EXP13 =11,
elessair 0:f269e3021894 48 EXP14 =12,
elessair 0:f269e3021894 49 EXP15 =14,
elessair 0:f269e3021894 50 EXP16 =18,
elessair 0:f269e3021894 51 EXP17 =19,
elessair 0:f269e3021894 52 EXP18 =20,
elessair 0:f269e3021894 53 EXP19 =21,
elessair 0:f269e3021894 54 EXP20 =52,
elessair 0:f269e3021894 55 EXP21 =53,
elessair 0:f269e3021894 56 EXP22 =54,
elessair 0:f269e3021894 57 EXP23 =55,
elessair 0:f269e3021894 58 EXP24 =56,
elessair 0:f269e3021894 59 EXP25 =57,
elessair 0:f269e3021894 60
elessair 0:f269e3021894 61 EXP26 =16,
elessair 0:f269e3021894 62 EXP27 =25,
elessair 0:f269e3021894 63 EXP28 =24,
elessair 0:f269e3021894 64 EXP29 =31,
elessair 0:f269e3021894 65 EXP30 =17,
elessair 0:f269e3021894 66 EXP31 =23,
elessair 0:f269e3021894 67 EXP32 =27,
elessair 0:f269e3021894 68 EXP33 =30,
elessair 0:f269e3021894 69 EXP34 =26,
elessair 0:f269e3021894 70 EXP35 =28,
elessair 0:f269e3021894 71 EXP36 =29,
elessair 0:f269e3021894 72 EXP37 =58,
elessair 0:f269e3021894 73 EXP38 =48,
elessair 0:f269e3021894 74 EXP39 =49,
elessair 0:f269e3021894 75 EXP40 =50,
elessair 0:f269e3021894 76 EXP41 =22,
elessair 0:f269e3021894 77 EXP42 =59,
elessair 0:f269e3021894 78 EXP43 =60,
elessair 0:f269e3021894 79 EXP44 =51,
elessair 0:f269e3021894 80 EXP45 =61,
elessair 0:f269e3021894 81 EXP46 =62,
elessair 0:f269e3021894 82 EXP47 =63,
elessair 0:f269e3021894 83 EXP48 =64,
elessair 0:f269e3021894 84 EXP49 =65,
elessair 0:f269e3021894 85 EXP50 =66,
elessair 0:f269e3021894 86 EXP51 =67,
elessair 0:f269e3021894 87
elessair 0:f269e3021894 88 // Other mbed Pin Names
elessair 0:f269e3021894 89
elessair 0:f269e3021894 90 //LEDs on mps2
elessair 0:f269e3021894 91 //user leds
elessair 0:f269e3021894 92 USERLED1 = 100,
elessair 0:f269e3021894 93 USERLED2 = 101,
elessair 0:f269e3021894 94 //user switches
elessair 0:f269e3021894 95 USERSW1 = 110,
elessair 0:f269e3021894 96 USERSW2 = 111,
elessair 0:f269e3021894 97
elessair 0:f269e3021894 98 //mcc leds
elessair 0:f269e3021894 99 LED1 = 200,
elessair 0:f269e3021894 100 LED2 = 201,
elessair 0:f269e3021894 101 LED3 = 202,
elessair 0:f269e3021894 102 LED4 = 203,
elessair 0:f269e3021894 103 LED5 = 204,
elessair 0:f269e3021894 104 LED6 = 205,
elessair 0:f269e3021894 105 LED7 = 206,
elessair 0:f269e3021894 106 LED8 = 207,
elessair 0:f269e3021894 107
elessair 0:f269e3021894 108 //MCC Switches
elessair 0:f269e3021894 109 SW1 = 210,
elessair 0:f269e3021894 110 SW2 = 211,
elessair 0:f269e3021894 111 SW3 = 212,
elessair 0:f269e3021894 112 SW4 = 213,
elessair 0:f269e3021894 113 SW5 = 214,
elessair 0:f269e3021894 114 SW6 = 215,
elessair 0:f269e3021894 115 SW7 = 216,
elessair 0:f269e3021894 116 SW8 = 217,
elessair 0:f269e3021894 117
elessair 0:f269e3021894 118 //MPS2 SPI header pins j21
elessair 0:f269e3021894 119 MOSI_SPI = 300,
elessair 0:f269e3021894 120 MISO_SPI = 301,
elessair 0:f269e3021894 121 SCLK_SPI = 302,
elessair 0:f269e3021894 122 SSEL_SPI = 303,
elessair 0:f269e3021894 123
elessair 0:f269e3021894 124 //MPS2 CLCD SPI
elessair 0:f269e3021894 125 CLCD_MOSI = 304,
elessair 0:f269e3021894 126 CLCD_MISO = 305,
elessair 0:f269e3021894 127 CLCD_SCLK = 306,
elessair 0:f269e3021894 128 CLCD_SSEL = 307,
elessair 0:f269e3021894 129 CLCD_RESET = 308,
elessair 0:f269e3021894 130 CLCD_RS = 309,
elessair 0:f269e3021894 131 CLCD_RD = 310,
elessair 0:f269e3021894 132 CLCD_BL_CTRL = 311,
elessair 0:f269e3021894 133
elessair 0:f269e3021894 134 //MPS2 shield 0 SPI
elessair 0:f269e3021894 135 SHIELD_0_SPI_SCK = 320,
elessair 0:f269e3021894 136 SHIELD_0_SPI_MOSI = 321,
elessair 0:f269e3021894 137 SHIELD_0_SPI_MISO = 322,
elessair 0:f269e3021894 138 SHIELD_0_SPI_nCS = 323,
elessair 0:f269e3021894 139
elessair 0:f269e3021894 140 //MPS2 shield 1 SPI
elessair 0:f269e3021894 141 SHIELD_1_SPI_SCK = 331,
elessair 0:f269e3021894 142 SHIELD_1_SPI_MOSI = 332,
elessair 0:f269e3021894 143 SHIELD_1_SPI_MISO = 333,
elessair 0:f269e3021894 144 SHIELD_1_SPI_nCS = 334,
elessair 0:f269e3021894 145
elessair 0:f269e3021894 146 //MPS2 shield ADC SPI
elessair 0:f269e3021894 147 ADC_MOSI = 650,
elessair 0:f269e3021894 148 ADC_MISO = 651,
elessair 0:f269e3021894 149 ADC_SCLK = 652,
elessair 0:f269e3021894 150 ADC_SSEL = 653,
elessair 0:f269e3021894 151
elessair 0:f269e3021894 152 //MPS2 Uart
elessair 0:f269e3021894 153 USBTX = 400,
elessair 0:f269e3021894 154 USBRX = 401,
elessair 0:f269e3021894 155 XB_TX = 402,
elessair 0:f269e3021894 156 XB_RX = 403,
elessair 0:f269e3021894 157 SH0_TX = 404,
elessair 0:f269e3021894 158 SH0_RX = 405,
elessair 0:f269e3021894 159 SH1_TX = 406,
elessair 0:f269e3021894 160 SH1_RX = 407,
elessair 0:f269e3021894 161
elessair 0:f269e3021894 162 //MPS2 I2C touchscreen and audio
elessair 0:f269e3021894 163 TSC_SDA = 500,
elessair 0:f269e3021894 164 TSC_SCL = 501,
elessair 0:f269e3021894 165 AUD_SDA = 502,
elessair 0:f269e3021894 166 AUD_SCL = 503,
elessair 0:f269e3021894 167
elessair 0:f269e3021894 168 //MPS2 I2C for shield
elessair 0:f269e3021894 169 SHIELD_0_SDA = 504,
elessair 0:f269e3021894 170 SHIELD_0_SCL = 505,
elessair 0:f269e3021894 171 SHIELD_1_SDA = 506,
elessair 0:f269e3021894 172 SHIELD_1_SCL = 507,
elessair 0:f269e3021894 173
elessair 0:f269e3021894 174 //MPS2 shield Analog pins
elessair 0:f269e3021894 175 A0_0 = 600,
elessair 0:f269e3021894 176 A0_1 = 601,
elessair 0:f269e3021894 177 A0_2 = 602,
elessair 0:f269e3021894 178 A0_3 = 603,
elessair 0:f269e3021894 179 A0_4 = 604,
elessair 0:f269e3021894 180 A0_5 = 605,
elessair 0:f269e3021894 181 A1_0 = 606,
elessair 0:f269e3021894 182 A1_1 = 607,
elessair 0:f269e3021894 183 A1_2 = 608,
elessair 0:f269e3021894 184 A1_3 = 609,
elessair 0:f269e3021894 185 A1_4 = 610,
elessair 0:f269e3021894 186 A1_5 = 611,
elessair 0:f269e3021894 187 //MPS2 Shield Digital pins
elessair 0:f269e3021894 188 D0_0 = EXP0,
elessair 0:f269e3021894 189 D0_1 = EXP4,
elessair 0:f269e3021894 190 D0_2 = EXP2,
elessair 0:f269e3021894 191 D0_3 = EXP3,
elessair 0:f269e3021894 192 D0_4 = EXP1,
elessair 0:f269e3021894 193 D0_5 = EXP6,
elessair 0:f269e3021894 194 D0_6 = EXP7,
elessair 0:f269e3021894 195 D0_7 = EXP8,
elessair 0:f269e3021894 196 D0_8 = EXP9,
elessair 0:f269e3021894 197 D0_9 = EXP10,
elessair 0:f269e3021894 198 D0_10 = EXP12,
elessair 0:f269e3021894 199 D0_11 = EXP13,
elessair 0:f269e3021894 200 D0_12 = EXP14,
elessair 0:f269e3021894 201 D0_13 = EXP11,
elessair 0:f269e3021894 202 D0_14 = EXP15,
elessair 0:f269e3021894 203 D0_15 = EXP5,
elessair 0:f269e3021894 204
elessair 0:f269e3021894 205 D1_0 = EXP26,
elessair 0:f269e3021894 206 D1_1 = EXP30,
elessair 0:f269e3021894 207 D1_2 = EXP28,
elessair 0:f269e3021894 208 D1_3 = EXP29,
elessair 0:f269e3021894 209 D1_4 = EXP27,
elessair 0:f269e3021894 210 D1_5 = EXP32,
elessair 0:f269e3021894 211 D1_6 = EXP33,
elessair 0:f269e3021894 212 D1_7 = EXP34,
elessair 0:f269e3021894 213 D1_8 = EXP35,
elessair 0:f269e3021894 214 D1_9 = EXP36,
elessair 0:f269e3021894 215 D1_10 = EXP38,
elessair 0:f269e3021894 216 D1_11 = EXP39,
elessair 0:f269e3021894 217 D1_12 = EXP40,
elessair 0:f269e3021894 218 D1_13 = EXP44,
elessair 0:f269e3021894 219 D1_14 = EXP41,
elessair 0:f269e3021894 220 D1_15 = EXP31,
elessair 0:f269e3021894 221
elessair 0:f269e3021894 222 // Not connected
elessair 0:f269e3021894 223 NC = (int)0xFFFFFFFF,
elessair 0:f269e3021894 224 } PinName;
elessair 0:f269e3021894 225
elessair 0:f269e3021894 226
elessair 0:f269e3021894 227 typedef enum {
elessair 0:f269e3021894 228 PullUp = 2,
elessair 0:f269e3021894 229 PullDown = 1,
elessair 0:f269e3021894 230 PullNone = 0,
elessair 0:f269e3021894 231 Repeater = 3,
elessair 0:f269e3021894 232 OpenDrain = 4,
elessair 0:f269e3021894 233 PullDefault = PullDown
elessair 0:f269e3021894 234 } PinMode;
elessair 0:f269e3021894 235
elessair 0:f269e3021894 236 #ifdef __cplusplus
elessair 0:f269e3021894 237 }
elessair 0:f269e3021894 238 #endif
elessair 0:f269e3021894 239
elessair 0:f269e3021894 240 #endif
elessair 0:f269e3021894 241