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) 2015 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 /* BEETLE Pin Names */
elessair 0:f269e3021894 34 /* GPIO0 */
elessair 0:f269e3021894 35 P0_0 = 0,
elessair 0:f269e3021894 36 P0_1 = 1,
elessair 0:f269e3021894 37 P0_2 = 2,
elessair 0:f269e3021894 38 P0_3 = 3,
elessair 0:f269e3021894 39 P0_4 = 4,
elessair 0:f269e3021894 40 P0_5 = 5,
elessair 0:f269e3021894 41 P0_6 = 6,
elessair 0:f269e3021894 42 P0_7 = 7,
elessair 0:f269e3021894 43 P0_8 = 8,
elessair 0:f269e3021894 44 P0_9 = 9,
elessair 0:f269e3021894 45 P0_10 = 10,
elessair 0:f269e3021894 46 P0_11 = 11,
elessair 0:f269e3021894 47 P0_12 = 12,
elessair 0:f269e3021894 48 P0_13 = 13,
elessair 0:f269e3021894 49 P0_14 = 14,
elessair 0:f269e3021894 50 P0_15 = 15,
elessair 0:f269e3021894 51
elessair 0:f269e3021894 52 /* GPIO1 */
elessair 0:f269e3021894 53 P1_0 = 16,
elessair 0:f269e3021894 54 P1_1 = 17,
elessair 0:f269e3021894 55 P1_2 = 18,
elessair 0:f269e3021894 56 P1_3 = 19,
elessair 0:f269e3021894 57 P1_4 = 20,
elessair 0:f269e3021894 58 P1_5 = 21,
elessair 0:f269e3021894 59 P1_6 = 22,
elessair 0:f269e3021894 60 P1_7 = 23,
elessair 0:f269e3021894 61 P1_8 = 24,
elessair 0:f269e3021894 62 P1_9 = 25,
elessair 0:f269e3021894 63 P1_10 = 26,
elessair 0:f269e3021894 64 P1_11 = 27,
elessair 0:f269e3021894 65 P1_12 = 28,
elessair 0:f269e3021894 66 P1_13 = 29,
elessair 0:f269e3021894 67 P1_14 = 30,
elessair 0:f269e3021894 68 P1_15 = 31,
elessair 0:f269e3021894 69
elessair 0:f269e3021894 70 /* Arduino Connector Namings */
elessair 0:f269e3021894 71 A0 = 600,
elessair 0:f269e3021894 72 A1 = 601,
elessair 0:f269e3021894 73 A2 = 602,
elessair 0:f269e3021894 74 A3 = 603,
elessair 0:f269e3021894 75 A4 = 604,
elessair 0:f269e3021894 76 A5 = 605,
elessair 0:f269e3021894 77 D0 = P0_0,
elessair 0:f269e3021894 78 D1 = P0_1,
elessair 0:f269e3021894 79 D2 = P0_2,
elessair 0:f269e3021894 80 D3 = P0_3,
elessair 0:f269e3021894 81 D4 = P0_4,
elessair 0:f269e3021894 82 D5 = P0_5,
elessair 0:f269e3021894 83 D6 = P0_6,
elessair 0:f269e3021894 84 D7 = P0_7,
elessair 0:f269e3021894 85 D8 = P0_8,
elessair 0:f269e3021894 86 D9 = P0_9,
elessair 0:f269e3021894 87 D10 = P0_10,
elessair 0:f269e3021894 88 D11 = P0_11,
elessair 0:f269e3021894 89 D12 = P0_12,
elessair 0:f269e3021894 90 D13 = P0_13,
elessair 0:f269e3021894 91 D14 = P0_14,
elessair 0:f269e3021894 92 D15 = P0_15,
elessair 0:f269e3021894 93
elessair 0:f269e3021894 94 /* TRACE Ports */
elessair 0:f269e3021894 95 TRACECLK = P0_2,
elessair 0:f269e3021894 96 TRACED0 = P0_6,
elessair 0:f269e3021894 97 TRACED1 = P0_7,
elessair 0:f269e3021894 98 TRACED2 = P0_8,
elessair 0:f269e3021894 99 TRACED3 = P0_9,
elessair 0:f269e3021894 100
elessair 0:f269e3021894 101 /* Other BEETLE Pin Names */
elessair 0:f269e3021894 102
elessair 0:f269e3021894 103 //Shield SPI
elessair 0:f269e3021894 104 SHIELD_SPI_SCK = 320,
elessair 0:f269e3021894 105 SHIELD_SPI_MOSI = 321,
elessair 0:f269e3021894 106 SHIELD_SPI_MISO = 322,
elessair 0:f269e3021894 107 SHIELD_SPI_nCS = 323,
elessair 0:f269e3021894 108
elessair 0:f269e3021894 109 //ADC SPI
elessair 0:f269e3021894 110 ADC_SPI_MOSI = 650,
elessair 0:f269e3021894 111 ADC_SPI_MISO = 651,
elessair 0:f269e3021894 112 ADC_SPI_SCK = 652,
elessair 0:f269e3021894 113 ADC_SPI_nCS = 653,
elessair 0:f269e3021894 114
elessair 0:f269e3021894 115 //Uart
elessair 0:f269e3021894 116 UART_TX0 = 400,
elessair 0:f269e3021894 117 UART_RX0 = 401,
elessair 0:f269e3021894 118 UART_TX1 = 402,
elessair 0:f269e3021894 119 UART_RX1 = 403,
elessair 0:f269e3021894 120
elessair 0:f269e3021894 121 //Shield I2C
elessair 0:f269e3021894 122 SHIELD_SDA = 504,
elessair 0:f269e3021894 123 SHIELD_SCL = 505,
elessair 0:f269e3021894 124
elessair 0:f269e3021894 125 // Internal I2C for temperature and acceleromter sensor
elessair 0:f269e3021894 126 SENSOR_SDA = 506,
elessair 0:f269e3021894 127 SENSOR_SCL = 507,
elessair 0:f269e3021894 128
elessair 0:f269e3021894 129 // Emulated LEDS
elessair 0:f269e3021894 130 /*
elessair 0:f269e3021894 131 * Beetle board is built to optimize power consumption therefore does not
elessair 0:f269e3021894 132 * provide on-board LEDs. The configuration below is provided only for
elessair 0:f269e3021894 133 * compatibility purposes with MBED test suite.
elessair 0:f269e3021894 134 * The LEDs [1:4] are emulated and trapped in our GPIO driver.
elessair 0:f269e3021894 135 * For more details on how to use a Led on an external PIN via GPIO
elessair 0:f269e3021894 136 * configuration please refer to the connected community page below:
elessair 0:f269e3021894 137 * https://community.arm.com/docs/DOC-11713
elessair 0:f269e3021894 138 */
elessair 0:f269e3021894 139 LED1 = 1001,
elessair 0:f269e3021894 140 LED2 = 1002,
elessair 0:f269e3021894 141 LED3 = 1003,
elessair 0:f269e3021894 142 LED4 = 1004,
elessair 0:f269e3021894 143
elessair 0:f269e3021894 144 // Not connected
elessair 0:f269e3021894 145 NC = (int)0xFFFFFFFF,
elessair 0:f269e3021894 146 } PinName;
elessair 0:f269e3021894 147
elessair 0:f269e3021894 148 typedef enum {
elessair 0:f269e3021894 149 PullUp = 2,
elessair 0:f269e3021894 150 PullDown = 1,
elessair 0:f269e3021894 151 PullNone = 0,
elessair 0:f269e3021894 152 Repeater = 3,
elessair 0:f269e3021894 153 OpenDrain = 4,
elessair 0:f269e3021894 154 PullDefault = PullDown
elessair 0:f269e3021894 155 } PinMode;
elessair 0:f269e3021894 156
elessair 0:f269e3021894 157 #ifdef __cplusplus
elessair 0:f269e3021894 158 }
elessair 0:f269e3021894 159 #endif
elessair 0:f269e3021894 160
elessair 0:f269e3021894 161 #endif