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_PERIPHERALNAMES_H
elessair 0:f269e3021894 17 #define MBED_PERIPHERALNAMES_H
elessair 0:f269e3021894 18
elessair 0:f269e3021894 19 #include "cmsis.h"
elessair 0:f269e3021894 20 #include "PinNames.h"
elessair 0:f269e3021894 21
elessair 0:f269e3021894 22 #ifdef __cplusplus
elessair 0:f269e3021894 23 extern "C" {
elessair 0:f269e3021894 24 #endif
elessair 0:f269e3021894 25
elessair 0:f269e3021894 26 typedef enum {
elessair 0:f269e3021894 27 UART0,
elessair 0:f269e3021894 28 UART1,
elessair 0:f269e3021894 29 UART2,
elessair 0:f269e3021894 30 UART3,
elessair 0:f269e3021894 31 UART4,
elessair 0:f269e3021894 32 UART5,
elessair 0:f269e3021894 33 UART6,
elessair 0:f269e3021894 34 UART7,
elessair 0:f269e3021894 35 } UARTName;
elessair 0:f269e3021894 36
elessair 0:f269e3021894 37 // PWMType & 1 == 1 then have to use PWDTR[12] == 1
elessair 0:f269e3021894 38 typedef enum {
elessair 0:f269e3021894 39 PWM1A = 0,
elessair 0:f269e3021894 40 PWM1B,
elessair 0:f269e3021894 41 PWM1C,
elessair 0:f269e3021894 42 PWM1D,
elessair 0:f269e3021894 43 PWM1E,
elessair 0:f269e3021894 44 PWM1F,
elessair 0:f269e3021894 45 PWM1G,
elessair 0:f269e3021894 46 PWM1H,
elessair 0:f269e3021894 47 PWM2A = 0x10,
elessair 0:f269e3021894 48 PWM2B,
elessair 0:f269e3021894 49 PWM2C,
elessair 0:f269e3021894 50 PWM2D,
elessair 0:f269e3021894 51 PWM2E,
elessair 0:f269e3021894 52 PWM2F,
elessair 0:f269e3021894 53 PWM2G,
elessair 0:f269e3021894 54 PWM2H,
elessair 0:f269e3021894 55 } PWMType;
elessair 0:f269e3021894 56
elessair 0:f269e3021894 57 typedef enum {
elessair 0:f269e3021894 58 TIOC0A = 0,
elessair 0:f269e3021894 59 TIOC0B,
elessair 0:f269e3021894 60 TIOC0C,
elessair 0:f269e3021894 61 TIOC0D,
elessair 0:f269e3021894 62 TIOC1A = 0x10,
elessair 0:f269e3021894 63 TIOC1B,
elessair 0:f269e3021894 64 TIOC2A = 0x20,
elessair 0:f269e3021894 65 TIOC2B,
elessair 0:f269e3021894 66 TIOC3A = 0x30,
elessair 0:f269e3021894 67 TIOC3B,
elessair 0:f269e3021894 68 TIOC3C,
elessair 0:f269e3021894 69 TIOC3D,
elessair 0:f269e3021894 70 TIOC4A = 0x40,
elessair 0:f269e3021894 71 TIOC4B,
elessair 0:f269e3021894 72 TIOC4C,
elessair 0:f269e3021894 73 TIOC4D,
elessair 0:f269e3021894 74 } MTU2_PWMType;
elessair 0:f269e3021894 75
elessair 0:f269e3021894 76 typedef enum {
elessair 0:f269e3021894 77 PWM0_PIN = 0,
elessair 0:f269e3021894 78 PWM1_PIN,
elessair 0:f269e3021894 79 PWM2_PIN,
elessair 0:f269e3021894 80 PWM3_PIN,
elessair 0:f269e3021894 81 PWM4_PIN,
elessair 0:f269e3021894 82 PWM5_PIN,
elessair 0:f269e3021894 83 PWM6_PIN,
elessair 0:f269e3021894 84 PWM7_PIN,
elessair 0:f269e3021894 85 PWM8_PIN,
elessair 0:f269e3021894 86 PWM9_PIN,
elessair 0:f269e3021894 87 PWM10_PIN,
elessair 0:f269e3021894 88 PWM11_PIN,
elessair 0:f269e3021894 89 PWM12_PIN,
elessair 0:f269e3021894 90 PWM13_PIN,
elessair 0:f269e3021894 91 MTU2_PWM0_PIN = 0x20,
elessair 0:f269e3021894 92 MTU2_PWM1_PIN,
elessair 0:f269e3021894 93 MTU2_PWM2_PIN,
elessair 0:f269e3021894 94 MTU2_PWM3_PIN,
elessair 0:f269e3021894 95 MTU2_PWM4_PIN,
elessair 0:f269e3021894 96 MTU2_PWM5_PIN,
elessair 0:f269e3021894 97 MTU2_PWM6_PIN,
elessair 0:f269e3021894 98 MTU2_PWM7_PIN,
elessair 0:f269e3021894 99 MTU2_PWM8_PIN,
elessair 0:f269e3021894 100 MTU2_PWM9_PIN,
elessair 0:f269e3021894 101 MTU2_PWM10_PIN,
elessair 0:f269e3021894 102 MTU2_PWM11_PIN,
elessair 0:f269e3021894 103 MTU2_PWM12_PIN,
elessair 0:f269e3021894 104 MTU2_PWM13_PIN,
elessair 0:f269e3021894 105 MTU2_PWM14_PIN,
elessair 0:f269e3021894 106 MTU2_PWM15_PIN,
elessair 0:f269e3021894 107 MTU2_PWM16_PIN,
elessair 0:f269e3021894 108 MTU2_PWM17_PIN,
elessair 0:f269e3021894 109 MTU2_PWM18_PIN,
elessair 0:f269e3021894 110 MTU2_PWM19_PIN,
elessair 0:f269e3021894 111 MTU2_PWM20_PIN,
elessair 0:f269e3021894 112 MTU2_PWM21_PIN,
elessair 0:f269e3021894 113 } PWMName;
elessair 0:f269e3021894 114
elessair 0:f269e3021894 115 typedef enum {
elessair 0:f269e3021894 116 AN0= 0,
elessair 0:f269e3021894 117 AN1= 1,
elessair 0:f269e3021894 118 AN2= 2,
elessair 0:f269e3021894 119 AN3= 3,
elessair 0:f269e3021894 120 AN4= 4,
elessair 0:f269e3021894 121 AN5= 5,
elessair 0:f269e3021894 122 AN6= 6,
elessair 0:f269e3021894 123 AN7= 7,
elessair 0:f269e3021894 124 } ADCName;
elessair 0:f269e3021894 125
elessair 0:f269e3021894 126 typedef enum {
elessair 0:f269e3021894 127 SPI_0 = 0,
elessair 0:f269e3021894 128 SPI_1,
elessair 0:f269e3021894 129 SPI_2,
elessair 0:f269e3021894 130 SPI_3,
elessair 0:f269e3021894 131 } SPIName;
elessair 0:f269e3021894 132
elessair 0:f269e3021894 133 typedef enum {
elessair 0:f269e3021894 134 I2C_0 = 0,
elessair 0:f269e3021894 135 I2C_1,
elessair 0:f269e3021894 136 I2C_2,
elessair 0:f269e3021894 137 I2C_3
elessair 0:f269e3021894 138 } I2CName;
elessair 0:f269e3021894 139
elessair 0:f269e3021894 140 typedef enum {
elessair 0:f269e3021894 141 CAN_0 = 0,
elessair 0:f269e3021894 142 CAN_1,
elessair 0:f269e3021894 143 CAN_2,
elessair 0:f269e3021894 144 CAN_3,
elessair 0:f269e3021894 145 CAN_4
elessair 0:f269e3021894 146 } CANName;
elessair 0:f269e3021894 147
elessair 0:f269e3021894 148
elessair 0:f269e3021894 149 #define STDIO_UART_TX USBTX
elessair 0:f269e3021894 150 #define STDIO_UART_RX USBRX
elessair 0:f269e3021894 151 #define STDIO_UART UART2
elessair 0:f269e3021894 152
elessair 0:f269e3021894 153
elessair 0:f269e3021894 154
elessair 0:f269e3021894 155 #ifdef __cplusplus
elessair 0:f269e3021894 156 }
elessair 0:f269e3021894 157 #endif
elessair 0:f269e3021894 158
elessair 0:f269e3021894 159 #endif